# https://taskfile.dev version: '3' vars: domain: www.byjp.me gmi_domain: gemini.byjp.me puma_dev_tld: .test env: HUGO_INDIEKIT_URL: https://indiekit.last.pub HUGO_LAST_UPDATE_TIME: sh: git log -1 --format=%cI HUGO_LAST_UPDATE_HASH: sh: git log -1 --format=%h tasks: check-links: desc: Check URLs across my site for linkrot. cmds: - lychee --cache --require-https --config lychee.toml . dev: desc: Run a local server that auto-updates when files are edited. (Search won't work) silent: true vars: port: 1313 env: HUGO_INDIEKIT_URL: https://indiekit.last.pub.test cmds: - | [ -d "$HOME/.puma-dev/" ] && (echo {{ .port }} > $HOME/.puma-dev/{{ .domain }}) || echo "Puma dev not installed, https://{{ .domain }}{{ .puma_dev_tld }} will not work" - hugo server --bind "0.0.0.0" --port {{ .port }} --minify --printUnusedTemplates --buildDrafts --baseURL "https://{{ .domain }}{{ .puma_dev_tld }}" --appendPort=false dev-indiekit: desc: Run a local Indiekit server for testing local packages silent: true dir: indiekit dotenv: ['.env'] cmds: - npm run start build: desc: Builds the production-ready site in ./public/ vars: cache: /tmp/hugo/cache cmds: - hugo --cacheDir {{ .cache }} --gc --minify --baseURL "https://{{ .domain }}" --quiet - pagefind --silent import: desc: Pulls information from various other sites/silos into this repo. Expects `./tools/.env` to be populated. dir: tools/ cmds: - go run ./import/omnivore ../ - go run ./import/webmentionio gemini-reduce: desc: Builds the gemini capsule, removing all HTML and HTML-specific files from ./public. silent: true cmds: # Gemini has no Javascript (no client-side interactivity at all), so search is useless - rm -rf ./public/search # Remove www-specific files - find ./public -regextype posix-egrep -regex '.*\.(html|js|css|css\.map|webmanifest|xml|xsl|ico|opml)' -type f -delete # Remove specific unneeded files - rm -rf ./public/favicon*.png ./public/_redirects ./public/{apple,android,mstile}*.png ./public/safari-pinned-tab.svg ./public/robots.txt # Remove specific unneeded directories - rm -rf ./public/.well-known/ ./public/fonts/ ./public/standalone/project-prime/ # Remove empty directories - find ./public -type d -empty -delete gemini-dev: desc: Builds the site & starts a gemini server (on the default port) for it. cmds: - agate --content public --addr 0.0.0.0:1965 --ed25519 --only-tls13 --hostname "{{ .gmi_domain }}{{ .puma_dev_tld }}" --central-conf