[name] is a page name's
contact
[ports] is an integer associated by a port
8080
[language] is in format ISO 639-1 without the localization.
fr
[languageCode] is in format ISO 639-1 with the localization.
fr-FR
[languageName] is the name of the language.
french
To do any modification or start the Hugo website, you must be located at the root of the project.
Read : https://gohugo.io/getting-started/quick-start/ or
hugo --help
hugo serve -p [ports]
hugo
Read : https://gohugo.io/content-management/formats/ and https://gohugo.io/content-management/types/
Use only HTML format.
With hugo :
Hugo new [name]/_index.html
Manually :
cd content && mkdir [name] && cd [name] && touch _index.html
You must have the page in each language
cd content && mkdir [name] && cd [name] && touch _index.html
cd ../../ && mv [name] [language]
MANDATORY :
-
Flag image (./assets/images/[language].png)
-
Translated all the content in this language
Copy and complete next to last language of this content :
[languageCode]:
languageName: [languageName]
languageCode: [language]
contentDir: content/[language]
title: SaaShup, SaaS next solution engine, easily run your SaaS business
weight: 1
menu:
main:
- name: home ##(You have to translate it)
url: .
identifier:
weight: 1
pre: fas fa-home
- name: catalog ##(You have to translate it)
url: catalog/
identifier: catalog
weight: 2
pre: fas fa-book
- name: pricing ##(You have to translate it)
url: pricing/
identifier: pricing
weight: 3
pre: fas fa-dollar-sign
- name: contact ##(You have to translate it)
url: contact/
identifier: contact
weight: 4
pre: fas fa-book
- name: jobs ##(You have to translate it)
identifier: jobs
weight: 5
pre: fas fa-gamepad
- name: docs ##(You have to translate it)
identifier: docs
weight: 6
pre: fas fa-file-alt
- name: status ##(You have to translate it)
identifier: status
weight: 7
pre: fas fa-battery-full
cd content && mkdir [language]
Past in, it all the content translated with exactly the same architecture as the other languages.
cd layouts/partials
In nav.html :
- Add this content down below this line :
span class="pe-1 pt-2"><link href="{{ $style.Permalink }}" rel="stylesheet"
{{ $[language]_flag := resources.Get "images/[language].png" }}
- Add this content downbelow this line : ul class="dropdown-menu" style="padding-left:2rem;" aria-labelledby="dropdownMenuLink
<li class="p-2"> <a href="/[languageCode]/{{ $currentUrl }}"> <img id="lang-flag" src="{{ $[language]_flag.RelPermalink }}" alt="[languageName] langage" width="32px"/> </a> </li>
cd i18n && touch [language].TOML
Use a translator like ChatGPT to translate in your language like the other.
To Deploy on Cloudflare, you have to follow instructions from this : Docs
Cloudflare Pages should use this Hugo version:
HUGO_VERSION=0.147.7
…