mirror of
http://101.35.51.105:3000/congyu/Hakysidian.git
synced 2026-04-28 05:50:49 +08:00
Introduce CLI, watch server, and bundled assets
Add data-files and bundled templates/fonts/css to the package and rename the executable to hakysidian (autogen Paths_hakysidian). Refactor site.hs to parse CLI commands (build/clean/rebuild/watch), start a preview server, snapshot inputs and run an incremental watch loop, and move rules into a siteRules function. Update ChaoDoc and filters to accept math-macros, and add favicon links to templates.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
|
||||
COMMANDS := build watch rebuild clean
|
||||
BIN := hakysidian
|
||||
.PHONY: $(COMMANDS), publish
|
||||
|
||||
# Set the default goal, so running 'make' without arguments will run 'make build'.
|
||||
@@ -7,20 +8,20 @@ COMMANDS := build watch rebuild clean
|
||||
|
||||
|
||||
# ---
|
||||
$(COMMANDS): site
|
||||
@echo "Running command: ./site $@"
|
||||
-@./site $@
|
||||
$(COMMANDS): $(BIN)
|
||||
@echo "Running command: ./$(BIN) $@"
|
||||
-@./$(BIN) $@
|
||||
|
||||
|
||||
# --- Rules ---
|
||||
# using relative symlinks should be fine since everything only works at ./
|
||||
|
||||
|
||||
site: src/site.hs src/ChaoDoc.hs
|
||||
cabal build
|
||||
ln -sf "$(shell cabal list-bin exe:site)" site
|
||||
$(BIN): src/site.hs src/ChaoDoc.hs
|
||||
cabal build exe:hakysidian
|
||||
ln -sf "$(shell cabal list-bin exe:hakysidian)" $(BIN)
|
||||
|
||||
# move from katex to mathjax
|
||||
# katex_cli:
|
||||
# cd katex_rust_fork && cargo build --release
|
||||
# ln -sf ./katex_rust_fork/target/release/katex_cli katex_cli
|
||||
# ln -sf ./katex_rust_fork/target/release/katex_cli katex_cli
|
||||
|
||||
Reference in New Issue
Block a user