File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 44 h = niccup . lib ;
55 isLinux = pkgs . stdenv . isLinux ;
66
7+ defaultSiteUrl = "https://emsh.cat/niccup" ;
8+ siteUrl =
9+ let
10+ raw = builtins . getEnv "NICCUP_SITE_URL" ;
11+ in pkgs . lib . removeSuffix "/" ( if raw != "" then raw else defaultSiteUrl ) ;
12+
13+ canonicalUrl = path : "${ siteUrl } ${ path } " ;
14+
715 # Discover and build examples
816 exampleDirs = builtins . attrNames (
917 pkgs . lib . filterAttrs ( _ : type : type == "directory" ) ( builtins . readDir ./examples )
7381 [ "head"
7482 [ "meta" { charset = "utf-8" ; } ]
7583 [ "title" "${ name } - niccup example" ]
84+ [ "link" { rel = "canonical" ; href = canonicalUrl "/examples/${ name } /" ; } ]
7685 [ "style" ( h . raw showcaseStyles ) ]
7786 ]
7887 [ "body"
119128 [ "meta" { charset = "utf-8" ; } ]
120129 [ "meta" { name = "viewport" ; content = "width=device-width, initial-scale=1" ; } ]
121130 [ "title" "niccup - Hiccup-style HTML generation for Nix" ]
131+ [ "link" { rel = "canonical" ; href = canonicalUrl "/" ; } ]
122132 [ "style" ( h . raw homeStyles ) ]
123133 ]
124134 [ "body"
You can’t perform that action at this time.
0 commit comments