From f5b7d26cec6ff9b0f5b2ca03ddfbdc28251430a8 Mon Sep 17 00:00:00 2001 From: Tasia Iso Date: Mon, 27 May 2024 09:26:40 +0200 Subject: [PATCH] minify theme and favicons --- .gitignore | 6 +++- Makefile | 35 +++++++++++++++++++---- docs/index.md | 5 ++++ haml/main.haml | 5 ++-- theme/favicon.ico | Bin 1034 -> 0 bytes theme/favicon.png | Bin 1013 -> 0 bytes theme/favicon.svg | 63 +++++------------------------------------ theme/gruvbox-dark.css | 44 ++++++++++++++-------------- 8 files changed, 72 insertions(+), 86 deletions(-) delete mode 100644 theme/favicon.ico delete mode 100644 theme/favicon.png diff --git a/.gitignore b/.gitignore index ee99d31..a7f1e60 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,8 @@ site NOTES.md theme/*.html -theme/*.min +theme/*.min.* + +theme/favicon.* +theme/favicon-ex.png +!theme/favicon.svg diff --git a/Makefile b/Makefile index e0cf271..076e7d3 100644 --- a/Makefile +++ b/Makefile @@ -2,22 +2,43 @@ # $@ : rule name (output) # Build the website -site/index.html: docs/** theme/** theme/main.html theme/style.css.min theme/gruvbox-dark.css.min mkdocs.yml +site/index.html: docs/** \ + theme/** \ + theme/main.html \ + theme/style.min.css \ + theme/gruvbox-dark.min.css \ + mkdocs.yml mkdocs build build: site/index.html +# HTML theme/main.html: haml/main.haml haml render $< > $@.tmp cat $@.tmp > $@ rm $@.tmp -theme/style.css.min: theme/style.css +# CSS +theme/style.min.css: theme/style.css python3 -m csscompressor -o $@ $< -theme/gruvbox-dark.css.min: theme/gruvbox-dark.css +theme/gruvbox-dark.min.css: theme/gruvbox-dark.css python3 -m csscompressor -o $@ $< +# Favicons +theme/favicon-ex.png: theme/favicon.svg + inkscape theme/favicon.svg --export-filename=theme/favicon-ex.png + +theme/favicon.png: theme/favicon-ex.png + magick theme/favicon-ex.png -compress Zip -quality 1 -resize 144x144 theme/favicon.png + +theme/favicon.ico: theme/favicon-ex.png + magick theme/favicon-ex.png -compress Zip -quality 1 -resize 144x144 theme/favicon.ico + +favicon_all: theme/favicon.png theme/favicon.ico + +# Scripts + # Serve the website at http://127.0.0.1:8000/~tasiaiso/ serve: theme/main.html mkdocs serve -w theme @@ -40,6 +61,10 @@ purge: clean format build clean: rm -r site/ rm theme/main.html - rm theme/style.css.min - rm theme/gruvbox-dark.css.min + rm theme/style.min.css + rm theme/gruvbox-dark.min.css + rm theme/favicon-ex.png + rm theme/favicon.min.svg + rm theme/favicon.png + rm theme/favicon.ico \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 5767d2a..18332ff 100644 --- a/docs/index.md +++ b/docs/index.md @@ -77,6 +77,11 @@ If you like my posts, please consider supporting me on [Liberapay](https://liber ## changelog +## v1.0.3 (2024-06-xx) + +- minify css files +- compress favicons + ### v1.0.2 (2024-05-26) - add tea badge diff --git a/haml/main.haml b/haml/main.haml index fb22e34..a6d92cb 100644 --- a/haml/main.haml +++ b/haml/main.haml @@ -5,9 +5,10 @@ %meta(name="viewport" content="width=device-width, initial-scale=1.0") %link(rel="icon" type="image/png" href="/~tasiaiso/favicon.png") %link(rel="icon" type="image/x-icon" href="/~tasiaiso/favicon.ico") + %link(rel="icon" type="image/svg+xml" href="/~tasiaiso/favicon.svg" sizes="any") - %link(rel="stylesheet" href="/~tasiaiso/gruvbox-dark.css") - %link(rel="stylesheet" href="/~tasiaiso/style.css.min") + %link(rel="stylesheet" href="/~tasiaiso/gruvbox-dark.min.css") + %link(rel="stylesheet" href="/~tasiaiso/style.min.css") %title {% if page.title %}{{ page.title }} - {% endif %}{{ config.site_name }} diff --git a/theme/favicon.ico b/theme/favicon.ico deleted file mode 100644 index 633e9e4608fb5b1de6686025f2ec13f4505cffaa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1034 zcmV+l1ois>0096206;(h0096X0Q3U@02TlM0EtjeM-2)Z3IG5A4M|8uQUCw|KmY&$ zKnMl^0063Kaozv`1G`B?K~#90<=V?`97Pm|@n0Du_H5t{cmc$gH4n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a/theme/favicon.png b/theme/favicon.png deleted file mode 100644 index 7cb615ac971079be018c19a6f69323b199a57e9c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1013 zcmVkIaa{|TsbX>EySUX1gxUQ5H(8N zNOXZ47lfD?2{BRQfJP!H(BpzK-`?>Ix8-iRJesZd`^J+5iyp z0;&-Q@Ey1ZlqoW@1Q7{-mHkE;z)#>2LWP|?mUiaDzR&}Hjs2woq;V6RK^R6+Vv2`S z;a}7RJmJ^bPg?5HV-uV}F@SJWij13j zlK}X-_DvP=5f}_}K(PYvV_)Y0egH!#O7t)s=73@e-q(K80jwNQ6i=kcoXveyfso@8 z$_GBcew+c!B0R5s@VF~Q{y2MpX6Qn3DBx+652`WDCb$5+KqxcEeYwtW*C!^G;R3>u zfZGD?`xUVAWx_mta)YmFIU|RJ4`ttL0AmOx6ea25Q`$ZtgoY1ke`x@3fjhL&FV~nz z>qkPB8J=GJHh)sV*P}d}RBn zEg%+r4Ew1pK;`I+0UyhL>IzUfI#C>p@zPlKQ&m6$_}KPSQ$Qm41ol%=KtlLL_MI1? zvYZEwCs-npeWwLzfKP1SSpiz$HQ0AjfF^h?_N^D74PKLds|9F;*Jj^Z0V>Nm;Dn~- zwAr^(fM$5D_Kg>y9bU72qXig%*KXff0Y=~r*f&yuA$TM9wHKf=oJBZkASxsFwH9Cy z-k5!D1sH`lXkSYKhT)CcPh5a;c*FK#@wdUayZsq33UAzg>;h`=dBdk@SUIl&ytUH4+ j>wmyts - - - - - - - + width="512" + height="512" + version="1.1" + xmlns="http://www.w3.org/2000/svg"> + diff --git a/theme/gruvbox-dark.css b/theme/gruvbox-dark.css index 5506776..145d556 100644 --- a/theme/gruvbox-dark.css +++ b/theme/gruvbox-dark.css @@ -1,34 +1,34 @@ /* yv31.github.io/gruvbox-css */ :root { --bg_h: #1d2021; - --bg: #282828; - --bg_s: #32302f; + /* --bg: #282828; */ + /* --bg_s: #32302f; */ --bg1: #3c3836; - --bg2: #504945; - --bg3: #665c54; - --bg4: #7c6f64; + /* --bg2: #504945; */ + /* --bg3: #665c54; */ + /* --bg4: #7c6f64; */ --fg: #fbf1c7; - --fg1: #ebdbb2; - --fg2: #d5c4a1; - --fg3: #bdae93; - --fg4: #a89984; + /* --fg1: #ebdbb2; */ + /* --fg2: #d5c4a1; */ + /* --fg3: #bdae93; */ + /* --fg4: #a89984; */ - --red: #fb4934; - --green: #b8bb26; + /* --red: #fb4934; */ + /* --green: #b8bb26; */ --yellow: #fabd2f; - --blue: #83a598; - --purple: #d3869b; - --aqua: #8ec07c; - --gray: #928374; - --orange: #fe8019; + /* --blue: #83a598; */ + /* --purple: #d3869b; */ + /* --aqua: #8ec07c; */ + /* --gray: #928374; */ + /* --orange: #fe8019; */ - --red-dim: #cc2412; - --green-dim: #98971a; - --yellow-dim: #d79921; + /* --red-dim: #cc2412; */ + /* --green-dim: #98971a; */ + /* --yellow-dim: #d79921; */ --blue-dim: #458588; --purple-dim: #b16286; - --aqua-dim: #689d6a; - --gray-dim: #a89984; - --orange-dim: #d65d0e; + /* --aqua-dim: #689d6a; */ + /* --gray-dim: #a89984; */ + /* --orange-dim: #d65d0e; */ }