Files
docs/justfile
Michael Housh 1b29e8d833
Some checks failed
CI / release (push) Failing after 2m32s
feat: Updates for search integration.
2025-04-06 15:28:10 -04:00

37 lines
1.1 KiB
Makefile

articles := "./content/articles"
docker_image := "homelab/docs"
docker_tag := "latest"
shortdate := `date +%F`
[private]
default:
@just --list
# Run the development server.
[group('dev')]
run:
#!/usr/bin/env zsh
touch .build/browser-dev-sync
browser-sync start -p localhost:1414 --watch --files '.build/browser-dev-sync' &
watchexec -w Sources -e .swift -r 'swift run && touch .build/browser-dev-sync' &
watchexec -w .build/browser-dev-sync --ignore-nothing -r 'npx -y pagefind --site deploy --serve'
# Create a new article with given name and tags.
new-article name *tags:
@echo "---" > {{articles}}/{{shortdate}}-{{name}}.md
@echo "date: {{shortdate}}" >> {{articles}}/{{shortdate}}-{{name}}.md
@echo "tags: `./scripts/join-tags.sh {{tags}}`" >> {{articles}}/{{shortdate}}-{{name}}.md
@echo "---" >> {{articles}}/{{shortdate}}-{{name}}.md
@echo {{articles}}/{{shortdate}}-{{name}}.md
alias n := new-article
latest-article:
@echo "$(find {{articles}} -maxdepth 1 -mindepth 1 -type f | sort -nr | head -1)"
alias l := latest-article
[group('dev')]
build:
@docker build --tag {{docker_image}}:{{docker_tag}} .