build up to style

This commit is contained in:
Valentin Gagarin 2024-10-09 13:09:29 +02:00
parent 923a5c3543
commit 9b110aeb71
4 changed files with 110 additions and 81 deletions

View file

@ -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"
}
}

View file

@ -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,24 +17,42 @@
{
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 = ''
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}
# 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/
tree .
${lib.getExe pkgs.hugo} --minify --logLevel info -d public
'';
installPhase = "cp -r public $out";

View file

@ -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"

View file

@ -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