Framework pour créer son site web en 2 minutes, et en Markdown! https://www.gregandev.fr
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
greg a08bca1fdd add border radius for img + geo VR project 6 months ago
content add border radius for img + geo VR project 6 months ago
layouts repush clean 8 months ago
nginx-proxy repush clean 8 months ago
static/images add border radius for img + geo VR project 6 months ago
themes/silhouette-hugo add border radius for img + geo VR project 6 months ago
.drone.yml repush clean 8 months ago
.gitignore repush clean 8 months ago
Dockerfile repush clean 8 months ago
README.md repush clean 8 months ago
config.toml repush clean 8 months ago
docker-compose.yml repush clean 8 months ago

README.md

Typing SVG

INSTALLATION 🔨

  • Via APT:
sudo apt install hugo
  • Via la ligne de commande:
cd /tmp
curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest \
 | grep  browser_download_url \
 | grep linux-amd64.deb \
 | grep extended \
 | cut -d '"' -f 4 \
 | wget -i -

sudo dpkg -i hugo*_linux-amd64.deb
rm -rf hugo*_linux-amd64.deb

UTILISATION

CREATION DU SITE 📃

  • Vérifier l'installation:
hugo version
  • Créer la structure du site:
hugo new site mon-site
  • Créer du contenu:
cd mon-site
hugo new posts/mon-post.md
nano posts/mon-post.md

Ajouter des medias:

  • images:
## Image via link:
![](https://pbs.twimg.com/media/DGKRMoPXcAIyA8y.jpg)

------

## Image via url locale (/static):
![](/images/test/1.png)
  • videos:
## Vidéo Youtube:
{{< youtube ZSWzPI4BqvA >}}

AJOUT D'UN THEME 🎨

git init
git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke.git themes/ananke
echo theme = \"ananke\" >> config.toml

Les thèmes HUGO:

CONFIGURATION DU CONFIG.TOML 🔧

  • Configuration de base
# Configuration de l'adresse, titre (onglet) et des chemins vers les contenus
baseurl = "/"
contentdir    = "content"
layoutdir     = "layouts"
publishdir    = "public"
title = "Mon super site!!!"
canonifyurls = true

# ACCUEIL
[Params]
  subtitle = "Portfolio made in HUGO !"
  logo = "img/logo2.png"
  favicon = "img/favicon.ico"
  dateFormat = "January 2, 2006"
  commit = false
  rss = false
  comments = true
  • Création d'un menu
[[menu.main]]   
    name = "Post 1"
    url = "/post/post1"
    weight = 1

[[menu.main]]
    name = "A propos"
    url = "/page/about"
    weight = 2

[[menu.main]]
    name = "Projets"
    url = "/page/about"
    weight = 3
  • Création d'un sous menu
[[menu.main]]
    parent = "Projets"
    name = "Projet 1"
    url = "/projets/projet1"
    weight = 1

[[menu.main]]
    parent = "Projets"
    name = "Projet 2"
    url = "/projets/projet2"
    weight = 2

Créer les dossiers et les fichiers correspondant. Les urls ne prennent pas l'extension .md du fichier

  • Création des icônes reseaux sociaux
[Author]
  name = ""
  email = ""
  gitlab = ""
  github = ""
  twitter = ""
  reddit = ""
  linkedin = ""

LANCER LE SERVEUR 🚀

# L'option -D est pour servir les fichiers en Draft = true (non publiés)
hugo server -D

Visiter http://localhost:1313

BUILDER LE SITE 🚧

hugo

Les fichiers générés sont dans le dossier public

DEPLOIEMENT 🏁

VIA GITLAB AUTO DEVOPS

Compléter le config.toml comme ceci:

baseURL = "https://gitlab_user.gitlab.io/"

Compléter le fichier .gitlab-ci.yml comme ceci:

image: registry.gitlab.com/pages/hugo/hugo_extended:latest

variables:
  GIT_SUBMODULE_STRATEGY: recursive

pages:
  script:
    - hugo
  artifacts:
    paths:
      - public
  only:
  - main

VIA DOCKER 🐳

  • Créer une Dockerfile contenant:
FROM nginx:alpine

COPY ./public/* /usr/share/nginx/html
COPY ./docs/nginx-exemple.conf /etc/nginx/conf.d/default.conf

EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
docker build -t hugo-site:1.0 .
docker run -d -p 8989:80  hugo-site:1.0

DOCUMENTATION 📚

DOC DU GARAGE
DOC OFFICIELLE
DOC MARKDOWN

CI/CD 🔁

  • WEB2PDF.py
  • .drone.yml

TO DO 📑

  • CI/CD schema