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:
2026-03-24 20:47:46 +08:00
parent 6a3b4c5f88
commit 6c59abb9cc
6 changed files with 454 additions and 212 deletions

View File

@@ -1,13 +1,22 @@
cabal-version: 2.4
name: hakysidian
version: 0.1.0.0
build-type: Simple
cabal-version: >= 1.10
data-files:
bib_style.csl
favicon.ico
css/*.css
fonts/*.otf
fonts/*.ttf
fonts/*.woff2
templates/*.html
executable site
executable hakysidian
hs-source-dirs: src
main-is: site.hs
other-modules: ChaoDoc, SideNoteHTML, Pangu
other-modules: ChaoDoc, SideNoteHTML, Pangu, Paths_hakysidian
autogen-modules: Paths_hakysidian
build-depends: base >= 4.18
, hakyll >= 4.15
, mtl >= 2.2.2
@@ -20,7 +29,11 @@ executable site
-- , process
-- , regex-compat
, array
, directory
, filepath
, time
, wai-app-static
, warp
-- , ghc-syntax-highlighter
-- , blaze-html >= 0.9
, megaparsec
@@ -34,4 +47,4 @@ executable site
-Wno-unsafe
-Wno-prepositive-qualified-module
-O2 -threaded -rtsopts -with-rtsopts=-N
default-language: Haskell2010
default-language: Haskell2010