Skip to content

Commit b0709a7

Browse files
committed
WIP
1 parent 3582126 commit b0709a7

File tree

9 files changed

+93
-41
lines changed

9 files changed

+93
-41
lines changed

.github/workflows/build-dev-and-ci.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ on:
99
- master
1010
env:
1111
CARGO_TERM_COLOR: always
12-
INDEX_HTML_HEAD_REPLACEMENT: <script defer data-domain="dev.graphite.rs" data-api="https://graphite.rs/visit/event" src="https://graphite.rs/visit/script.hash.js"></script>
1312

1413
jobs:
1514
build:
@@ -50,8 +49,13 @@ jobs:
5049
5150
- name: ✂ Replace template in <head> of index.html
5251
run: |
53-
# Remove the INDEX_HTML_HEAD_REPLACEMENT environment variable for build links (not master deploys)
54-
git rev-parse --abbrev-ref HEAD | grep master > /dev/null || export INDEX_HTML_HEAD_REPLACEMENT=""
52+
# Check if we are on the locally-serve-fonts branch
53+
if git rev-parse --abbrev-ref HEAD | grep locally-serve-fonts > /dev/null; then
54+
export INDEX_HTML_HEAD_SCRIPT=$(curl -s https://graphite.rs/visit/script.hash.js) || exit 1
55+
export INDEX_HTML_HEAD_REPLACEMENT="<script data-domain=\"dev.graphite.rs\" data-api=\"https://graphite.rs/visit/event\">$INDEX_HTML_HEAD_SCRIPT</script>"
56+
else
57+
export INDEX_HTML_HEAD_REPLACEMENT=""
58+
fi
5559
sed -i "s|<!-- INDEX_HTML_HEAD_REPLACEMENT -->|$INDEX_HTML_HEAD_REPLACEMENT|" frontend/index.html
5660
5761
- name: 🌐 Build Graphite web code

.github/workflows/build-production.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ jobs:
1818
RUSTC_WRAPPER: /usr/bin/sccache
1919
CARGO_INCREMENTAL: 0
2020
SCCACHE_DIR: /var/lib/github-actions/.cache
21-
INDEX_HTML_HEAD_REPLACEMENT: <script defer data-domain="editor.graphite.rs" data-api="https://graphite.rs/visit/event" src="https://graphite.rs/visit/script.hash.js"></script>
2221

2322
steps:
2423
- name: 📥 Clone and checkout repository
@@ -47,7 +46,15 @@ jobs:
4746
4847
- name: ✂ Replace template in <head> of index.html
4948
run: |
49+
# Check if we are on the locally-serve-fonts branch
50+
if git rev-parse --abbrev-ref HEAD | grep locally-serve-fonts > /dev/null; then
51+
export INDEX_HTML_HEAD_SCRIPT=$(curl -s https://graphite.rs/visit/script.hash.js) || exit 1
52+
export INDEX_HTML_HEAD_REPLACEMENT="<script data-domain=\"editor.graphite.rs\" data-api=\"https://graphite.rs/visit/event\">$INDEX_HTML_HEAD_SCRIPT</script>"
53+
else
54+
export INDEX_HTML_HEAD_REPLACEMENT=""
55+
fi
5056
sed -i "s|<!-- INDEX_HTML_HEAD_REPLACEMENT -->|$INDEX_HTML_HEAD_REPLACEMENT|" frontend/index.html
57+
echo "INDEX_HTML_HEAD_REPLACEMENT=$INDEX_HTML_HEAD_REPLACEMENT" >> $GITHUB_ENV
5158
5259
- name: 🌐 Build Graphite web code
5360
env:

.github/workflows/website.yml

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
name: "Website"
1+
name: "Website 2"
22

33
on:
44
push:
55
branches:
6-
- master
6+
- locally-serve-fonts
77
paths:
88
- website/**
99
pull_request:
1010
branches:
11-
- master
11+
- locally-serve-fonts
1212
paths:
1313
- website/**
1414
env:
1515
CARGO_TERM_COLOR: always
16-
INDEX_HTML_HEAD_INCLUSION: <script defer data-domain="graphite.rs" data-api="/visit/event" src="/visit/script.js"></script>
16+
INDEX_HTML_HEAD_INCLUSION: REPLACE_ME
1717

1818
jobs:
1919
build:
@@ -34,8 +34,13 @@ jobs:
3434

3535
- name: ✂ Replace template in <head> of index.html
3636
run: |
37-
# Remove the INDEX_HTML_HEAD_INCLUSION environment variable for build links (not master deploys)
38-
git rev-parse --abbrev-ref HEAD | grep master > /dev/null || export INDEX_HTML_HEAD_INCLUSION=""
37+
# Check if we are on the locally-serve-fonts branch
38+
if git rev-parse --abbrev-ref HEAD | grep locally-serve-fonts > /dev/null; then
39+
export INDEX_HTML_HEAD_SCRIPT=$(curl -s https://graphite.rs/visit/script.hash.js) || exit 1
40+
echo "INDEX_HTML_HEAD_INCLUSION=<script data-domain=\"graphite.rs\" data-api=\"/visit/event\">$INDEX_HTML_HEAD_SCRIPT</script>" >> $GITHUB_ENV
41+
else
42+
echo "INDEX_HTML_HEAD_INCLUSION=<script>alert();</script>" >> $GITHUB_ENV
43+
fi
3944
4045
- name: 🌐 Build Graphite website with Zola
4146
env:

website/content/_index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ title = "Free online vector editor & procedural design tool"
33
template = "section.html"
44

55
[extra]
6-
css = ["/page/index.css", "/component/carousel.css", "/component/feature-icons.css", "/component/feature-box.css", "/component/youtube-embed.css", "/layout/balance-text.css"]
6+
css = ["/page/index.css", "/component/carousel.css", "/component/feature-icons.css", "/component/feature-box.css", "/component/youtube-embed.css"]
77
js = ["/js/carousel.js", "/js/youtube-embed.js", "/js/video-autoplay.js"]
8-
linked_js = ["https://static.graphite.rs/text-balancer/text-balancer.js"]
8+
linked_js = []
99
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."
1010
+++
1111

website/content/donate.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
title = "Donate"
33

44
[extra]
5-
# css = ["/page/donate.css", "/component/feature-box.css", "/layout/balance-text.css"]
5+
# css = ["/page/donate.css", "/component/feature-box.css"]
66
# js = ["/js/fundraising.js"]
7-
# linked_js = ["https://static.graphite.rs/text-balancer/text-balancer.js"]
7+
# linked_js = []
88
+++
99

1010
<section>
@@ -33,7 +33,7 @@ Your monthly support (or one-off contribution) helps provide the resources neede
3333
3434
# Support the mission
3535
36-
<p class="balance-text">
36+
<p>
3737
You can help realize Graphite's ambitious vision of building the ultimate 2D creative tool.
3838
Graphite is built by a small, dedicated crew of volunteers in need of resources to grow.
3939
</p>

website/sass/base.scss

+4
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,10 @@ article {
357357
min-height: 0;
358358
}
359359

360+
.balance-text {
361+
text-wrap: balance;
362+
}
363+
360364
// ==================================
361365
// HEADER AND TEXT ELEMENT TAG STYLES
362366
// ==================================

website/sass/fonts.scss

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// BONA NOVA
2+
@font-face {
3+
font-family: "Bona Nova";
4+
font-style: normal;
5+
font-weight: 700;
6+
font-display: swap;
7+
src: url("https://static.graphite.rs/fonts/BonaNova.woff2") format("woff2");
8+
}
9+
10+
// INTER
11+
@font-face {
12+
font-family: "Inter";
13+
font-style: normal;
14+
font-weight: 100 900;
15+
font-display: swap;
16+
src: url("https://static.graphite.rs/fonts/InterVariable-v4.1.woff2") format("woff2");
17+
}
18+
@font-face {
19+
font-family: "Inter";
20+
font-style: italic;
21+
font-weight: 100 900;
22+
font-display: swap;
23+
src: url("https://static.graphite.rs/fonts/InterVariable-Italic-v4.1.woff2") format("woff2");
24+
}
25+
@font-feature-values Inter {
26+
@character-variant {
27+
cv01: 1; cv02: 2; cv03: 3; cv04: 4; cv05: 5; cv06: 6; cv07: 7; cv08: 8;
28+
cv09: 9; cv10: 10; cv11: 11; cv12: 12; cv13: 13;
29+
alt-1: 1; // Alternate one
30+
alt-3: 9; // Flat-top three
31+
open-4: 2; // Open four
32+
open-6: 3; // Open six
33+
open-9: 4; // Open nine
34+
lc-l-with-tail: 5; // Lower-case L with tail
35+
simplified-u: 6; // Simplified u
36+
alt-double-s: 7; // Alternate German double s
37+
uc-i-with-serif: 8; // Upper-case i with serif
38+
uc-g-with-spur: 10; // Capital G with spur
39+
single-story-a: 11; // Single-story a
40+
compact-lc-f: 12; // Compact f
41+
compact-lc-t: 13; // Compact t
42+
}
43+
44+
@styleset {
45+
ss01: 1; ss02: 2; ss03: 3; ss04: 4; ss05: 5; ss06: 6; ss07: 7; ss08: 8;
46+
open-digits: 1; // Open digits
47+
disambiguation: 2; // Disambiguation (with zero)
48+
disambiguation-except-zero: 4; // Disambiguation (no zero)
49+
round-quotes-and-commas: 3; // Round quotes &amp; commas
50+
square-punctuation: 7; // Square punctuation
51+
square-quotes: 8; // Square quotes
52+
circled-characters: 5; // Circled characters
53+
squared-characters: 6; // Squared characters
54+
}
55+
}

website/sass/layout/balance-text.scss

-22
This file was deleted.

website/templates/base.html

+3-4
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,12 @@
2727
{% block rss -%}
2828
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ get_url(path = 'blog/rss.xml', trailing_slash = false) | safe }}" />
2929
{%- endblock %}
30-
<link rel="preconnect" href="https://fonts.googleapis.com" />
31-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
3230

3331
{#- ON EVERY PAGE OF THE SITE: CSS AND JS TO LOAD EITHER AS A LINK OR INLINE -#}
3432
{#- ======================================================================== -#}
35-
{%- set global_linked_css = ["https://fonts.googleapis.com/css2?family=Bona+Nova:wght@700&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap"] -%}
33+
{%- set global_linked_css = [] -%}
3634
{%- set global_linked_js = [] -%}
37-
{%- set global_css = ["/base.css"] -%}
35+
{%- set global_css = ["/base.css", "/fonts.css"] -%}
3836
{%- set global_js = ["/js/text-justification.js", "/js/navbar.js"] -%}
3937

4038
{#- RETRIEVE FROM TEMPLATES AND PAGES: CSS AND JS TO LOAD EITHER AS A LINK OR INLINE -#}
@@ -89,6 +87,7 @@
8987
{{ load_data(path = path) | safe }}
9088
{{ "</" ~ "script>" | safe }}
9189
{%- endfor %}
90+
9291
{{- get_env(name = "INDEX_HTML_HEAD_INCLUSION", default = "") | safe }}
9392
</head>
9493
<body>

0 commit comments

Comments
 (0)