Hugo: Difference between revisions
→Theming: typo |
Cleaned up and clarified the page |
||
Line 1: | Line 1: | ||
''' | <languages/> | ||
<translate> | |||
<!--T:1--> | |||
'''Hugo''' is a static site generator written in Go. It builds websites from content files and templates, supporting features such as Markdown content, themes, and flexible deployment options. Hugo is available in the NixOS ecosystem and can be used for a variety of web publishing tasks.<ref>https://gohugo.io/documentation/</ref> | |||
</translate> | |||
== Installation == | |||
=== | ==== Shell ==== | ||
<translate> | |||
<!--T:2--> | |||
To temporarily use Hugo in a shell environment, you can run: | |||
</translate> | |||
<syntaxhighlight lang="bash"> | |||
nix-shell -p hugo | |||
</syntaxhighlight> | |||
</ | |||
<translate> | |||
<!--T:3--> | |||
This will provide a shell with Hugo available without adding it to your system configuration. | |||
</translate> | |||
=== | ==== System setup ==== | ||
<translate> | |||
<!--T:4--> | |||
To install Hugo, add it to either the system-wide <code>environment.systemPackages</code> in <code>/etc/nixos/configuration.nix</code> or to the user-specific <code>home.packages</code> in <code>~/.config/nixpkgs/home.nix</code>.<ref>https://nixos.org/manual/nixos/stable/</ref> | |||
</translate> | |||
<syntaxhighlight lang="nix"> | |||
# System-wide installation (in /etc/nixos/configuration.nix) | |||
environment.systemPackages = with pkgs; [ | |||
hugo | |||
git # Useful for managing Hugo themes and site repositories | |||
]; | |||
# User-specific installation (in ~/.config/nixpkgs/home.nix) | |||
home.packages = with pkgs; [ | |||
hugo | |||
git | |||
]; | |||
</syntaxhighlight> | |||
<translate> | |||
<!--T:5--> | |||
Then, rebuild your system or apply your Home Manager configuration: | |||
</translate> | |||
<syntaxhighlight lang="bash"> | |||
< | # For system-wide installation | ||
sudo nixos-rebuild switch | |||
# For Home Manager | |||
home-manager switch | |||
</syntaxhighlight> | |||
== Configuration == | |||
==== Basic ==== | |||
</ | <translate> | ||
<!--T:8--> | |||
Basic Hugo configuration involves creating a new site and choosing themes. Use the following command to create a new Hugo site: | |||
</translate> | |||
<syntaxhighlight lang="bash"> | |||
hugo new site my-site | |||
</syntaxhighlight> | |||
<translate> | |||
Navigate to the site directory and add a theme as a git submodule or download it directly. For detailed steps, refer to the official Hugo documentation. | |||
</translate> | |||
==== Advanced ==== | |||
<translate> | |||
<!--T:9--> | |||
{{Expansion|reason=Section incomplete, needs detailed content on advanced configuration with NixOS}} | |||
</translate> | |||
== Tips and tricks == | |||
<translate> | |||
<!--T:10--> | |||
{{Expansion|reason=Section incomplete, needs more tips and tricks}} | |||
</translate> | |||
== Troubleshooting == | |||
<translate> | |||
<!--T:11--> | |||
{{Expansion|reason=Section incomplete, needs detailed troubleshooting steps}} | |||
</translate> | |||
== References == | |||
[[Category:Applications]] | [[Category:Applications]] | ||
[[Category:Server]] | [[Category:Server]] |