Source code of my static website dedicated to articles and tutorials.
Built with Hugo and the go.ngs.io/hugo-primer-blog theme, using Hugo Modules.
The website is available in both English and French. Each article is planned to be published in these two languages, with potentially more languages added in the future. Content relies on a simple structure: standard YAML metadata and Markdown for writing articles.
You can run the project directly using GitHub Codespaces, without installing Git, Go, or Hugo locally. This is the recommended option if you want to get started quickly.
The repository includes a preconfigured development environment for GitHub Codespaces. When launching the Codespace:
- The container is automatically initialized, and all the required prerequisites are installed.
- The Hugo theme is updated (if necessary) using the
hugo mod get -ucommand. - You can start the local server directly from the container using
hugo server.
If you prefer to work locally, make sure you have the following installed before running the project:
| Tool | Description |
|---|---|
| Git | The version control tool used to clone repositories and push updates. |
| Go | The programming language required to use this project, as it relies on Hugo Modules. |
| Hugo (standard, v0.146.0 or later) | The Hugo edition and minimum version required to build and run the project. |
🐧 Working on Linux is recommended for this project. If you are using Windows, use WSL.
Linux setup:
- Open a terminal if you don't already have one open.
- Check your environment by running:
bash env.sh
- If the script indicates that everything is correct, you can continue; otherwise, install the missing tools.
- Clone the repository:
git clone https://github.com/Nde-Code/blog.git
- Go to the project directory:
cd blog - Update the theme if a newer version is available:
hugo mod get -u
- Start the local development server:
hugo server
The project includes a workflow powered by GitHub Actions that automatically deploys the website to GitHub Pages every time a new change is pushed to the main branch, without requiring any additional configuration.
The deployment file can be viewed here: .github/workflows/build_and_deploy.yaml.
⚠️ Since its structure is not trivial, it is strongly recommended to fully understand how it works before making any modifications.
Articles are stored in the content/ folder and rely on a predefined archetype to simplify the initial configuration.
- Each new article must include YAML metadata in its header (front matter).
- The default archetype is located at
archetypes/default.md. - It automatically generates:
- the title (based on the filename),
- the article creation date,
- the author,
- the draft status (
draft: true), - empty tags, categories, and description fields ready to be completed.
There are two ways to create a new article.
Method 1 — Using the Hugo command:
Run the following command in your terminal (make sure to replace <language> with the appropriate language code):
hugo new content/<language>/posts/my-super-article.md
For example, for an English article:
hugo new content/en/posts/my-english-article.mdFor a French article:
hugo new content/fr/posts/my-french-article.mdHugo automatically generates the file with the required front matter. You only need to complete the YAML front matter and write the content.
Method 2 — Manually:
-
Create a new Markdown file in
content/en/posts/orcontent/fr/posts/. -
Add a YAML header structured as follows, and complete it as needed:
--- title: "My first Hugo article" date: YYYY-MM-DD draft: true tags: ["Hugo", "Tutorial"] categories: ["Development", "Documentation"] author: "Your name" description: "A short description explaining the purpose and content of this article." ---
-
Write your content in Markdown directly below the YAML header.
When the article is ready to be published, change:
draft: trueto:
draft: falseThis project is distributed under the GNU General Public License v3.0.
This project is created and maintained by Nde-Code.
Feel free to help me by correcting any spelling mistakes, inaccuracies, or other issues by opening an issue or a pull request.