Implementation of the Website
In this section, we will explore the technical aspects of the website, its development, and its deployment.
Development
One of the advantages of Hugo is the use of templates and themes that allow for site customization. To quickly develop the site, I used an existing theme, “Docsy.”
This theme is used for:
- Content structure: Docsy provides a clear structure for organizing documents and sections of the site, making navigation easier for users.
- Responsive design: The theme is designed to be responsive, ensuring a good user experience across different devices.
- Built-in features: Docsy includes useful features like search, side navigation, and multilingual support.
Project Folder Structure:
/hugo-cv
├── /assets
| ├── /icons
| ├── /scss
├── /content
| ├── /en
| ├── /about
| ├── /project
| ├── /work
| ├── /fr
| ├── /about
| ├── /project
| ├── /work
├── /layouts
├── /static
├── config.yaml
├── .gitlab-ci.yml
During development, several key steps were followed:
- Initial Setup: Installing Hugo and setting up the project with the Docsy theme.
- Customization: Adapting the theme to meet the specific needs of the project, including modifying styles and templates.
- Content Creation: Writing pages in Markdown and organizing sections.
- Local Testing: Using
hugo server
to test the site locally.
Deployment
Once the first version of the site was developed, it needed to be hosted. One of the solutions recommended by Hugo’s documentation is to host it on GitLab. By creating a repository on GitLab, the site can be directly hosted there:
Source: GitLab
- GitLab Repository Setup: Creating a new GitLab repository for the site and configuring deployment files.
- CI/CD Setup: Using GitLab CI/CD to automate deployment. This includes creating a
.gitlab-ci.yml
file to define the build and deployment steps. - Hosting: Configuring GitLab Pages to host the site, making the content publicly accessible.
The .gitlab-ci.yml
file used for deployment:
stages:
- build
- deploy
variables:
HUGO_VERSION: "0.137.1"
GIT_SUBMODULE_STRATEGY: recursive
before_script:
- apt-get update && apt-get install -y wget curl golang
- wget https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz
- tar -xzf hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz -C /usr/local/bin
- hugo version
- curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
- apt-get install -y nodejs
build:
stage: build
script:
- if [ -f package.json ]; then npm install; fi
- npm install -g sass
- hugo --gc --minify --baseURL "$CI_PAGES_URL/"
artifacts:
paths:
- public
only:
- main
pages:
stage: deploy
script:
- echo "Deploying to GitLab Pages..."
artifacts:
paths:
- public
only:
- main
environment:
name: production
url: $CI_PAGES_URL
Additionally, with hello.cv, I was able to purchase a domain with my name to make the site easier to access. This allows visitors to easily find my portfolio using a custom and professional URL.
To view the project, follow this link to GitLab.