Follow the steps below to create a new Hugo site with the MinIO Hugo Docs theme. Make sure to install Node.js and Hugo before running the commands.
hugo new site [site-name]
cd [site-name]
git init
git submodule add https://github.com/minio/kes-docs-theme themes/kes-docs-theme
echo "theme = 'kes-docs-theme'" >> config.toml- Set the
baseURLto the URL of your site or/. - Copy
params,markup, andmenufromkes-docs-theme/theme.tomlto your site'sconfig.tomlfile. This will enable the platform menu, syntax highlighting and TOC depth. - Optionally, you can set the
relativeURLstoTrueto enable relative URLs based on your deployment requirements.
cd themes/kes-docs-theme
npm install
npm run buildThis will build the theme assets and place them inside assets/dist folder.
Run the following command at the root of your Hugo site to start the Hugo server.
hugo serverNow you can access the site at http://localhost:1313.
You can customize the text that displays at the top of the left navigation by site language. You can make the text a link and customize where the link points.
Define the link text in theme/kes-docs-theme/assets/i18n/[languageCode].yaml at the nav_title entry.
Define the side nav title link in config.toml in the homeLink parameter.
[params]
homeLink = '/'Hugo uses shortcodes to extend what is normally available with Markdown.
We have added a shortcode that supports five admonition types
- Note
- Tip
- Caution
- Warning
- important
{{< admonition title="Admonition title" type="[note | tip | caution | warning | important]" >}}
Text...
{{< /admonition >}}The admonition title (title="Admonition title") is optional.
{{< admonition title="Warning: Data loss!" type="warning" >}}
Using this command causes data loss.
Use with caution.
{{< /admonition >}}Tabbed-view navigation is supported using the following shortcode.
{{< tabs "uniqueid" >}}
{{< tab "tab 1 title" >}}
tab 1 Content
{{< /tab >}}
{{< tab "tab 2 title" >}}
tab 2 Content
{{< /tab >}}
...
{{< /tabs >}}
Use the following shortcode to create card.
{{< cards >}}
{{< card title="Optional card title" >}}
Card content
{{< /card >}}
{{< /cards >}}
Multiple cards can be grouped together by repeating the {{< card >}} shortcode.
{{< cards >}}
{{< card title="Optional card 1 title" >}}
Card 1 content
{{< /card >}}
{{< card title="Optional card 2 title" >}}
Card 2 content
{{< /card >}}
{{< card title="Optional card 3 title" >}}
Card 3 content
{{< /card >}}
{{< /cards >}}
Reuse content from a folder in multiple page files. Similar to Flare Snippets, Sphinx Includes, Antora partials, and similar content reuse mechanisms.
{{% include "path/to/file.md" %}}
Replace path/to/file.md with a folder and/or file path of any level under the site's content folder.
navHidden
Prevent the theme from including the page in the site navigation.
e.g. navHidden: true
Treat the left nav link as a group heading.