-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathjustfile
More file actions
49 lines (38 loc) · 1.19 KB
/
justfile
File metadata and controls
49 lines (38 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Hugo site automation commands
# Show available commands (default)
default:
@just --list
# Serve the site with drafts enabled
serve:
hugo serve -D
# Create a new blog post with today's date (usage: just new "My Post Title")
new title:
#!/usr/bin/env bash
slug=$(echo "{{title}}" | tr '[:upper:]' '[:lower:]' | sed 's/ /-/g')
hugo new posts/$(date +%Y-%m-%d)-$slug.md
# Clean up local git branches (keep main, delete others)
clean:
git checkout main && git branch | grep -v '^*' | xargs -r git branch -d
# Build the site for production
build:
hugo --minify
# Build and serve production version locally
serve-prod: build
cd public && python3 -m http.server 8080
# Quick deploy to production (customize for your deployment)
deploy: build
echo "Add your deployment commands here (rsync, git push, etc.)"
# Show recent posts
recent:
ls -la content/posts/ | tail -10
# Install and setup pre-commit hooks
setup-precommit:
uv tool install pre-commit
pre-commit install
pre-commit install --hook-type commit-msg
# Run all pre-commit hooks on all files
check:
pre-commit run --all-files
# Update pre-commit hook versions
update-hooks:
pre-commit autoupdate