Monorepo for Tangled
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

blog: add favicon to blog build

Add nix/pkgs/blog.nix to build the blog with proper static assets
including the dolly favicon files. Update the CI workflow to generate
favicons using the dolly tool before building.

The favicon was missing in production because appview/pages/static/* is
gitignored, and the CI workflow wasn't generating the dolly icons.

Signed-off-by: eti <eti@eti.tf>

authored by

eti and committed by
Tangled
3e1b9843 0aff9a76

+56 -2
+11 -2
.tangled/workflows/deploy-blog.yml
··· 13 13 steps: 14 14 - name: patch static dir 15 15 command: | 16 - mkdir -p appview/pages/static 17 - touch appview/pages/static/x 16 + mkdir -p appview/pages/static/logos 17 + 18 + - name: build dolly 19 + command: | 20 + go build -o dolly.out ./cmd/dolly 21 + 22 + - name: generate favicons 23 + command: | 24 + ./dolly.out -template appview/pages/templates/fragments/dolly/logo.html -output appview/pages/static/logos/dolly.png -size 180x180 25 + ./dolly.out -template appview/pages/templates/fragments/dolly/logo.html -output appview/pages/static/logos/dolly.ico -size 48x48 26 + ./dolly.out -template appview/pages/templates/fragments/dolly/logo.html -output appview/pages/static/logos/dolly.svg -color currentColor 18 27 19 28 - name: generate css 20 29 command: |
+2
flake.nix
··· 98 98 inherit htmx-src htmx-ws-src lucide-src inter-fonts-src ibm-plex-mono-src actor-typeahead-src mermaid-src; 99 99 }; 100 100 appview = self.callPackage ./nix/pkgs/appview.nix {}; 101 + blog = self.callPackage ./nix/pkgs/blog.nix {}; 101 102 docs = self.callPackage ./nix/pkgs/docs.nix { 102 103 inherit inter-fonts-src ibm-plex-mono-src lucide-src; 103 104 inherit (pkgs) pagefind; ··· 124 125 (packages) 125 126 appview 126 127 appview-static-files 128 + blog 127 129 lexgen 128 130 goat 129 131 spindle
+43
nix/pkgs/blog.nix
··· 1 + { 2 + buildGoApplication, 3 + runCommandLocal, 4 + modules, 5 + appview-static-files, 6 + sqlite-lib, 7 + src, 8 + }: let 9 + blog-bin = buildGoApplication { 10 + pname = "blog"; 11 + version = "0.1.0"; 12 + inherit src modules; 13 + 14 + postUnpack = '' 15 + pushd source 16 + mkdir -p appview/pages/static 17 + cp -frv ${appview-static-files}/* appview/pages/static 18 + popd 19 + ''; 20 + 21 + doCheck = false; 22 + subPackages = ["cmd/blog"]; 23 + 24 + tags = ["libsqlite3"]; 25 + env.CGO_CFLAGS = "-I ${sqlite-lib}/include "; 26 + env.CGO_LDFLAGS = "-L ${sqlite-lib}/lib"; 27 + CGO_ENABLED = 1; 28 + }; 29 + in 30 + runCommandLocal "blog" {} '' 31 + mkdir -p working 32 + cp -r --no-preserve=mode ${src}/blog working/ 33 + cp -r --no-preserve=mode ${src}/appview working/ 34 + 35 + mkdir -p working/appview/pages/static 36 + cp -fr --no-preserve=mode ${appview-static-files}/* working/appview/pages/static/ 37 + 38 + cd working 39 + ${blog-bin}/bin/blog build 40 + 41 + mkdir -p $out 42 + cp -r build/* $out/ 43 + ''