Skip to content

Commit 68e6bec

Browse files
committed
Reduce website loading times and related code cleanup
1 parent 93a60da commit 68e6bec

File tree

22 files changed

+112
-56
lines changed

22 files changed

+112
-56
lines changed

.github/workflows/website.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ jobs:
3838
git rev-parse --abbrev-ref HEAD | grep master > /dev/null || export INDEX_HTML_HEAD_INCLUSION=""
3939
4040
- name: 🌐 Build Graphite website with Zola
41+
env:
42+
MODE: prod
4143
run: |
4244
cd website
4345
zola --config config_prod.toml build

website/content/_index.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ title = "Free online vector editor & procedural design tool"
33
template = "section.html"
44

55
[extra]
6-
css_inline = ["index.css"]
7-
js = ["carousel.js", "youtube-embed.js", "video-autoplay.js"]
6+
css = ["/index.css", "/balance-text.css"]
7+
js = ["/js/carousel.js", "/js/youtube-embed.js", "/js/video-autoplay.js"]
8+
linked_js = ["https://static.graphite.rs/text-balancer/text-balancer.js"]
89
meta_description = "Open source free software. A vector graphics creativity suite with a clean, intuitive interface. Opens instantly (no signup) and runs locally in a browser. Exports SVG, PNG, JPG."
910
+++
1011

@@ -80,13 +81,15 @@ meta_description = "Open source free software. A vector graphics creativity suit
8081
<section id="screenshots" class="carousel window-size-1" data-carousel data-carousel-jostle-hint>
8182

8283
<div class="carousel-slide" data-carousel-slide>
83-
<!-- Copy of last --><img src="https://static.graphite.rs/content/index/gui-mockup-nodes__7.avif" onerror="this.onerror = null; this.src = this.src.replace('.avif', '.png')" alt="" style="transform: translateX(-100%)" data-carousel-image />
84-
<img src="https://static.graphite.rs/content/index/gui-demo-painted-dreams__2.avif" onerror="this.onerror = null; this.src = this.src.replace('.avif', '.png')" alt="" style="transform: translateX(-100%)" data-carousel-image />
85-
<img src="https://static.graphite.rs/content/index/magazine-page-layout.avif" onerror="this.onerror = null; this.src = this.src.replace('.avif', '.png')" alt="" style="transform: translateX(-100%)" data-carousel-image />
86-
<img src="https://static.graphite.rs/content/index/gui-demo-node-graph-valley-of-spires__2.avif" onerror="this.onerror = null; this.src = this.src.replace('.avif', '.png')" alt="" style="transform: translateX(-100%)" data-carousel-image />
87-
<img src="https://static.graphite.rs/content/index/gui-demo-fractal__2.avif" onerror="this.onerror = null; this.src = this.src.replace('.avif', '.png')" alt="" style="transform: translateX(-100%)" data-carousel-image />
8884
<img src="https://static.graphite.rs/content/index/gui-mockup-nodes__7.avif" onerror="this.onerror = null; this.src = this.src.replace('.avif', '.png')" alt="" style="transform: translateX(-100%)" data-carousel-image />
89-
<!-- Copy of first --><img src="https://static.graphite.rs/content/index/gui-demo-painted-dreams__2.avif" onerror="this.onerror = null; this.src = this.src.replace('.avif', '.png')" alt="" style="transform: translateX(-100%)" data-carousel-image />
85+
<!-- Above is a copy of the last -->
86+
<img onerror="this.onerror = null; this.src = this.src.replace('.avif', '.png')" alt="" style="transform: translateX(-100%)" data-carousel-image width="1920" height="1080" loading="lazy" src="https://static.graphite.rs/content/index/gui-demo-painted-dreams__2.avif" />
87+
<img onerror="this.onerror = null; this.src = this.src.replace('.avif', '.png')" alt="" style="transform: translateX(-100%)" data-carousel-image width="1920" height="1080" loading="lazy" src="https://static.graphite.rs/content/index/magazine-page-layout.avif" />
88+
<img onerror="this.onerror = null; this.src = this.src.replace('.avif', '.png')" alt="" style="transform: translateX(-100%)" data-carousel-image width="1920" height="1080" loading="lazy" src="https://static.graphite.rs/content/index/gui-demo-node-graph-valley-of-spires__2.avif" />
89+
<img onerror="this.onerror = null; this.src = this.src.replace('.avif', '.png')" alt="" style="transform: translateX(-100%)" data-carousel-image width="1920" height="1080" loading="lazy" src="https://static.graphite.rs/content/index/gui-demo-fractal__2.avif" />
90+
<img onerror="this.onerror = null; this.src = this.src.replace('.avif', '.png')" alt="" style="transform: translateX(-100%)" data-carousel-image width="1920" height="1080" loading="lazy" src="https://static.graphite.rs/content/index/gui-mockup-nodes__7.avif" />
91+
<!-- Below is a copy of the first -->
92+
<img src="https://static.graphite.rs/content/index/gui-demo-painted-dreams__2.avif" onerror="this.onerror = null; this.src = this.src.replace('.avif', '.png')" alt="" style="transform: translateX(-100%)" data-carousel-image />
9093
</div>
9194

9295
<div class="carousel-slide torn left" data-carousel-slide-torn-left></div>
@@ -287,7 +290,7 @@ Graphite is the first and only graphic design package built for procedural editi
287290
<div class="diptych red-dress">
288291

