summary refs log tree commit diff
path: root/pkgs/data/fonts/league-of-moveable-type/update.sh
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2016-10-15 04:53:58 +0200
committerProfpatsch <mail@profpatsch.de>2016-10-15 06:49:50 +0200
commitfc199022602aaca4ed54c86db5f4ba0e10ac1c60 (patch)
tree483a83c003d2fd676ce801b6712e163075475ff8 /pkgs/data/fonts/league-of-moveable-type/update.sh
parenta1d3af2082a9bf4b9e373f00deb63517afa65dcd (diff)
downloadnixpkgs-fc199022602aaca4ed54c86db5f4ba0e10ac1c60.tar
nixpkgs-fc199022602aaca4ed54c86db5f4ba0e10ac1c60.tar.gz
nixpkgs-fc199022602aaca4ed54c86db5f4ba0e10ac1c60.tar.bz2
nixpkgs-fc199022602aaca4ed54c86db5f4ba0e10ac1c60.tar.lz
nixpkgs-fc199022602aaca4ed54c86db5f4ba0e10ac1c60.tar.xz
nixpkgs-fc199022602aaca4ed54c86db5f4ba0e10ac1c60.tar.zst
nixpkgs-fc199022602aaca4ed54c86db5f4ba0e10ac1c60.zip
league-of-movable-type: 2014-12 -> 2016-10-15
Restructured, so that updates can be done by executing a shell script.
Also uses the extended Raleway fonts, the league itself has only thin
variants.
Diffstat (limited to 'pkgs/data/fonts/league-of-moveable-type/update.sh')
-rw-r--r--pkgs/data/fonts/league-of-moveable-type/update.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/pkgs/data/fonts/league-of-moveable-type/update.sh b/pkgs/data/fonts/league-of-moveable-type/update.sh
new file mode 100644
index 00000000000..4d41df4fdb8
--- /dev/null
+++ b/pkgs/data/fonts/league-of-moveable-type/update.sh
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+
+SITE=https://www.theleagueofmoveabletype.com
+
+# since there is no nice way to get all the fonts,
+# this fetches the homepage and extracts their names from the html …
+fonts=$(curl "$SITE" 2>/dev/null | \
+            sed -ne 's/<img.*cloudfront.*images\/\(.*\)-[[:digit:]-]\..*$/\1/p')
+
+# build an ad-hoc nixexpr list with the files & hashes
+echo "["
+for f in $fonts; do
+    url="$SITE/$f/download"
+    hash=$(nix-prefetch-url --type sha256 "$url" 2>/dev/null)
+    cat <<EOF
+  {
+    url = "$url";
+    sha256 = "$hash";
+    name = "$f.zip";
+  }
+EOF
+done
+echo "]"
+
+