From 8c50411480ff73f347aa9977c814db0557f5ed79 Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Sun, 13 Feb 2022 00:08:27 +0100 Subject: Self-host fonts https://rewis.io/urteile/urteil/lhm-20-01-2022-3-o-1749320/ --- Makefile | 11 +++++++---- en/template.html | 4 +--- fonts/Cormorant500i.ttf | Bin 0 -> 247492 bytes fonts/OpenSans400.ttf | Bin 0 -> 122108 bytes fonts/OpenSans600.ttf | Bin 0 -> 122036 bytes fonts/OpenSans700.ttf | Bin 0 -> 122092 bytes stylesheets/fonts.css | 31 +++++++++++++++++++++++++++++++ template.html | 4 +--- 8 files changed, 40 insertions(+), 10 deletions(-) create mode 100644 fonts/Cormorant500i.ttf create mode 100644 fonts/OpenSans400.ttf create mode 100644 fonts/OpenSans600.ttf create mode 100644 fonts/OpenSans700.ttf create mode 100644 stylesheets/fonts.css diff --git a/Makefile b/Makefile index 76049ad..f3971d6 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,9 @@ images_folders = $(call dirnames,$(images)) stylesheets = $(foreach img,$(shell find stylesheets -type f),$(OUTDIR)/$(img)) stylesheets_folders = $(call dirnames,$(stylesheets)) +fonts = $(foreach font,$(shell find fonts -type f),$(OUTDIR)/$(font)) +fonts_folders = $(call dirnames,$(fonts)) + scripts = $(foreach img,$(shell find scripts -type f),$(OUTDIR)/$(img)) scripts_folders = $(call dirnames,$(scripts)) @@ -39,9 +42,9 @@ upload: site clean: -rm -r $(OUTDIR) -site: $(pages) $(members_pages) $(feeds) $(images) $(stylesheets) $(scripts) +site: $(pages) $(members_pages) $(feeds) $(images) $(stylesheets) $(fonts) $(scripts) -$(images) $(stylesheets) $(scripts): $(OUTDIR)/%: % +$(images) $(stylesheets) $(fonts) $(scripts): $(OUTDIR)/%: % cp $< $@ $(feeds): $(OUTDIR)/%: % @@ -78,7 +81,7 @@ $(OUTDIR)/en/sitemap.html: en/sitemap.md # Our lists of target directories are created from the lists of leaf # resources; some intermediate directories that only hold subdirs do # not appear in these lists. Work around that with -p. -$(OUTDIR) $(languages_folders) $(images_folders) $(stylesheets_folders) $(scripts_folders): +$(OUTDIR) $(languages_folders) $(images_folders) $(stylesheets_folders) $(fonts_folders) $(scripts_folders): mkdir -p $@ -$(feeds) $(images) $(stylesheets) $(scripts) $(pages) $(members_pages): | $$(@D) +$(feeds) $(images) $(stylesheets) $(fonts) $(scripts) $(pages) $(members_pages): | $$(@D) diff --git a/en/template.html b/en/template.html index 5ecfcc3..02408a7 100644 --- a/en/template.html +++ b/en/template.html @@ -16,10 +16,8 @@ + {STYLESHEETS} - - - diff --git a/fonts/Cormorant500i.ttf b/fonts/Cormorant500i.ttf new file mode 100644 index 0000000..b0646d0 Binary files /dev/null and b/fonts/Cormorant500i.ttf differ diff --git a/fonts/OpenSans400.ttf b/fonts/OpenSans400.ttf new file mode 100644 index 0000000..172c056 Binary files /dev/null and b/fonts/OpenSans400.ttf differ diff --git a/fonts/OpenSans600.ttf b/fonts/OpenSans600.ttf new file mode 100644 index 0000000..f9c9c61 Binary files /dev/null and b/fonts/OpenSans600.ttf differ diff --git a/fonts/OpenSans700.ttf b/fonts/OpenSans700.ttf new file mode 100644 index 0000000..fa1c11b Binary files /dev/null and b/fonts/OpenSans700.ttf differ diff --git a/stylesheets/fonts.css b/stylesheets/fonts.css new file mode 100644 index 0000000..bb79bbf --- /dev/null +++ b/stylesheets/fonts.css @@ -0,0 +1,31 @@ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 400; + font-stretch: normal; + font-display: swap; + src: url(../fonts/OpenSans400.ttf) format('truetype'); +} +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 600; + font-stretch: normal; + font-display: swap; + src: url(../fonts/OpenSans600.ttf) format('truetype'); +} +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 700; + font-stretch: normal; + font-display: swap; + src: url(../fonts/OpenSans700.ttf) format('truetype'); +} +@font-face { + font-family: 'Cormorant'; + font-style: italic; + font-weight: 500; + font-display: swap; + src: url(../fonts/Cormorant500i.ttf) format('truetype'); +} diff --git a/template.html b/template.html index 69695f0..bb112b0 100644 --- a/template.html +++ b/template.html @@ -16,10 +16,8 @@ + {STYLESHEETS} - - - -- cgit v1.2.3