289292
<div class="block video-background">
290-
<video loop muted playsinline disablepictureinpicture disableremoteplayback data-auto-play>
293+
<video loop muted playsinline disablepictureinpicture disableremoteplayback data-auto-play preload="none" poster="https://static.graphite.rs/content/index/procedural-demo-red-dress-poster.avif">
291294
<source src="https://static.graphite.rs/content/index/procedural-demo-red-dress.webm" type="video/webm" />
292295
<source src="https://static.graphite.rs/content/index/procedural-demo-red-dress.mp4" type="video/mp4" />
293296
</video>
@@ -323,7 +326,7 @@ Blend across color schemes. Morph shapes before they're scattered around the can
323326
</div>
324327

325328
<div class="block video-background">
326-
<video loop muted playsinline disablepictureinpicture disableremoteplayback data-auto-play>
329+
<video loop muted playsinline disablepictureinpicture disableremoteplayback data-auto-play preload="none" poster="https://static.graphite.rs/content/index/procedural-demo-leaves-poster.avif">
327330
<source src="https://static.graphite.rs/content/index/procedural-demo-leaves.webm" type="video/webm" />
328331
<source src="https://static.graphite.rs/content/index/procedural-demo-leaves.mp4" type="video/mp4" />
329332
</video>
@@ -454,7 +457,7 @@ Get started with Graphite by following along to a hands-on quickstart tutorial.
454457
<div class="block video-container">
455458
<div>
456459
<div class="video-embed aspect-16x9">
457-
<img data-video-embed="7gjUhl_3X10" src="https://static.graphite.rs/content/index/tutorial-1-youtube.avif" onerror="this.onerror = null; this.src = this.src.replace('.avif', '.png')" alt="Graphite Tutorial 1 - Hands-On Quickstart" />
460+
<img data-video-embed="7gjUhl_3X10" loading="lazy" src="https://static.graphite.rs/content/index/tutorial-1-youtube.avif" onerror="this.onerror = null; this.src = this.src.replace('.avif', '.png')" alt="Graphite Tutorial 1 - Hands-On Quickstart" />
458461
</div>
459462
</div>
460463
</div>

website/content/about.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
title = "About Graphite"
33

44
[extra]
5-
css_inline = ["about.css"]
6-
css_external = ["https://fonts.googleapis.com/css2?family=Noto+Color+Emoji&display=swap"]
5+
css = ["/about.css"]
6+
linked_css = ["https://fonts.googleapis.com/css2?family=Noto+Color+Emoji&display=swap"]
77
+++
88

99
<section>

website/content/blog/2024-01-01-looking-back-on-2023-and-what's-next.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ summary = "Looking back on 2023, we reflect on our significant achievements and
1010
reddit = "https://www.reddit.com/r/graphite/comments/18xmoti/blog_post_looking_back_on_2023_and_whats_next/"
1111
twitter = "https://twitter.com/GraphiteEditor/status/1742576805532577937"
1212

13-
js = ["youtube-embed.js"]
13+
js = ["/js/youtube-embed.js"]
1414
+++
1515

1616
The new year is here, and with so many accomplishments to share from the past twelve months, let's revisit the highlights of 2023 for the Graphite project. Now that winter has entered, let's swing back to the spring, summarize the summer, and follow this fall's noteworthy developments that brought another year of fruitful progress to Graphite's mission of re-envisioning artists' 2D creative workflows with the best free software we can build for the open source community. This past year as a team, we all got closer— to one another from continents apart; to visiting and connecting with our industry peers; and to reaching exciting new development milestones.

website/content/donate.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
title = "Donate"
33

44
[extra]
5-
# css_inline = ["donate.css"]
6-
# js = ["fundraising.js"]
5+
# css = ["/donate.css", "/balance-text.css"]
6+
# js = ["/js/fundraising.js"]
7+
# linked_js = ["https://static.graphite.rs/text-balancer/text-balancer.js"]
78
+++
89

910
<section>

website/content/features.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title = "Graphite features"
33

44
[extra]
5-
css_inline = ["features.css"]
5+
css = ["/features.css"]
66
+++
77

88
<section>

website/content/learn/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ page_template = "book.html"
55

66
[extra]
77
book = true
8-
js = ["youtube-embed.js"]
8+
js = ["/js/youtube-embed.js"]
99
+++
1010

1111
Welcome to the Graphite user manual. Keep reading to to learn how the software can help bring your 2D creative ideas to life.

website/content/learn/_unpublished/workflows/imaginate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title = "Imaginate"
33

44
[extra]
55
order = 2
6-
js = ["carousel.js"]
6+
js = ["/js/carousel.js"]
77
+++
88

99
Imaginate is a useful tool at every stage in the artistic process. Early on it provides inspiration for styles, color palettes, subjects, and composition. It lets you quickly test ideas and explore artistic directions. It's also a useful way to generate placeholder images and content for kit bashing.

website/content/learn/introduction/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ page_template = "book.html"
55

66
[extra]
77
order = 1
8-
js = ["youtube-embed.js"]
8+
js = ["/js/youtube-embed.js"]
99
+++
1010

1111
<!-- Before taking the time to read the coming chapters, let's build some context by jumping straight into a small project that you can follow along with. That way you will have a mental framework for the topics explained in the rest of this manual. -->

website/content/logo.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title = "Graphite logo"
33

44
[extra]
5-
css_inline = ["logo.css"]
5+
css = ["/logo.css"]
66
+++
77

88
<section class="reading-material">

0 commit comments

Comments
 (0)