From c9e639f71b686093e6b53097f0accc0cfbb77303 Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Thu, 23 Dec 2021 13:52:39 +0700 Subject: Use system's Node.js This spares the CI from having to fetch steam-run and the whole graphic stacks it depends on. --- .build.jl | 4 ---- .build.yml | 9 +++++++-- Project.toml | 1 - README.md | 18 +++++++++--------- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.build.jl b/.build.jl index 8b7a09b..52bbec3 100644 --- a/.build.jl +++ b/.build.jl @@ -1,10 +1,6 @@ import Pkg Pkg.instantiate() -using NodeJS -run(`$(npm_cmd()) install highlight.js`) - using Franklin optimize(clear=true, no_fail_prerender=false, suppress_errors=false, fail_on_warning=true) -rm("__site/libs", recursive=true) diff --git a/.build.yml b/.build.yml index 35e7653..9884adf 100644 --- a/.build.yml +++ b/.build.yml @@ -3,16 +3,20 @@ oauth: lists.sr.ht/EMAILS:RO pages.sr.ht/PAGES:RW packages: - nixos.jq - nixos.julia-bin + - nixos.nodejs - nixos.nodePackages.katex - nixos.openring + - nixos.python3 - nixos.python3Packages.bleach - nixos.python3Packages.css-html-js-minify - nixos.python3Packages.markdown - - nixos.steam-run-native sources: - https://git.sr.ht/~cnx/site +environment: + NODE: node tasks: - inject: | + npm install highlight.js katex=$(nix-shell '' -A nodePackages.katex --run 'echo $out') ln -s $katex/lib/node_modules/katex/dist site/_libs/katex cp -r site/_libs/katex/{fonts,katex.min.css} site/_css @@ -24,7 +28,8 @@ tasks: acurl https://lists.sr.ht/query/list/5261.mbox -o site/_libs/formbox/mbox - build: | cd site - steam-run julia --project=@. .build.jl + julia --project=@. .build.jl + rm -r __site/libs - deploy: | tar -cvzf site.tar.gz -C site/__site . acurl -f https://pages.sr.ht/publish/cnx.srht.site -F content=@site.tar.gz diff --git a/Project.toml b/Project.toml index 5babed9..bb96e23 100644 --- a/Project.toml +++ b/Project.toml @@ -2,4 +2,3 @@ authors = ["Nguyễn Gia Phong "] [deps] Franklin = "713c75ef-9fc9-4b05-94a9-213340da978e" -NodeJS = "2bd173c7-0d6d-553b-b6af-13a54713934c" diff --git a/README.md b/README.md index fcb980e..f780ddf 100644 --- a/README.md +++ b/README.md @@ -11,22 +11,22 @@ This is my Franklin-generated static site, *without* client-side scripts. The following are needed to run the command above: * [Julia](https://julialang.org) +* [Node.js](https://nodejs.org) +* [Highlight.js](https://highlightjs.rtfd.io) * [KaTeX](https://katex.org) -* [openring](https://sr.ht/~sircmpwn/openring) * [css-html-js-minify](https://pypi.org/p/css-html-js-minify) KaTex has to installed to `_css` and `_libs` similar -to what done in `.build.yml`. Live-rendering will additionally -require the presence of `_libs/highlight/highlight.pack.js`. +to what done in `.build.yml`. Furthermore, adjacent sites +in the [Fediring](https://fediring.net) needs to present +in `_libs/fediring` and `_libs/openring/out.html` needs to be +generated using [openring](https://sr.ht/~sircmpwn/openring). Live-rendering +will additionally require the presence of `_libs/highlight/highlight.pack.js`. ### Implicit dependencies -The following are installed as part of the build process, -plus their own dependencies: - -* [Franklin](https://franklinjl.org) -* [NodeJS](https://juliapackages.com/p/nodejs) -* [highlight.js](https://highlightjs.org) +[Franklin](https://franklinjl.org) is installed as part of the build process, +plus its own dependencies. ## Copying -- cgit 1.4.1