Compare commits
59
Commits
v2
...
production
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ecfbb8013 | ||
|
|
8594e6215c | ||
|
|
943f665bd7 | ||
|
|
ade331a604 | ||
|
|
24e5e49acc | ||
|
|
cb5011571f | ||
|
|
bce5d3656d | ||
|
|
bbaba416ab | ||
|
|
83905b3fac | ||
|
|
f004d96076 | ||
|
|
640417cc35 | ||
|
|
c11be64b2e | ||
|
|
226d962003 | ||
|
|
d6c0f37f00 | ||
|
|
23a6b7db8d | ||
|
|
3e35c6c4a8 | ||
|
|
fb628e63f9 | ||
|
|
ea69ea079e | ||
|
|
49636f577e | ||
|
|
aa17e969cf | ||
|
|
929f11eab2 | ||
|
|
a1fa78fbab | ||
|
|
244c09d80a | ||
|
|
3ff75fef47 | ||
|
|
65dcba5549 | ||
|
|
f162e27efd | ||
|
|
e17da12271 | ||
|
|
4f6bea2002 | ||
|
|
f123e58a0c | ||
|
|
530c57df7a | ||
|
|
2b77e1e931 | ||
|
|
03ace1def8 | ||
|
|
367205b340 | ||
|
|
9f7c5f6b3c | ||
|
|
837e8c0d39 | ||
|
|
e782bcfc52 | ||
|
|
b0a8e54c1d | ||
|
|
5dbfc630ea | ||
|
|
e8c31e203b | ||
|
|
9828f370be | ||
|
|
4945517810 | ||
|
|
549e3aae2a | ||
|
|
8e6010da13 | ||
|
|
c7535f4579 | ||
|
|
bcd6960ad3 | ||
|
|
f351f8df41 | ||
|
|
aee66aaa44 | ||
|
|
dd947e18e9 | ||
|
|
f7395a620f | ||
|
|
84ef437572 | ||
|
|
4214da3f71 | ||
|
|
e6dc0e5a5b | ||
|
|
3e8d419887 | ||
|
|
3632c9fa65 | ||
|
|
1d6741e2a0 | ||
|
|
d5b72a8970 | ||
|
|
e5f43e6051 | ||
|
|
71506a71f7 | ||
|
|
c9cf197d56 |
@@ -1,20 +0,0 @@
|
|||||||
# All available Hugo versions are listed here: https://gitlab.com/pages/hugo/container_registry
|
|
||||||
image: registry.gitlab.com/pages/hugo:latest
|
|
||||||
|
|
||||||
variables:
|
|
||||||
GIT_SUBMODULE_STRATEGY: recursive
|
|
||||||
|
|
||||||
test:
|
|
||||||
script:
|
|
||||||
- hugo
|
|
||||||
except:
|
|
||||||
- master
|
|
||||||
|
|
||||||
pages:
|
|
||||||
script:
|
|
||||||
- hugo
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- public
|
|
||||||
only:
|
|
||||||
- master
|
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
FROM nginx:alpine
|
||||||
|
|
||||||
|
COPY ./public /var/www/html
|
||||||
|
COPY ./nginx-docker/nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
@@ -1,64 +1,69 @@
|
|||||||
|
# HUGO SITE AVEC DOCKER
|
||||||
|
|
||||||

