Hugo: Difference between revisions
m Added back old content to "Tips and tricks" |
Marked this version for translation |
||
| 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--> | ||
<!--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--> | ||
<!--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> | ||