diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..ad81785 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,153 @@ +--- +# drone encrypt weko/cremeaux $REGISTRY_PASSWORD +kind: secret +name: REGISTRY_PASSWORD +data: LBA/OxVYdvjpnkkt4xIf5qtGyr4ih3bPlp8M+ApLDuCDwzXsbzhjzNWoN46gynvrK4arcrDERtjTZmsK/m2WJyBhsQH4lPnIYHauZG/K + +--- +# drone encrypt weko/cremeaux $REGISTRY_USER +kind: secret +name: REGISTRY_USER +data: Pbz4Z6a319mG7QOUsPuAV79rlEkrMvNB4Ce+ePAGsdDKuQ== + +--- +# drone encrypt weko/cremeaux "{\"auths\":{\"https://registry.weko.io\":{\"auth\":\"$(echo -n "$REGISTRY_USER:$REGISTRY_PASSWORD" | base64)\",\"email\":\"$REGISTRY_USER\"}}}" +kind: secret +name: REGISTRY_CONFIG +data: bfQfncKvtcLiePl+YODLHN5LyQ5mB3eWj2dVqbyDd78gv1E+jzhb/4W/B3u1bMyMPlw1Q2/XIWBF5D9kVcTHjh/x2fo7LpYPmk5JZeXEP9qsRk+Td/JEmCm9Bbp+uUEigs2jZFAebAfGseP9rS7KyYEmEkO/JcXVjFZAWgmjvnuZBi8jApUJEorqo+e6lhclceljCSITIC6jA/bwggeqtVxoNVf2r8BBLIL3 + +--- +# drone encrypt weko/cremeaux $DIRECTUS_URL +kind: secret +name: DIRECTUS_URL +data: ES7uXGzaLMrydnCpt7+IC2m2mCUbtrKN66hQzVuwJH/aSZFtRWlugAWSQEfdAGyuhgYuJCPouQ== + +--- +# drone encrypt weko/cremeaux $DIRECTUS_TOKEN +kind: secret +name: DIRECTUS_TOKEN +data: BBCI/bTmqZh9VlbVpSnT9ZI5BotPlQOpJeo8G60XILi4N910Fx4E5fSVaHlM/vnHDGr0rp/01NEHVfyU + +--- +kind: pipeline +type: docker +name: prod + +platform: + os: linux + arch: arm64 + +steps: +- name: install submodule + image: drone/git + commands: + - git submodule update --init + +- name: install npm + image: node:current-alpine + # volumes: + # - name: hugo-theme-lowtech_node_modules + # path: /drone/src/themes/hugo-theme-lowtech/node_modules + environment: + DIRECTUS_URL: + from_secret: DIRECTUS_URL + DIRECTUS_TOKEN: + from_secret: DIRECTUS_TOKEN + commands: + - (cd themes/hugo-theme-lowtech && npm i) + - node scripts/directus-to-markdown/index.js + +- name: build website + image: jakejarvis/hugo-extended + commands: + - hugo --minify --environment production + +- name: typo + image: node:current-alpine + # volumes: + # - name: hugo-theme-lowtech_node_modules + # path: /drone/src/themes/hugo-theme-lowtech/node_modules + commands: + - node themes/hugo-theme-lowtech/scripts/typo + +- name: push docker image on registry + image: plugins/docker + settings: + username: + from_secret: REGISTRY_USER + password: + from_secret: REGISTRY_PASSWORD + repo: registry.weko.io/cremeaux + registry: registry.weko.io + tags: + - latest + +image_pull_secrets: +- REGISTRY_CONFIG + +# volumes: +# - name: hugo-theme-lowtech_node_modules +# host: +# path: /tmp/drone/cache/weko/cremeaux/themes/hugo-theme-lowtech + +--- +kind: pipeline +type: docker +name: staging + +platform: + os: linux + arch: arm64 + +steps: +- name: install submodule + image: drone/git + commands: + - git submodule update --init + +- name: install npm + image: node:current-alpine + # volumes: + # - name: hugo-theme-lowtech_node_modules + # path: /drone/src/themes/hugo-theme-lowtech/node_modules + environment: + DIRECTUS_URL: + from_secret: DIRECTUS_URL + DIRECTUS_TOKEN: + from_secret: DIRECTUS_TOKEN + commands: + - (cd themes/hugo-theme-lowtech && npm i) + - DRAFT=true node scripts/directus-to-markdown/index.js + +- name: build website + image: jakejarvis/hugo-extended + commands: + - hugo --minify --buildDrafts --buildFuture --environment staging + +- name: typo + image: node:current-alpine + # volumes: + # - name: hugo-theme-lowtech_node_modules + # path: /drone/src/themes/hugo-theme-lowtech/node_modules + commands: + - node themes/hugo-theme-lowtech/scripts/typo + +- name: push docker image on registry + image: plugins/docker + settings: + username: + from_secret: REGISTRY_USER + password: + from_secret: REGISTRY_PASSWORD + repo: registry.weko.io/cremeaux + registry: registry.weko.io + tags: + - staging + +image_pull_secrets: +- REGISTRY_CONFIG + +# volumes: +# - name: hugo-theme-lowtech_node_modules +# host: +# path: /tmp/drone/cache/weko/cremeaux/themes/hugo-theme-lowtech diff --git a/.gitignore b/.gitignore index 5d2fac3..d56b5df 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ resources public backups +.hugo_build.lock diff --git a/content/.drone.yml b/content/.drone.yml new file mode 100644 index 0000000..29d4ecd --- /dev/null +++ b/content/.drone.yml @@ -0,0 +1,153 @@ +--- +# drone encrypt weko/lestoitsduval $REGISTRY_PASSWORD +kind: secret +name: REGISTRY_PASSWORD +data: Q/Y+XPpJN0vxgDWzGVIVUZJ8PE0ngvYT/1NEFG+ZfnvoFa1c+ZSkhCeMk8OE/IC12Uw2VGebBsD1iCrkffKnA5GPIS+uCmtF1K/2o4+/ + +--- +# drone encrypt weko/lestoitsduval $REGISTRY_USER +kind: secret +name: REGISTRY_USER +data: wr3cyRh4G34wu8sbhEm96IUXZft0rDeGkkc5M/1N501H9Q== + +--- +# drone encrypt weko/lestoitsduval "{\"auths\":{\"https://registry.weko.io\":{\"auth\":\"$(echo -n "$REGISTRY_USER:$REGISTRY_PASSWORD" | base64)\",\"email\":\"$REGISTRY_USER\"}}}" +kind: secret +name: REGISTRY_CONFIG +data: lmQ25YQEai7VpYj8lUz9859JAV/aeQ9V5ulZhqVVQcni8usA9LF2IQFisekF69yu6ksp+9PBDHNKQA4GX7N/tFAlEdJySHUyr3qtrjUXRBs54E1G/GHVzY1/NwCytIT8Ro9d9H0XRiAbGnOQA2sjPFcb7CZ5kDZRmNHHHq6fplOdIM5ysYhiDIYH7TW+7dYm4ke8SBFhk4oKR7OMsAC+mo9++2dJ5W0FCro/ + +--- +# drone encrypt weko/lestoitsduval $DIRECTUS_URL +kind: secret +name: DIRECTUS_URL +data: hYUC351igGt4WLCCbtrT1R3szBAuzdEv/n1J6onJJRQUTLZ8v4Hj/wysho0smBsASoZv/hzdZrPRy0gi + +--- +# drone encrypt weko/lestoitsduval $DIRECTUS_TOKEN +kind: secret +name: DIRECTUS_TOKEN +data: 1aojESEVwAY0jmHQfpWt5bGbbnMtFiv6mQMEQjC368oJZeMSFPTZL9/mTQAAqSbEHyEHV1r19Hf/k/Oq + +--- +kind: pipeline +type: docker +name: prod + +platform: + os: linux + arch: arm64 + +steps: +- name: install submodule + image: drone/git + commands: + - git submodule update --init + +- name: install npm + image: node:current-alpine + volumes: + - name: hugo-theme-lowtech_node_modules + path: /drone/src/themes/hugo-theme-lowtech/node_modules + environment: + DIRECTUS_URL: + from_secret: DIRECTUS_URL + DIRECTUS_TOKEN: + from_secret: DIRECTUS_TOKEN + commands: + - (cd themes/hugo-theme-lowtech && npm i) + - node scripts/directus-to-markdown/index.js + +- name: build website + image: jakejarvis/hugo-extended + commands: + - hugo --minify --environment production + +- name: typo + image: node:current-alpine + volumes: + - name: hugo-theme-lowtech_node_modules + path: /drone/src/themes/hugo-theme-lowtech/node_modules + commands: + - node themes/hugo-theme-lowtech/scripts/typo + +- name: push docker image on registry + image: plugins/docker + settings: + username: + from_secret: REGISTRY_USER + password: + from_secret: REGISTRY_PASSWORD + repo: registry.weko.io/lestoitsduval + registry: registry.weko.io + tags: + - latest + +image_pull_secrets: +- REGISTRY_CONFIG + +volumes: +- name: hugo-theme-lowtech_node_modules + host: + path: /tmp/drone/cache/weko/lestoitsduval/themes/hugo-theme-lowtech + +--- +kind: pipeline +type: docker +name: staging + +platform: + os: linux + arch: arm64 + +steps: +- name: install submodule + image: drone/git + commands: + - git submodule update --init + +- name: install npm + image: node:current-alpine + volumes: + - name: hugo-theme-lowtech_node_modules + path: /drone/src/themes/hugo-theme-lowtech/node_modules + environment: + DIRECTUS_URL: + from_secret: DIRECTUS_URL + DIRECTUS_TOKEN: + from_secret: DIRECTUS_TOKEN + commands: + - (cd themes/hugo-theme-lowtech && npm i) + - DRAFT=true node scripts/directus-to-markdown/index.js + +- name: build website + image: jakejarvis/hugo-extended + commands: + - hugo --minify --buildDrafts --buildFuture --environment staging + +- name: typo + image: node:current-alpine + volumes: + - name: hugo-theme-lowtech_node_modules + path: /drone/src/themes/hugo-theme-lowtech/node_modules + commands: + - node themes/hugo-theme-lowtech/scripts/typo + +- name: push docker image on registry + image: plugins/docker + settings: + username: + from_secret: REGISTRY_USER + password: + from_secret: REGISTRY_PASSWORD + repo: registry.weko.io/lestoitsduval + registry: registry.weko.io + tags: + - staging + +image_pull_secrets: +- REGISTRY_CONFIG + +volumes: +- name: hugo-theme-lowtech_node_modules + host: + path: /tmp/drone/cache/weko/lestoitsduval/themes/hugo-theme-lowtech diff --git a/content/actualites/2021/06/21-les-mamans-2020-a-l-honneur/index.md b/content/actualites/2021/06/21-les-mamans-2020-a-l-honneur/index.md index a9b8e88..4d8607c 100644 --- a/content/actualites/2021/06/21-les-mamans-2020-a-l-honneur/index.md +++ b/content/actualites/2021/06/21-les-mamans-2020-a-l-honneur/index.md @@ -9,15 +9,15 @@ image_: Photo de Jane Duursma sur Unsplash Les mamans des douze bébés nés au cours de l’année 2020 (Lewis, Raphaël, Oksama, Suzanne, Noémie, Jessy, Camille et Joaquim, Zacharie, Marius, Alicia, Yüna) ont été mises à l’honneur, ce dimanche 13 juin en fin de matinée. -{{< gallery - "image1.jpg" - "image2.jpg" - "image3.jpg" - "image4.jpg" - "image5.jpg" - "image6.jpg" - "image7.jpg:Élodie et Zacharie" ->}} +{{< gallery >}} +![](image1.jpg) +![](image2.jpg) +![](image3.jpg) +![](image4.jpg) +![](image5.jpg) +![](image6.jpg) +![Élodie et Zacharie](image7.jpg) +{{< /gallery >}} Vu les circonstances de la crise sanitaire, cette année encore ce sont quatre conseillers de la commission animation qui se sont déplacés à domicile des familles afin de remettre un bon d’achat, une rose et un poème à chacune des mamans. diff --git a/content/actualites/2021/07/01-marche-du-terroir/affiche.webp b/content/actualites/2021/07/01-marche-du-terroir-de-cremeaux/affiche.webp similarity index 100% rename from content/actualites/2021/07/01-marche-du-terroir/affiche.webp rename to content/actualites/2021/07/01-marche-du-terroir-de-cremeaux/affiche.webp diff --git a/content/actualites/2021/07/01-marche-du-terroir/christy-ash-evHJRn7UZyw-unsplash.jpg b/content/actualites/2021/07/01-marche-du-terroir-de-cremeaux/christy-ash-evHJRn7UZyw-unsplash.jpg similarity index 100% rename from content/actualites/2021/07/01-marche-du-terroir/christy-ash-evHJRn7UZyw-unsplash.jpg rename to content/actualites/2021/07/01-marche-du-terroir-de-cremeaux/christy-ash-evHJRn7UZyw-unsplash.jpg diff --git a/content/actualites/2021/07/01-marche-du-terroir/index.md b/content/actualites/2021/07/01-marche-du-terroir-de-cremeaux/index.md similarity index 57% rename from content/actualites/2021/07/01-marche-du-terroir/index.md rename to content/actualites/2021/07/01-marche-du-terroir-de-cremeaux/index.md index 6299288..f3752cc 100644 --- a/content/actualites/2021/07/01-marche-du-terroir/index.md +++ b/content/actualites/2021/07/01-marche-du-terroir-de-cremeaux/index.md @@ -1,18 +1,21 @@ ---- +--- title: Marché du terroir de Crémeaux -description: Venez faire un tour au marché du terroir de Crémeaux ou vous pourrez retrouver des produits laux -auteur: Commission Communication -date: 2021-07-01 +date: '2021-07-01' image: christy-ash-evHJRn7UZyw-unsplash.jpg -image_: Photo de Christy Ash sur Unsplash ---- - +image_credit: Photo de Christy Ash sur Unsplash +description: >- + Venez faire un tour au marché du terroir de Crémeaux ou vous pourrez retrouver + des produits locaux +auteur: Commission Communication +draft: 'false' +--- + Venez faire un tour au marché du terroir de Crémeaux le vendredi 2 juillet à 18h. Sur le terrain des sœurs se trouveront de nombreux stands avec vente de produits locaux. -Des plateaux repas seront servis sur place ou à emporter par le comité des fêtes, animation musical la soirée avec -["la Chips"](http://www.la-chips.net/) fanfare buissonnière. +Des plateaux repas seront servis sur place ou à emporter par le comité des fêtes, animation musical la soirée avec ["la Chips"](http://www.la-chips.net/) fanfare buissonnière. ![Affiche](affiche.webp) Protocole sanitaire en vigueur respecté. + diff --git a/content/actualites/2021/07/12-marche-du-terroir/index.md b/content/actualites/2021/07/12-retour-sur-le-marche-du-terroir/index.md similarity index 73% rename from content/actualites/2021/07/12-marche-du-terroir/index.md rename to content/actualites/2021/07/12-retour-sur-le-marche-du-terroir/index.md index 65822d1..43965dc 100644 --- a/content/actualites/2021/07/12-marche-du-terroir/index.md +++ b/content/actualites/2021/07/12-retour-sur-le-marche-du-terroir/index.md @@ -1,10 +1,16 @@ ---- +--- title: Retour sur le Marché du terroir -description: C'est sous le premier soleil de juillet que le marché du terroir a eu lieu, le vendredi 2 juillet à partir de 18 heures, organisé par la municipalité sous la houlette de la commission animation. +date: '2021-07-12' +image: null +image_credit: null +description: >- + C'est sous le premier soleil de juillet que le marché du terroir a eu lieu, le + vendredi 2 juillet à partir de 18 heures, organisé par la municipalité sous la + houlette de la commission animation. auteur: Commission Communication -date: 2021-07-12 ---- - +draft: 'false' +--- + C'est sous le premier soleil de juillet que le marché du terroir a eu lieu, le vendredi 2 juillet à partir de 18 heures, organisé par la municipalité sous la houlette de la commission animation. Il se trouvait sur le terrain et la salle Abbé Grobost. Ce sont 25 exposants du Pays d'Urfé et du val d'Aix qui ont proposé leurs divers produits locaux, artisanaux et de bien-être (miel, farine, viandes, jouets en bois, écrivains, énergéticienne, présentation de reiki, huiles essentielles, …). @@ -13,7 +19,8 @@ A la salle Hêtre, Le club Rencontre et Loisirs de Crémeaux projetait des films La commission animation était en collaboration avec le Comité des Fêtes qui s'est occupé de l'animation avec la fanfare buissonnière [« Les Chips »](http://www.la-chips.net/) pour assurer l'ambiance, et servait des repas sous chapiteau, sur le terrain Abbé Grobost. -{{< gallery - "photo1.jpg" - "photo2.jpg" ->}} +{{< gallery >}} +![](photo1.jpg) +![](photo2.jpg) +{{< /gallery >}} + diff --git a/content/actualites/2021/07/12-marche-du-terroir/photo1.jpg b/content/actualites/2021/07/12-retour-sur-le-marche-du-terroir/photo1.jpg similarity index 100% rename from content/actualites/2021/07/12-marche-du-terroir/photo1.jpg rename to content/actualites/2021/07/12-retour-sur-le-marche-du-terroir/photo1.jpg diff --git a/content/actualites/2021/07/12-marche-du-terroir/photo2.jpg b/content/actualites/2021/07/12-retour-sur-le-marche-du-terroir/photo2.jpg similarity index 100% rename from content/actualites/2021/07/12-marche-du-terroir/photo2.jpg rename to content/actualites/2021/07/12-retour-sur-le-marche-du-terroir/photo2.jpg diff --git a/content/actualites/2021/07/21-partir-en-livre/index.md b/content/actualites/2021/07/21-partir-en-livre/index.md index 9c4e71e..33c3fcf 100644 --- a/content/actualites/2021/07/21-partir-en-livre/index.md +++ b/content/actualites/2021/07/21-partir-en-livre/index.md @@ -1,10 +1,15 @@ ---- +--- title: Partir en livre -description: enez faire un tour au marché du terroir de Crémeaux ou vous pourrez retrouver des produits laux +date: '2021-07-21' +image: partir-en-livre.jpg +image_credit: null +description: >- + Venez faire un tour au marché du terroir de Crémeaux ou vous pourrez retrouver + des produits locaux auteur: Commission Communication -date: 2021-07-21 ---- - +draft: 'false' +--- + Groupes de lecture avec la participation de la bibliothèque de Crémeaux. -![partir en livre](partir-en-livre.jpg) +![partir en livre](partir-en-livre.jpg) diff --git a/content/actualites/2021/07/22-role-des-communes/index.md b/content/actualites/2021/07/22-le-role-des-communes-et-de-leurs-intercommunalites/index.md similarity index 75% rename from content/actualites/2021/07/22-role-des-communes/index.md rename to content/actualites/2021/07/22-le-role-des-communes-et-de-leurs-intercommunalites/index.md index a4de66f..060fd19 100644 --- a/content/actualites/2021/07/22-role-des-communes/index.md +++ b/content/actualites/2021/07/22-le-role-des-communes-et-de-leurs-intercommunalites/index.md @@ -1,12 +1,16 @@ ---- +--- title: Le rôle des communes et de leurs intercommunalités -description: Afin de présenter l'organisation, les compétences et le fonctionnement des communes, l'AMF (Association des Maires de France) a réalisé plusieurs clips pédagogiques à destination du grand public -auteur: Commission Communication -date: 2021-07-22 +date: '2021-07-22' image: role-des-communes.webp -image_: Communication de l'AMF ---- - +image_credit: Communication de l'AMF +description: >- + Afin de présenter l'organisation, les compétences et le fonctionnement des + communes, l'AMF (Association des Maires de France) a réalisé plusieurs clips + pédagogiques à destination du grand public +auteur: Commission Communication +draft: 'false' +--- + 😉 Et si on profitait des vacances pour s'instruire et se rappeler des cours d'éducation civique... ❓🤔 En tant que citoyen, vous vous posez parfois ces questions : @@ -17,4 +21,4 @@ image_: Communication de l'AMF - Quelle est la complémentarité de leurs actions ? - ... -🎬 Afin de présenter l'organisation, les compétences et le fonctionnement des communes, l'AMF (Association des Maires de France) a réalisé [plusieurs clips pédagogiques à destination du grand public](https://www.amf.asso.fr/documents-des-clips-pedagogiques-pour-expliquer-role-communesbr-leurs-intercommunalites/39083). +🎬 Afin de présenter l'organisation, les compétences et le fonctionnement des communes, l'AMF (Association des Maires de France) a réalisé [plusieurs clips pédagogiques à destination du grand public](https://www.amf.asso.fr/documents-des-clips-pedagogiques-pour-expliquer-role-communesbr-leurs-intercommunalites/39083). diff --git a/content/actualites/2021/07/22-role-des-communes/role-des-communes.webp b/content/actualites/2021/07/22-le-role-des-communes-et-de-leurs-intercommunalites/role-des-communes.webp similarity index 100% rename from content/actualites/2021/07/22-role-des-communes/role-des-communes.webp rename to content/actualites/2021/07/22-le-role-des-communes-et-de-leurs-intercommunalites/role-des-communes.webp diff --git a/content/actualites/2021/07/29-fermeture-de-la-mairie/index.md b/content/actualites/2021/07/29-la-marie-ferme/index.md similarity index 78% rename from content/actualites/2021/07/29-fermeture-de-la-mairie/index.md rename to content/actualites/2021/07/29-la-marie-ferme/index.md index 7ab16e9..1739a93 100644 --- a/content/actualites/2021/07/29-fermeture-de-la-mairie/index.md +++ b/content/actualites/2021/07/29-la-marie-ferme/index.md @@ -1,10 +1,13 @@ ---- +--- title: La marie ferme +date: '2021-07-29' +image: mairie.jpg +image_credit: Photo de la mairie description: La mairie de Crémeaux sera fermée du 4 au 26 août 2021. auteur: Le Maire -date: 2021-07-29 ---- - +draft: 'false' +--- + Durant les vacances d’été 2021, la mairie de Crémeaux fermera du 4 au 26 août 2021. -Pour les demandes urgentes, les numéros de téléphone du maire et des adjoints sont affichés sur la porte. +Pour les demandes urgentes, les numéros de téléphone du maire et des adjoints sont affichés sur la porte. diff --git a/content/actualites/2021/07/29-fermeture-de-la-mairie/mairie.jpg b/content/actualites/2021/07/29-la-marie-ferme/mairie.jpg similarity index 100% rename from content/actualites/2021/07/29-fermeture-de-la-mairie/mairie.jpg rename to content/actualites/2021/07/29-la-marie-ferme/mairie.jpg diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 63a12a3..4bc95bf 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -10,11 +10,13 @@ services: crmx-prod: container_name: crmx-prod build: . + image: registry.weko.io/cremeaux:latest restart: always labels: traefik.enable: "true" traefik.http.routers.crmx-prod.rule: "Host(`${URL}`)" traefik.http.routers.crmx-prod.entrypoints: "web" + com.centurylinklabs.watchtower.enable: "true" volumes: - cremeaux-log:/var/log/nginx - cremeaux-stats:/usr/share/nginx/html/stats diff --git a/docker-compose.staging.yml b/docker-compose.staging.yml index 468ba28..ce90104 100644 --- a/docker-compose.staging.yml +++ b/docker-compose.staging.yml @@ -8,11 +8,13 @@ services: crmx-staging: container_name: crmx-staging build: . + image: registry.weko.io/cremeaux:staging restart: always labels: traefik.enable: "true" traefik.http.routers.crmx-staging.rule: "Host(`staging.${URL}`)" traefik.http.routers.crmx-staging.entrypoints: "web" + com.centurylinklabs.watchtower.enable: "true" volumes: - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro diff --git a/layouts/shortcodes/gallery.html b/layouts/shortcodes/gallery.html index 2695688..306efe2 100644 --- a/layouts/shortcodes/gallery.html +++ b/layouts/shortcodes/gallery.html @@ -2,17 +2,18 @@ {{ $resources := .Page.Resources }} -
- {{ range .Params }} -
- {{ $path := . }} - {{ $text := "" }} - {{ if in . ":" }} - {{ $arg := split . ":" }} - {{ $path = index $arg 0 }} - {{ $text = index $arg 1 }} - {{ end }} +{{ $images := split (trim .Inner "\n") "!" }} +{{ $patternTitle := "\\[([^]]*)\\]\\(.*\\)" }} +{{ $patternPath := "\\[.*\\]\\(([^)]*)\\)" }} + +
+ + {{ range $images }} + {{ with . }} + {{ $title := replaceRE $patternTitle "$1" . }} + {{ $path := trim (replaceRE $patternPath "$1" .) " \n" }} +
{{ $image := $resources.GetMatch (printf "*%s*" $path) }} {{ $orientation := 1 }} {{ with $image }}{{ with .Exif }}{{ $orientation = .Tags.Orientation }}{{ end }}{{ end }} @@ -22,9 +23,10 @@ {{ $image = $image.Resize "300x r270" }} {{ end }} {{ $resized := $image.Resize "300x q100 webp" }} - {{ $text }} + {{ $title }}
{{ end }} + {{ end }}
diff --git a/scripts/directus-to-markdown/index.js b/scripts/directus-to-markdown/index.js new file mode 100644 index 0000000..c2057db --- /dev/null +++ b/scripts/directus-to-markdown/index.js @@ -0,0 +1,21 @@ +import DirectusToMarkdown from '@resilien/directus-to-markdown' +import urlslug from 'url-slug' + +const filter = process.env.DRAFT && process.env.DRAFT == 'true' ? '' : { draft: { _eq: 'false' } } + +const config = { + collections: { + actualites: { + readManyOption: { + fields: ['title', 'date', 'image', 'image_credit', 'description', 'auteur', 'draft', 'content'], + filter + }, + pathBuilder: (article) => { + const [year, month, day] = article.date.split("-") + return `./content/actualites/${year}/${month}/${day}-${urlslug(article.title, { remove: /\./g })}`; + } + } + } +} + +new DirectusToMarkdown(config).export(); diff --git a/scripts/directus-to-markdown/node_modules/@resilien/directus-to-markdown b/scripts/directus-to-markdown/node_modules/@resilien/directus-to-markdown new file mode 120000 index 0000000..fceff24 --- /dev/null +++ b/scripts/directus-to-markdown/node_modules/@resilien/directus-to-markdown @@ -0,0 +1 @@ +../../../../themes/hugo-theme-lowtech/node_modules/@resilien/directus-to-markdown \ No newline at end of file diff --git a/scripts/directus-to-markdown/node_modules/url-slug b/scripts/directus-to-markdown/node_modules/url-slug new file mode 120000 index 0000000..44b3fc9 --- /dev/null +++ b/scripts/directus-to-markdown/node_modules/url-slug @@ -0,0 +1 @@ +../../../themes/hugo-theme-lowtech/node_modules/url-slug \ No newline at end of file diff --git a/scripts/directus-to-markdown/package.json b/scripts/directus-to-markdown/package.json new file mode 100644 index 0000000..007610d --- /dev/null +++ b/scripts/directus-to-markdown/package.json @@ -0,0 +1,11 @@ +{ + "name": "directus-to-markdown", + "version": "0.0.0", + "description": "Translates content from Directus.io to gohugo.io", + "main": "index.js", + "type": "module", + "dependencies": { + "@resilien/directus-to-markdown": "file:../../themes/hugo-theme-lowtech/node_modules/@resilien/directus-to-markdown", + "url-slug": "file:../../themes/hugo-theme-lowtech/node_modules/url-slug" + } +} diff --git a/static/docs/conseils_municipaux/2021/2021_12_02-Conseil_Municipal.pdf b/static/docs/conseils_municipaux/2021/2021_12_02-Conseil_Municipal.pdf new file mode 100644 index 0000000..f78ca2e Binary files /dev/null and b/static/docs/conseils_municipaux/2021/2021_12_02-Conseil_Municipal.pdf differ diff --git a/themes/hugo-theme-lowtech b/themes/hugo-theme-lowtech index 437ab76..679a554 160000 --- a/themes/hugo-theme-lowtech +++ b/themes/hugo-theme-lowtech @@ -1 +1 @@ -Subproject commit 437ab76c51a94e646333f77162934b147b5163ac +Subproject commit 679a55471532113c31e28581a9632afe01a7a3d1