59
Taskfile.yml
Normal file
59
Taskfile.yml
Normal file
@@ -0,0 +1,59 @@
|
||||
version: '3'
|
||||
|
||||
vars:
|
||||
THEME: hugo-theme-m10c
|
||||
SRC_DIR: src
|
||||
PATCHES_DIR: "{{.SRC_DIR}}/patches"
|
||||
THEME_DIR: "{{.SRC_DIR}}/themes/{{.THEME}}"
|
||||
|
||||
tasks:
|
||||
default:
|
||||
desc: Show available tasks
|
||||
cmds:
|
||||
- task --list
|
||||
|
||||
patch:
|
||||
desc: Apply patches to the theme
|
||||
cmds:
|
||||
- cd {{.THEME_DIR}} && git apply "..\..\patches\hugo-theme-m10c-baseof.html.patch" || true
|
||||
- cd {{.THEME_DIR}} && git apply "..\..\patches\hugo-theme-m10c-icon.html.patch" || true
|
||||
|
||||
build:
|
||||
desc: Build the Hugo site
|
||||
deps:
|
||||
- patch
|
||||
cmds:
|
||||
- cd {{.SRC_DIR}} && hugo --minify
|
||||
sources:
|
||||
- "{{.SRC_DIR}}/content/**"
|
||||
- "{{.SRC_DIR}}/layouts/**"
|
||||
- "{{.SRC_DIR}}/config.toml"
|
||||
generates:
|
||||
- "{{.SRC_DIR}}/public/**"
|
||||
|
||||
server:
|
||||
desc: Run Hugo server for local development
|
||||
deps:
|
||||
- patch
|
||||
cmds:
|
||||
- cd {{.SRC_DIR}} && hugo server --minify --port 1313 --bind 0.0.0.0
|
||||
interactive: true
|
||||
|
||||
clean:
|
||||
desc: Clean Hugo build artifacts
|
||||
cmds:
|
||||
- rm -rf "{{.SRC_DIR}}/public"
|
||||
- rm -rf "{{.SRC_DIR}}/resources"
|
||||
|
||||
rebuild:
|
||||
desc: Clean and rebuild the site
|
||||
deps:
|
||||
- clean
|
||||
- build
|
||||
|
||||
update-theme:
|
||||
desc: Update the theme submodule and reapply patches
|
||||
cmds:
|
||||
- git -C {{.THEME_DIR}} pull
|
||||
- task: patch
|
||||
- task: build
|
||||
Reference in New Issue
Block a user