diff --git a/flake.lock b/flake.lock index f2e254c..4e566d2 100644 --- a/flake.lock +++ b/flake.lock @@ -32,6 +32,22 @@ "type": "github" } }, + "mermaid": { + "flake": false, + "locked": { + "lastModified": 1719905309, + "narHash": "sha256-pGjfHnIJ7QPVWN+XZZl63c535fuegyb6/EL+UmGhTQg=", + "owner": "hugomods", + "repo": "mermaid", + "rev": "c0c313df723dbac0e5dad65cb4794f5987b81d3b", + "type": "github" + }, + "original": { + "owner": "hugomods", + "repo": "mermaid", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1728018373, @@ -52,6 +68,7 @@ "inputs": { "hugo-modules": "hugo-modules", "hugoplate": "hugoplate", + "mermaid": "mermaid", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index ee35e5f..4d8ecdd 100644 --- a/flake.nix +++ b/flake.nix @@ -3,10 +3,12 @@ nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; hugoplate.url = "github:zeon-studio/hugoplate"; hugoplate.flake = false; + mermaid.url = "github:hugomods/mermaid"; + mermaid.flake = false; hugo-modules.url = "github:gethugothemes/hugo-modules"; hugo-modules.flake = false; }; - outputs = inputs@{ self, nixpkgs, hugoplate, ... }: + outputs = inputs@{ self, nixpkgs, ... }: let system = "x86_64-linux"; lib = nixpkgs.lib; @@ -15,26 +17,44 @@ { packages.${system}.default = let + lockfile = with builtins; (fromJSON (readFile ./flake.lock)).nodes; + module-sources = map + (x: { + source = inputs.${x}; + path = with lockfile.${x}.original; "${type}.com/${owner}/${repo}"; + }) + ([ + "hugo-modules" + "mermaid" + ]); theme = "hugoplate"; - modules = with builtins; map (attrs: baseNameOf attrs.path) (fromTOML (readFile ./src/config/_default/module.toml)).imports; in pkgs.stdenv.mkDerivation { name = "website"; src = ./src; - buildInputs = with pkgs; [ go nodejs git ]; - buildPhase = '' - # install theme - mkdir -p themes/${theme} - cat << EOF >> hugo.toml - theme = "${theme}" - EOF - cp -r ${inputs.${theme}}/* themes/${theme} - # install modules - mkdir -p themes/github.com/gethugothemes/hugo-modules - cp -r ${toString (map (module: "${inputs.hugo-modules}/${module}") modules)} themes/github.com/gethugothemes/hugo-modules/ - ${lib.getExe pkgs.hugo} --minify --logLevel info -d public - ''; + buildInputs = with pkgs; [ go nodejs git tree ]; + buildPhase = + let + copy-modules = map + (module: '' + mkdir -p themes/${module.path} + cp -r ${module.source}/* themes/${module.path} + '') + module-sources; + in + lib.concatStringsSep "\n" copy-modules + + '' + # install theme + mkdir -p themes/${theme} + cat << EOF >> hugo.toml + theme = "${theme}" + EOF + cp -r ${inputs.${theme}}/* themes/${theme} + + tree . + ${lib.getExe pkgs.hugo} --minify --logLevel info -d public + ''; installPhase = "cp -r public $out"; }; devShells.${system}.default = diff --git a/src/config/_default/module.toml b/src/config/_default/module.toml index d33813c..5493e74 100644 --- a/src/config/_default/module.toml +++ b/src/config/_default/module.toml @@ -2,92 +2,92 @@ extended = true min = "0.115.2" -# [[imports]] -# path = "github.com/zeon-studio/hugoplate" +[[imports]] +path = "github.com/hugomods/mermaid" -#[[imports]] -#path = "github.com/gethugothemes/hugo-modules/search" +[[imports]] +path = "github.com/gethugothemes/hugo-modules/search" -#[[imports]] -#path = "github.com/gethugothemes/hugo-modules/pwa" +[[imports]] +path = "github.com/gethugothemes/hugo-modules/pwa" [[imports]] path = "github.com/gethugothemes/hugo-modules/images" -#[[imports]] -#path = "github.com/gethugothemes/hugo-modules/videos" +[[imports]] +path = "github.com/gethugothemes/hugo-modules/videos" -#[[imports]] -#path = "github.com/gethugothemes/hugo-modules/icons/font-awesome" +[[imports]] +path = "github.com/gethugothemes/hugo-modules/icons/font-awesome" -# [[imports]] -# path = "github.com/gethugothemes/hugo-modules/icons/themify-icons" +[[imports]] +path = "github.com/gethugothemes/hugo-modules/icons/themify-icons" -#[[imports]] -#path = "github.com/gethugothemes/hugo-modules/gzip-caching" +[[imports]] +path = "github.com/gethugothemes/hugo-modules/gzip-caching" -#[[imports]] -#path = "github.com/gethugothemes/hugo-modules/adsense" +[[imports]] +path = "github.com/gethugothemes/hugo-modules/adsense" -#[[imports]] -#path = "github.com/gethugothemes/hugo-modules/accordion" +[[imports]] +path = "github.com/gethugothemes/hugo-modules/accordion" -#[[imports]] -#path = "github.com/gethugothemes/hugo-modules/table-of-contents" +[[imports]] +path = "github.com/gethugothemes/hugo-modules/table-of-contents" -#[[imports]] -#path = "github.com/gethugothemes/hugo-modules/tab" +[[imports]] +path = "github.com/gethugothemes/hugo-modules/tab" -#[[imports]] -#path = "github.com/gethugothemes/hugo-modules/modal" +[[imports]] +path = "github.com/gethugothemes/hugo-modules/modal" -#[[imports]] -#path = "github.com/gethugothemes/hugo-modules/gallery-slider" +[[imports]] +path = "github.com/gethugothemes/hugo-modules/gallery-slider" -#[[imports]] -#path = "github.com/gethugothemes/hugo-modules/components/preloader" +[[imports]] +path = "github.com/gethugothemes/hugo-modules/components/preloader" -#[[imports]] -#path = "github.com/gethugothemes/hugo-modules/components/social-share" +[[imports]] +path = "github.com/gethugothemes/hugo-modules/components/social-share" -#[[imports]] -#path = "github.com/gethugothemes/hugo-modules/components/cookie-consent" +[[imports]] +path = "github.com/gethugothemes/hugo-modules/components/cookie-consent" -#[[imports]] -#path = "github.com/gethugothemes/hugo-modules/components/custom-script" +[[imports]] +path = "github.com/gethugothemes/hugo-modules/components/custom-script" -#[[imports]] -#path = "github.com/gethugothemes/hugo-modules/components/render-link" +[[imports]] +path = "github.com/gethugothemes/hugo-modules/components/render-link" -# [[imports]] -# path = "github.com/gethugothemes/hugo-modules/components/valine-comment" +[[imports]] +path = "github.com/gethugothemes/hugo-modules/components/valine-comment" -# [[imports]] -# path = "github.com/gethugothemes/hugo-modules/components/crisp-chat" +[[imports]] +path = "github.com/gethugothemes/hugo-modules/components/crisp-chat" -#[[imports]] -#path = "github.com/gethugothemes/hugo-modules/shortcodes/button" +[[imports]] +path = "github.com/gethugothemes/hugo-modules/shortcodes/button" -#[[imports]] -#path = "github.com/gethugothemes/hugo-modules/shortcodes/notice" +[[imports]] +path = "github.com/gethugothemes/hugo-modules/shortcodes/notice" -#[[imports]] -#path = "github.com/gethugothemes/hugo-modules/seo-tools/basic-seo" +[[imports]] +path = "github.com/gethugothemes/hugo-modules/seo-tools/basic-seo" -#[[imports]] -#path = "github.com/gethugothemes/hugo-modules/seo-tools/site-verifications" +[[imports]] +path = "github.com/gethugothemes/hugo-modules/seo-tools/site-verifications" -#[[imports]] -#path = "github.com/gethugothemes/hugo-modules/seo-tools/google-tag-manager" +[[imports]] +path = "github.com/gethugothemes/hugo-modules/seo-tools/google-tag-manager" -# [[imports]] -# path = "github.com/gethugothemes/hugo-modules/seo-tools/baidu-analytics" +[[imports]] +path = "github.com/gethugothemes/hugo-modules/seo-tools/baidu-analytics" -# [[imports]] -# path = "github.com/gethugothemes/hugo-modules/seo-tools/matomo-analytics" +[[imports]] +path = "github.com/gethugothemes/hugo-modules/seo-tools/matomo-analytics" -# [[imports]] -# path = "github.com/gethugothemes/hugo-modules/seo-tools/plausible-analytics" +[[imports]] +path = "github.com/gethugothemes/hugo-modules/seo-tools/plausible-analytics" -# [[imports]] -# path = "github.com/gethugothemes/hugo-modules/seo-tools/counter-analytics" +[[imports]] +path = "github.com/gethugothemes/hugo-modules/seo-tools/counter-analytics" diff --git a/src/config/_default/params.toml b/src/config/_default/params.toml index eb0b0a7..b13f399 100755 --- a/src/config/_default/params.toml +++ b/src/config/_default/params.toml @@ -62,14 +62,6 @@ author = "NGI Fediversity" image = "images/logo.png" -# site verifications -# verification module: https://github.com/gethugothemes/hugo-modules/tree/master/seo-tools/site-verifications -[site_verification] -google = "" # Your verification code -bing = "" # Your verification code -baidu = "" # Your verification code -facebook = "" # Your verification code -mastodon = "" # Your verification code # cookies # cookies module: https://github.com/gethugothemes/hugo-modules/tree/master/components/cookie-consent