Skip to content

Commit

Permalink
make forest assets static
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanLorimer committed Jan 18, 2024
1 parent 30c489d commit 5ed7d46
Show file tree
Hide file tree
Showing 81 changed files with 2,029 additions and 12 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "theme"]
path = theme
url = https://git.sr.ht/~jonsterling/forester-base-theme
6 changes: 6 additions & 0 deletions app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,11 @@ buildGithubIdentityClaim = do
outputFolder <- ask
lift $ copyFileChanged "site/github.html" $ outputFolder <> "github.html"

buildForestXSLT :: SiteM ()
buildForestXSLT = do
outputFolder <- ask
lift $ copyFileChanged "site/forest.xsl" $ outputFolder <> "forest.xsl"

{------------------------------------------------
Shake Build
------------------------------------------------}
Expand All @@ -360,6 +365,7 @@ buildRules = do
buildFeed allPosts
buildCNAME
buildGithubIdentityClaim
buildForestXSLT
copyStaticFiles

main :: IO ()
Expand Down
2 changes: 1 addition & 1 deletion mprocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ procs:
server:
cmd: ["serve", "build"]
builder:
cmd: ["watchexec", "cabal run"]
cmd: ["watchexec", "build-all"]

7 changes: 5 additions & 2 deletions scripts/build-forest.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
forester build \
--root=jdll-0001 \
--no-assets \
--base-url=https://jonathanlorimer.dev/trees \
--no-theme \
trees/

cp -r output build/trees
# Hacky mangling for setting forest as subroute
mv output/index.xml output/trees.xml
ruplacer index.xml trees.xml ./output --go --quiet
cp -r output/* build
8 changes: 6 additions & 2 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
OUTPUT_DIR="build/"
cabal run
forester build --dev --root=jdll-0001 trees/ --no-assets
cp -r output "$OUTPUT_DIR/trees"
forester build --dev --root=jdll-0001 trees/ --no-assets --no-theme

# Hacky mangling for setting forest as subroute
mv output/index.xml output/trees.xml
ruplacer index.xml trees.xml ./output --go --quiet
cp -r output/* "$OUTPUT_DIR"



4 changes: 2 additions & 2 deletions scripts/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
};
buildAll = pkgs.writeShellApplication {
name = "build-all";
runtimeInputs = [ forester texlive cabal-install ];
runtimeInputs = with pkgs; [ forester texlive cabal-install ruplacer ];
text = builtins.readFile ./build.sh;
};
buildForest = pkgs.writeShellApplication {
name = "build-forest";
runtimeInputs = [ forester texlive ];
runtimeInputs = with pkgs; [ forester texlive ruplacer ];
text = builtins.readFile ./build-forest.sh;
};

Expand Down
Loading

0 comments on commit 5ed7d46

Please sign in to comment.