|
Cette branche à pour but de conteneurisé un site HUGO compilé avec un server NGINX.
|
||||||
|
La configuration pour le NGINX reverse proxy en front se trouve dans le dossir nginx-proxy.
|
||||||
|
|
||||||
---
|
## UTILISATION:
|
||||||
|
|
||||||
Example [Hugo] website using GitLab Pages.
|
Pour l'utiliser avec un autre site Hugo, copier simplement la Dockerfile ou le docker-compose.yml
|
||||||
|
ainsi que les dossiers nginx-docker et nginx-proxy à la racine du projet Hugo (à côté du config.toml)
|
||||||
|
et éxécuter la commande pour construire le site:
|
||||||
|
|
||||||
Learn more about GitLab Pages at https://pages.gitlab.io and the official
|
```bash
|
||||||
documentation https://docs.gitlab.com/ce/user/project/pages/.
|
hugo
|
||||||
|
```
|
||||||
|
|
||||||
---
|
Un dossier public s'est créé avec les fichiers statiques du site, il faut maintenant configurer
|
||||||
|
les Nginx (le proxy et celui dans l'image Docker:
|
||||||
|
|
||||||
## GitLab CI
|
## CONFIGURATION:
|
||||||
|
|
||||||
This project's static Pages are built by [GitLab CI][ci], following the steps
|
Editer le fichier de configuration
|
||||||
defined in [`.gitlab-ci.yml`](.gitlab-ci.yml).
|
```bash
|
||||||
|
nano nginx-proxy/nginx.conf
|
||||||
|
```
|
||||||
|
|
||||||
|
/\ Attention, le nom de domaine (ici exemple.com) est à configuré dans le proxy NGINX !
|
||||||
|
Une fois tout bien renseigné
|
||||||
|
|
||||||
## Building locally
|
Redémarrer NGINX:
|
||||||
|
|
||||||
To work locally with this project, you'll have to follow the steps below:
|
```bash
|
||||||
|
sudo systemctl restart nginx
|
||||||
|
```
|
||||||
|
|
||||||
1. Fork, clone or download this project
|
## DEMARRER L'IMAGE:
|
||||||
1. [Install][] Hugo
|
|
||||||
1. Preview your project: `hugo server`
|
|
||||||
1. Add content
|
|
||||||
1. Generate the website: `hugo` (optional)
|
|
||||||
|
|
||||||
Read more at Hugo's [documentation][].
|
### VIA DOCKER
|
||||||
|
|
||||||
### Preview your site
|
```bash
|
||||||
|
docker build -t hugo/hugo-site .
|
||||||
|
docker run -d -p 6666:80 --name hugo-site hugo/hugo-site
|
||||||
|
```
|
||||||
|
|
||||||
If you clone or download this project to your local computer and run `hugo server`,
|
### VIA DOCKER-COMPOSE
|
||||||
your site can be accessed under `localhost:1313/hugo/`.
|
|
||||||
|
|
||||||
The theme used is adapted from http://themes.gohugo.io/beautifulhugo/.
|
```bash
|
||||||
|
docker-compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
## GitLab User or Group Pages
|
### HTTPS:
|
||||||
|
|
||||||
To use this project as your user/group website, you will need one additional
|
Via Certbot:
|
||||||
step: just rename your project to `namespace.gitlab.io`, where `namespace` is
|
```bash
|
||||||
your `username` or `groupname`. This can be done by navigating to your
|
sudo apt install certbot -y
|
||||||
project's **Settings**.
|
sudo certbot certonly -d example.com
|
||||||
|
```
|
||||||
|
|
||||||
You'll need to configure your site too: change this line
|
Une fois le certificat obtenu, décommenter les 3 lignes concernant le SSL en vérifiant
|
||||||
in your `config.toml`, from `"https://pages.gitlab.io/hugo/"` to `baseurl = "https://namespace.gitlab.io"`.
|
le nom des certificats en fonction du nom de domaine:
|
||||||
Proceed equally if you are using a [custom domain][post]: `baseurl = "http(s)://example.com"`.
|
```
|
||||||
|
#ssl on;
|
||||||
|
#ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
|
||||||
|
#ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
|
||||||
|
```
|
||||||
|
Créer une redirection vers le HTTPS dans le bloc server HTTP:
|
||||||
|
|
||||||
Read more about [user/group Pages][userpages] and [project Pages][projpages].
|
```
|
||||||
|
return 301 https://$host$request_uri;
|
||||||
## Troubleshooting
|
```
|
||||||
|
|
||||||
1. CSS is missing! That means two things:
|
|
||||||
|
|
||||||
Either that you have wrongly set up the CSS URL in your templates, or
|
|
||||||
your static generator has a configuration option that needs to be explicitly
|
|
||||||
set in order to serve static assets under a relative URL.
|
|
||||||
|
|
||||||
[ci]: https://about.gitlab.com/gitlab-ci/
|
|
||||||
[hugo]: https://gohugo.io
|
|
||||||
[install]: https://gohugo.io/overview/installing/
|
|
||||||
[documentation]: https://gohugo.io/overview/introduction/
|
|
||||||
[userpages]: http://doc.gitlab.com/ee/pages/README.html#user-or-group-pages
|
|
||||||
[projpages]: http://doc.gitlab.com/ee/pages/README.html#project-pages
|
|
||||||
[post]: https://about.gitlab.com/2016/04/07/gitlab-pages-setup/#custom-domains
|
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
# Configuration de l'adresse, titre (onglet) et des chemins vers les contenus
|
# Configuration de l'adresse, titre (onglet) et des chemins vers les contenus
|
||||||
baseurl = "https://greglebreton.gitlab.io/hugo-site/"
|
baseurl = "https://hugo.gregandev.fr"
|
||||||
contentdir = "content"
|
contentdir = "content"
|
||||||
layoutdir = "layouts"
|
layoutdir = "layouts"
|
||||||
publishdir = "public"
|
publishdir = "public"
|
||||||
|
|||||||
+3
-2
@@ -1,3 +1,5 @@
|
|||||||
|
[comment]: <> (PIPELINE)
|
||||||
|
|
||||||
## Contenu de la page d'accueil
|
## Contenu de la page d'accueil
|
||||||
|
|
||||||
<!-- Ajout image -->
|
<!-- Ajout image -->
|
||||||
@@ -14,5 +16,4 @@ Edit `/content/_index.md` to change what appears here. Delete `/content/_index.m
|
|||||||
if you don't want any content here.
|
if you don't want any content here.
|
||||||
|
|
||||||
Head over to the [GitLab project](https://gitlab.com/pages/hugo) to get started.
|
Head over to the [GitLab project](https://gitlab.com/pages/hugo) to get started.
|
||||||
|
<!-- test ouroboros ou watchtower -->
|
||||||
Bienvenu sinon :)
|
|
||||||
|
|||||||
@@ -12,8 +12,12 @@ Mon nom est Greg Lebreton, et voici mes compétences:
|
|||||||
- C#
|
- C#
|
||||||
- PHP
|
- PHP
|
||||||
- Java
|
- Java
|
||||||
- bla bla bla
|
- Python
|
||||||
- etc
|
- Bash
|
||||||
|
- Docker
|
||||||
|
- Ansible
|
||||||
|
- Jenkins
|
||||||
|
- Kubernetes
|
||||||
- ...
|
- ...
|
||||||
|
|
||||||
Et bien plus encore.
|
Et bien plus encore.
|
||||||
@@ -36,4 +40,4 @@ Juste le meilleure film : [mon lien](https://www.youtube.com/watch?v=W8sop56DBUs
|
|||||||
|
|
||||||
### texte
|
### texte
|
||||||
|
|
||||||
juste blabla, et bla !
|
juste blabla, et bla !
|
||||||
|
|||||||
@@ -1,11 +1,32 @@
|
|||||||
---
|
---
|
||||||
title: Test 1 Streets of rage !
|
title: Page Test Contenu
|
||||||
date: 2021-05-02
|
date: 2021-05-02
|
||||||
tags: ["Street of rage", "hugo"]
|
tags: ["test", "texte", "Rio de Janeiro"]
|
||||||
---
|
---
|
||||||
|
|
||||||
Test de post tout simple avec du contenu :
|
## Du texte:
|
||||||
|
|
||||||
{{< youtube ZSWzPI4BqvA >}}
|
Rio de Janeiro (/ˈʁi.u d(ʒi) ʒɐˈnejɾu/2), souvent désignée simplement sous le nom de Rio, et archaïquement Riogénaire en français, est la deuxième plus grande ville du Brésil après São Paulo. Située dans le Sud-Est du pays, elle est la capitale de l'État de Rio de Janeiro.
|
||||||
|
|
||||||

|
Avec ses 6,1 millions d'habitants intra-muros (communément appelés Cariocas, la variante Carioques existant aussi en français) et 12,62 millions dans l'aire urbaine, Rio de Janeiro est l'une des métropoles les plus importantes du continent américain.
|
||||||
|
|
||||||
|
Elle est mondialement connue pour son carnaval, ses plages (Copacabana, Leblon et Ipanema) ainsi que sa statue du Christ Rédempteur au sommet du Corcovado.
|
||||||
|
|
||||||
|
(extrait Wikipédia)
|
||||||
|
|
||||||
|
------
|
||||||
|
|
||||||
|
## Des tableaux:
|
||||||
|
|
||||||
|
| Tableau | Article | Prix |
|
||||||
|
| ------------- |:-------------:| -----:|
|
||||||
|
| 1 | Chapeau | €25 |
|
||||||
|
| 2 | Echarpe | €15 |
|
||||||
|
| 3 | Malabar | €0,1 |
|
||||||
|
|
||||||
|
------
|
||||||
|
|
||||||
|
## Simple lien:
|
||||||
|
[Je suis un lien!](https://gregandev.fr)
|
||||||
|
|
||||||
|
------
|
||||||
@@ -1,18 +1,44 @@
|
|||||||
---
|
---
|
||||||
title: test pleins de photos !
|
title: post test de divers contenus !
|
||||||
date: 2021-05-02
|
date: 2021-05-02
|
||||||
tags: ["photos", "test"]
|
tags: ["test", "contenu", "photos", "gif", "code"]
|
||||||
---
|
---
|
||||||
|
|
||||||
légende 1
|
|
||||||

|
## Image via link:
|
||||||
|

|
||||||
|
|
||||||
commentaire ...
|
commentaire ...
|
||||||
|
|
||||||
légende 2
|
------
|
||||||

|
|
||||||
|
|
||||||
légende 3
|
## Image via url locale (/static):
|
||||||

|

|
||||||
|
|
||||||
l"gende 4
|
------
|
||||||

|
|
||||||
|
## Gif via link:
|
||||||
|

|
||||||
|
|
||||||
|
------
|
||||||
|
|
||||||
|
## Vidéo Youtube:
|
||||||
|
{{< youtube ZSWzPI4BqvA >}}
|
||||||
|
|
||||||
|
------
|
||||||
|
|
||||||
|
## Du code:
|
||||||
|
```javascript
|
||||||
|
var s = "JavaScript syntax highlighting";
|
||||||
|
alert(s);
|
||||||
|
```
|
||||||
|
|
||||||
|
```python
|
||||||
|
s = "Python syntax highlighting"
|
||||||
|
print s
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd /ici/etla
|
||||||
|
echo "Salut le monde!"
|
||||||
|
```
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
---
|
|
||||||
title: Test post deux!
|
|
||||||
date: 2021-05-01
|
|
||||||
tags: ["atari"]
|
|
||||||
---
|
|
||||||
|
|
||||||
Bla BLa Bla, la nouvelle console Atari !
|
|
||||||
|
|
||||||
<!--  -->
|
|
||||||
|
|
||||||
{{< youtube LStkGeUmR_0 >}}
|
|
||||||
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
---
|
|
||||||
title: Test post troisième!
|
|
||||||
date: 2021-05-02
|
|
||||||
tags: ["windows", "post"]
|
|
||||||
---
|
|
||||||
|
|
||||||
Test du troisième post :
|
|
||||||
|
|
||||||
{{< youtube HrPRtYvCvZI >}}
|
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
version: '3.9'
|
||||||
|
services:
|
||||||
|
hugo:
|
||||||
|
image: nginx:alpine
|
||||||
|
container_name: hugo-site
|
||||||
|
volumes:
|
||||||
|
- ./nginx-docker:/etc/nginx/conf.d
|
||||||
|
- ./public:/var/www/html
|
||||||
|
ports:
|
||||||
|
- 6060:80
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# config pour le nginx dans le caontainer
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
server_name localhost;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
root /var/www/html;
|
||||||
|
index index.html index.htm;
|
||||||
|
}
|
||||||
|
|
||||||
|
error_page 404 /404.html; # Here and below is 404 error handling docs tried to describe
|
||||||
|
location = /404.html {
|
||||||
|
root /var/www/html;
|
||||||
|
}
|
||||||
|
|
||||||
|
error_page 500 502 503 504 /50x.html;
|
||||||
|
location = /50x.html {
|
||||||
|
root /var/www/html;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
# HTTP
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
|
||||||
|
server_name example.com;
|
||||||
|
|
||||||
|
client_max_body_size 64M;
|
||||||
|
|
||||||
|
# Redirection HTTP -> HTTPS
|
||||||
|
#return 301 https://$host$request_uri;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_buffering off;
|
||||||
|
proxy_redirect off;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Host $server_name;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_pass http://127.0.0.1:6666;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Nécessaire pour les redirections internes à Hugo
|
||||||
|
location /feed {
|
||||||
|
return 302 https://example.com/index.xml;
|
||||||
|
}
|
||||||
|
|
||||||
|
# HTTPS
|
||||||
|
server{
|
||||||
|
listen 443 ssl http2;
|
||||||
|
listen [::]:443 ssl http2;
|
||||||
|
|
||||||
|
server_name example.com;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_buffering off;
|
||||||
|
proxy_redirect off;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Host $server_name;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_pass http://127.0.0.1:6666;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Nécessaire pour les redirections internes à Hugo
|
||||||
|
location /feed {
|
||||||
|
return 302 https://example.com/index.xml;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ssl on;
|
||||||
|
#ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
|
||||||
|
#ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
|
||||||
|
|
||||||
|
access_log /var/log/nginx/hugo_access.log;
|
||||||
|
error_log /var/log/nginx/hugo_error.log;
|
||||||
|
}
|
||||||
Executable
+12
@@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "TEST WEB"
|
||||||
|
url=http://localhost:9999
|
||||||
|
curl ${url} -I -o headers -s
|
||||||
|
reponse=$(cat headers | head -n 1 | cut '-d ' '-f2')
|
||||||
|
if [ $reponse == "200" ]
|
||||||
|
then
|
||||||
|
echo "SUCCESS"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
- id: dateFormat
|
- id: dateFormat
|
||||||
translation: "2 Janvier, 2006"
|
translation: "2 Janvier, 2006"
|
||||||
- id: postedOnDate
|
- id: postedOnDate
|
||||||
#translation: "Posté le {{ .Count }}"
|
translation: "Posté le "
|
||||||
- id: translationsLabel
|
- id: translationsLabel
|
||||||
translation: "Autres langues: "
|
translation: "Autres langues: "
|
||||||
- id: translationsSeparator
|
- id: translationsSeparator
|
||||||
|
|||||||
Reference in New Issue
Block a user