From b60416834e4422a82df0638f1da2cf4e35fd2bf3 Mon Sep 17 00:00:00 2001 From: Simon C Date: Fri, 14 May 2021 21:42:15 +0200 Subject: [PATCH] feat: Ajout de la configuration --- .dockerignore | 4 ++ .editorconfig | 10 +++++ .env | 4 ++ .gitignore | 3 ++ .gitmodules0 | 3 ++ Dockerfile | 4 ++ README.md | 12 ++++++ docker-compose.prod.yml | 37 +++++++++++++++++++ docker-compose.staging.yml | 19 ++++++++++ home.html | 75 ++++++++++++++++++++++++++++++++++++++ run | 25 +++++++++++++ 11 files changed, 196 insertions(+) create mode 100644 .dockerignore create mode 100644 .editorconfig create mode 100644 .env create mode 100644 .gitignore create mode 100644 .gitmodules0 create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 docker-compose.prod.yml create mode 100644 docker-compose.staging.yml create mode 100644 home.html create mode 100644 run diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..f205c0b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +# Ignore everything +** + +!public diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..0bf5d83 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,10 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false \ No newline at end of file diff --git a/.env b/.env new file mode 100644 index 0000000..b8ff78f --- /dev/null +++ b/.env @@ -0,0 +1,4 @@ +DOCKER_CONTEXT=vert +NAME=weko +URL=weko.io +STATS_CONTAINER=weko-stats diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b45f0b7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +public +resources +backups diff --git a/.gitmodules0 b/.gitmodules0 new file mode 100644 index 0000000..b426a68 --- /dev/null +++ b/.gitmodules0 @@ -0,0 +1,3 @@ +[submodule "themes/hugo-theme-lowtech"] + path = themes/hugo-theme-lowtech + url = https://git.weko.io/kosssi/hugo-theme-lowtech.git diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fe82c9c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,4 @@ +FROM registry.weko.io/nginx-lowtech:0.0.8 + +# Copie des sources du site +COPY public /usr/share/nginx/html diff --git a/README.md b/README.md new file mode 100644 index 0000000..41eed34 --- /dev/null +++ b/README.md @@ -0,0 +1,12 @@ +# Weko + +Voici les sources du site + +## Outils + +- `hugo` + +## Inspirations + +- https://reset.fing.org/coalitions.html +- https://le-filament.com/ diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml new file mode 100644 index 0000000..13482be --- /dev/null +++ b/docker-compose.prod.yml @@ -0,0 +1,37 @@ +version: "3.8" + +volumes: + weko-log: + name: weko-log + weko-stats: + name: weko-stats + +services: + weko-prod: + container_name: weko-prod + build: . + restart: always + labels: + traefik.enable: "true" + traefik.http.routers.weko.rule: "Host(`${URL}`)" + traefik.http.routers.weko.entrypoints: "web" + volumes: + - weko-log:/var/log/nginx + - weko-stats:/usr/share/nginx/html/stats + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + + weko-stats: + container_name: weko-stats + image: registry.weko.io/goaccess:1.4.6 + restart: always + volumes: + - weko-log:/var/log/nginx + - weko-stats:/usr/share/nginx/html/stats + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + +networks: + default: + external: + name: traefik diff --git a/docker-compose.staging.yml b/docker-compose.staging.yml new file mode 100644 index 0000000..a34baf4 --- /dev/null +++ b/docker-compose.staging.yml @@ -0,0 +1,19 @@ +version: "3.8" + +networks: + default: + external: + name: traefik + +services: + weko-staging: + container_name: weko-staging + build: . + restart: always + labels: + traefik.enable: "true" + traefik.http.routers.weko-staging.rule: "Host(`staging.${URL}`)" + traefik.http.routers.weko-staging.entrypoints: "web" + volumes: + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro diff --git a/home.html b/home.html new file mode 100644 index 0000000..d1e30f9 --- /dev/null +++ b/home.html @@ -0,0 +1,75 @@ +{{ define "main" }} + +{{ with site.Data.homepage.banner }} +
+
+

{{ .title | markdownify }}

+ {{with .image}}Le futur du numérique responsable{{end}} +

{{ .content | markdownify }}

+ {{ if .button.enable }} + {{ with .button }} +

{{ .label }}

+ {{ end }} + {{ end }} +
+
+{{ end }} + +{{ if site.Data.homepage.valeur.enable }} +{{ with site.Data.homepage.valeur }} +
+
+

{{ .title | markdownify }}

+
+
+ {{ range .valeur_item }} +
+ {{ .name | title }} +

{{ .name | title }}

+

{{ .content | markdownify }}

+
+ {{ end }} +
+
+{{ end }} +{{ end }} + +{{ if site.Data.homepage.presentations.enable }} +{{ with site.Data.homepage.presentations }} +{{ range $i,$p := .presentations_item }} +{{ with $p }} +
+
+ {{ if modBool $i 2 }} + {{ .Title }} + {{ else }} + {{ .content | markdownify }} + {{ end }} +
+
+ {{ if modBool $i 2 }} + {{ .content | markdownify }} + {{ else }} + {{ .Title }} + {{ end }} +
+
+{{ end }} +{{ end }} +{{ end }} +{{ end }} + +
+
+

Accompagné par l'incubateur Ronalpia

+

« J’ai le plaisir de vous annoncer qu’en 2021, mon entreprise va bénéficier d’un accompagnement personnalisé par Ronalpia !
+ Cela va me permettre de développer mon projet et contribuer à réduire les impacts environnementaux du numérique sur mon territoire ! »

+
+ +
+ +{{ end }} diff --git a/run b/run new file mode 100644 index 0000000..26d5fa7 --- /dev/null +++ b/run @@ -0,0 +1,25 @@ +#!/bin/bash + +# -e Exit immediately if a command exits with a non-zero status. +# -u Treat unset variables as an error when substituting. +set -eu + +. ./.env +. ./themes/hugo-theme-lowtech/scripts/run + +echo " _" +echo " | |" +echo "__ _____| | _____" +echo "\ \ /\ / / _ \ |/ / _ \\" +echo " \ V V / __/ < (_) |" +echo " \_/\_/ \___|_|\_\___/" +echo +echo + +if [ $# -ge 1 ]; then + $@ +else + help_generic +fi + +end