docs: make base URL configurable through Nix

This commit is contained in:
Gabriel Arazas 2024-11-11 18:48:54 +08:00
parent 0f3a17a802
commit b0b7852ba6
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360
3 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,5 @@
BASEURL := "https://foo-dogsquared.github.io/nix-module-wrapper-manager-fds"
.PHONY: docs-serve
docs-serve:
hugo -s docs/website serve
@ -8,7 +10,7 @@ docs-build:
.PHONY: build
build:
{ command -v nix >/dev/null && nix build -f docs/ website; } || { nix-build docs/ -A website; }
{ command -v nix >/dev/null && nix build -f docs/ --argstr baseUrl $(BASEURL) website; } || { nix-build docs/ -A website --argstr baseUrl $(BASEURL); }
.PHONY: check
check:

View File

@ -106,6 +106,8 @@ in
];
};
in
{ baseUrl ? "https://foo-dogsquared.github.io/nix-module-wrapper-manager-fds" }:
buildHugoSite {
pname = "wrapper-manager-docs";
version = "2024-07-13";
@ -124,6 +126,8 @@ in
vendorHash = "sha256-qsmXolxEcYjY2jwIlPRqir5gE8TeVknPGIGF4g89x54=";
buildFlags = [ "--baseURL" baseUrl ];
nativeBuildInputs = [
asciidoctorWrapped
gems

View File

@ -279,7 +279,7 @@ let
buildPhase =
args.buildPhase or ''
runHook preBuild
hugo "''${buildFlags[@]}" --destination public
hugo ''${buildFlags[@]} --destination public
runHook postBuild
'';