Browse Source

Cleanup hugo module

main
parent
commit
dd465b6ac6
Signed by: chris GPG Key ID: 3025DCBD46F81C0F
  1. 10
      README.org
  2. 8
      modules/hugo.nix

10
README.org

@ -680,21 +680,23 @@ Apply some configuration to the default settings:
./modules/hugo.nix
#+END_SRC
[[https://gohugo.io][Hugo]] is one of the most popular open-source static site generators.
[[https://gohugo.io][Hugo]] is one of the most popular open-source static site generators. I use it to build https://chrishayward.xyz which is included in a later section of this configuration. This module adds a custom package to push the site to the server.
#+BEGIN_SRC nix :noweb yes :tangle modules/hugo.nix
# <<file-warning>>
{ config, pkgs, ... }:
let
myUpdateSite = pkgs.writeShellScriptBin "update-site" ''
rsync -aP /etc/dotfiles/docs/public/ ubuntu@chrishayward.xyz:/var/www/chrishayward
mySiteDir = "/etc/dotfiles/docs/public/";
mySiteTgt = "unbuntu@chrishayward.xyz:/var/www/wedding";
mySiteUpdate = pkgs.writeShellScriptBin "my-site-update" ''
${pkgs.rsync}/bin/rsync -aP ${mySiteDir} ${mySiteTgt}
'';
in {
environment.systemPackages = [
pkgs.hugo
myUpdateSite
mySiteUpdate
];
}
#+END_SRC

8
modules/hugo.nix

@ -2,13 +2,15 @@
{ config, pkgs, ... }:
let
myUpdateSite = pkgs.writeShellScriptBin "update-site" ''
rsync -aP /etc/dotfiles/docs/public/ ubuntu@chrishayward.xyz:/var/www/chrishayward
mySiteDir = "/etc/dotfiles/docs/public/";
mySiteTgt = "unbuntu@chrishayward.xyz:/var/www/wedding";
mySiteUpdate = pkgs.writeShellScriptBin "my-site-update" ''
${pkgs.rsync}/bin/rsync -aP ${mySiteDir} ${mySiteTgt}
'';
in {
environment.systemPackages = [
pkgs.hugo
myUpdateSite
mySiteUpdate
];
}
Loading…
Cancel
Save