Hugo: Difference between revisions

Layer-09 (talk | contribs)
m Added back old content to "Tips and tricks"
Klinger (talk | contribs)
m Category Go added
 
(One intermediate revision by one other user not shown)
Line 68: Line 68:
</syntaxhighlight>
</syntaxhighlight>
<translate>
<translate>
<!--T:12-->
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.
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>
</translate>
Line 81: Line 82:


<translate>
<translate>
<!--T:devshell-->
=== Development Shell === <!--T:devshell-->
=== Development Shell ===


<!--T:13-->
You may want to limit Hugo installation to your project only. This allows contributors to use the exact dependencies specified for the project:
You may want to limit Hugo installation to your project only. This allows contributors to use the exact dependencies specified for the project:
{{file|shell.nix|nix|<nowiki>
{{file|shell.nix|nix|<nowiki>
Line 95: Line 96:
</nowiki>}}
</nowiki>}}


<!--T:14-->
To avoid typing <code>nix-shell</code> or <code>nix develop</code> to access the dev shell, consider [[Direnv|enabling nix-direnv]].
To avoid typing <code>nix-shell</code> or <code>nix develop</code> to access the dev shell, consider [[Direnv|enabling nix-direnv]].
</translate>
</translate>


<translate>
<translate>
<!--T:theming-->
=== Theming === <!--T:theming-->
=== Theming ===


<!--T:15-->
Nix can be used to deterministically import Hugo themes by pinning them to a specific revision:
Nix can be used to deterministically import Hugo themes by pinning them to a specific revision:
{{file|shell.nix|nix|<nowiki>
{{file|shell.nix|nix|<nowiki>
Line 124: Line 126:
</nowiki>}}
</nowiki>}}


<!--T:16-->
After creating a <code>hugo.toml</code> file like the following, activate the theme with <code>hugo new site . --force</code>:
After creating a <code>hugo.toml</code> file like the following, activate the theme with <code>hugo new site . --force</code>:
{{file|hugo.toml|toml|<nowiki>
{{file|hugo.toml|toml|<nowiki>
Line 144: Line 147:
[[Category:Applications]]
[[Category:Applications]]
[[Category:Server]]
[[Category:Server]]
[[Category:Go]]