diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 0ae1308..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,15 +0,0 @@ -# To get started with Dependabot version updates, you'll need to specify which -# package ecosystems to update and where the package manifests are located. -# Please see the documentation for all configuration options: -# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates - -version: 2 -updates: - - package-ecosystem: "pip" - directory: "/" - schedule: - interval: "weekly" - - package-ecosystem: "npm" - directory: "/" - schedule: - interval: "weekly" diff --git a/.vite/deps_temp_3bdf9138/package.json b/.vite/deps_temp_3bdf9138/package.json new file mode 100644 index 0000000..3dbc1ca --- /dev/null +++ b/.vite/deps_temp_3bdf9138/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/content/templates/jinja/blocks/footer.en.html b/common-content/templates/jinja2/blocks/footer.en.html similarity index 89% rename from content/templates/jinja/blocks/footer.en.html rename to common-content/templates/jinja2/blocks/footer.en.html index 06ce3aa..4fe0e1f 100644 --- a/content/templates/jinja/blocks/footer.en.html +++ b/common-content/templates/jinja2/blocks/footer.en.html @@ -18,10 +18,10 @@ Home
  • - Customer testimonials (FR) + Customer testimonials (FR)
  • - Download the price + Download the price list
  • @@ -41,7 +41,7 @@ Account management
  • - DNS record generator (FR) + DNS record generator (FR)
  • diff --git a/content/templates/jinja/blocks/footer.fr.html b/common-content/templates/jinja2/blocks/footer.fr.html similarity index 89% rename from content/templates/jinja/blocks/footer.fr.html rename to common-content/templates/jinja2/blocks/footer.fr.html index 896b5dd..912dacd 100644 --- a/content/templates/jinja/blocks/footer.fr.html +++ b/common-content/templates/jinja2/blocks/footer.fr.html @@ -18,10 +18,10 @@ Accueil
  • - Témoignages clients + Témoignages clients
  • - Télécharger la + Télécharger la grille tarifaire
  • @@ -42,7 +42,7 @@ Gestion de mon compte
  • - Générateur d'enregistrements DNS + Générateur d'enregistrements DNS
  • diff --git a/content/templates/jinja/blocks/header.en.html b/common-content/templates/jinja2/blocks/header.en.html similarity index 100% rename from content/templates/jinja/blocks/header.en.html rename to common-content/templates/jinja2/blocks/header.en.html diff --git a/content/templates/jinja/blocks/header.fr.html b/common-content/templates/jinja2/blocks/header.fr.html similarity index 95% rename from content/templates/jinja/blocks/header.fr.html rename to common-content/templates/jinja2/blocks/header.fr.html index 5d9e9ad..0b60efa 100644 --- a/content/templates/jinja/blocks/header.fr.html +++ b/common-content/templates/jinja2/blocks/header.fr.html @@ -1,6 +1,5 @@ {% from "widgets/page_header.html" import page_header%} - -{{ page_header( +{{ page_header ( PRIMARY_TITLE = "le service e-mail éthique et libre facturé à l'usage", SECONDARY_TITLE = "pour des e-mails standards et interopérables et un service intégralement basé sur des technologies auto-hébergeables", THIRD_TITLE = "Le service est désormais ouvert !" diff --git a/content/templates/jinja/widgets/page_block_h2_with_content_and_primary_secondary_cta.html b/common-content/templates/jinja2/widgets/page_block_h2_with_content_and_primary_secondary_cta.html similarity index 100% rename from content/templates/jinja/widgets/page_block_h2_with_content_and_primary_secondary_cta.html rename to common-content/templates/jinja2/widgets/page_block_h2_with_content_and_primary_secondary_cta.html diff --git a/content/templates/jinja/widgets/page_block_h2_with_content_dark_background_no_cta.html b/common-content/templates/jinja2/widgets/page_block_h2_with_content_dark_background_no_cta.html similarity index 100% rename from content/templates/jinja/widgets/page_block_h2_with_content_dark_background_no_cta.html rename to common-content/templates/jinja2/widgets/page_block_h2_with_content_dark_background_no_cta.html diff --git a/content/templates/jinja/widgets/page_block_h2_with_ul_content_and_image_left.html b/common-content/templates/jinja2/widgets/page_block_h2_with_ul_content_and_image_left.html similarity index 100% rename from content/templates/jinja/widgets/page_block_h2_with_ul_content_and_image_left.html rename to common-content/templates/jinja2/widgets/page_block_h2_with_ul_content_and_image_left.html diff --git a/content/templates/jinja/widgets/page_block_h2_with_ul_content_and_image_right.html b/common-content/templates/jinja2/widgets/page_block_h2_with_ul_content_and_image_right.html similarity index 100% rename from content/templates/jinja/widgets/page_block_h2_with_ul_content_and_image_right.html rename to common-content/templates/jinja2/widgets/page_block_h2_with_ul_content_and_image_right.html diff --git a/content/templates/jinja/widgets/page_header.html b/common-content/templates/jinja2/widgets/page_header.html similarity index 100% rename from content/templates/jinja/widgets/page_header.html rename to common-content/templates/jinja2/widgets/page_header.html diff --git a/content/templates/jinja/widgets/page_section_main_cta.html b/common-content/templates/jinja2/widgets/page_section_main_cta.html similarity index 100% rename from content/templates/jinja/widgets/page_section_main_cta.html rename to common-content/templates/jinja2/widgets/page_section_main_cta.html diff --git a/content/templates/jinja/widgets/page_section_reference_logos.html b/common-content/templates/jinja2/widgets/page_section_reference_logos.html similarity index 100% rename from content/templates/jinja/widgets/page_section_reference_logos.html rename to common-content/templates/jinja2/widgets/page_section_reference_logos.html diff --git a/content/templates/jinja/widgets/testimonials.html b/common-content/templates/jinja2/widgets/testimonials.html similarity index 100% rename from content/templates/jinja/widgets/testimonials.html rename to common-content/templates/jinja2/widgets/testimonials.html diff --git a/content/pages/temoignages-clients.md b/content/pages/fr/temoignages-clients.md similarity index 100% rename from content/pages/temoignages-clients.md rename to content/pages/fr/temoignages-clients.md diff --git a/content/pages/img.png b/content/pages/img.png deleted file mode 100644 index e82d78b..0000000 Binary files a/content/pages/img.png and /dev/null differ diff --git a/content/pages/img_1.png b/content/pages/img_1.png deleted file mode 100644 index e82d78b..0000000 Binary files a/content/pages/img_1.png and /dev/null differ diff --git a/content/pages/index.md.jj b/content/pages/index.md.jj deleted file mode 100644 index 326deba..0000000 --- a/content/pages/index.md.jj +++ /dev/null @@ -1,174 +0,0 @@ ---- METADATA (first) --- -title galae - le service e-mail éthique et libre facturé à l'usage -slug index -description galae est un service e-mail éthique et libre facturé à l'usage. Toutes nos offres incluent des boîtes emails et domaines illimités hébergés en France. -language French -lang fr -# open graph metatada -og:title galae - le service e-mail éthique et libre facturé à l'usage -og:description galae est un service e-mail éthique et libre facturé à l'usage. Toutes nos offres incluent des boîtes emails et domaines illimités hébergés en France. -og:type website -og:site_name galae.net -og:url https://www.galae.net/fr/ -og:image https://www.galae.net/assets/img/galae_logo.png -og:locale fr - ---- DATA (second JSON Structure) --- -{ - "items_secu": [ - "Notre plateforme supporte nativement DKIM, SPF et DMARC.", - "Vous interagissez avec vos e-mails, carnets d'adresses et agendas via les protocoles standards IMAP, POP3, CalDAV et CardDAV.", - "Nous proposons des filtres SIEVE, des alias, une gestion fine des quotas.", - "Nous sommes attentifs à la délivérabilité de vos e-mails." - ], - "items_data": [ - "Notre infrastructure est exclusivement localisée en France.", - "Nous respectons le RGPD et veillons à le respecter dans la durée. Nous sommes accompagnés par un cabinet spécialisé : Cosipé.", - "Notre infrastructure matérielle redondée permet d'assurer la pérennité de vos données.", - "Vos données sont sauvegardées hors-site ; les sauvegardes sont redondées." - ], - "items_autonomous_sovereign": [ - "Interface de gestion fine de votre messagerie : création/suppression de boîtes e-mail, alias, filtres SIEVE, quotas, etc.", - "Plateforme d'entraide communautaire.", - "En option : GTI, support téléphonique professionnel.", - "Nous n'utilisons que des logiciels libres et des protocoles ouverts pour assurer l'interopérabilité." - ], - "references": [ - { "name": "oslandia", "logo_url":"https://www.galae.net/assets/img/references/oslandia.png" }, - { "name": "NARM-PC", "logo_url":"https://www.galae.net/assets/img/references/narm-pc.svg" }, - { "name": "Domeo conseils", "logo_url": "https://www.galae.net/assets/img/references/domeo-conseils.png" }, - { "name": "Ethicsys", "logo_url": "https://www.galae.net/assets/img/references/ethicsys.png" }, - { "name": "pix'n'graph", "logo_url":"https://www.galae.net/assets/img/references/pixngraph.png" } - ] -} ---- BODY (last / third) --- -{% load vite %} -{% load make_list %} - -{{ WIDGET__SECTION__TESTIMONIAL_LOGOS(( - { "name": "oslandia", "logo_url":"https://www.galae.net/assets/img/references/oslandia.png" }, - { "name": "NARM-PC", "logo_url":"https://www.galae.net/assets/img/references/narm-pc.svg" }, - { "name": "Domeo conseils", "logo_url": "https://www.galae.net/assets/img/references/domeo-conseils.png" }, - { "name": "Ethicsys", "logo_url": "https://www.galae.net/assets/img/references/ethicsys.png" }, - { "name": "pix'n'graph", "logo_url":"https://www.galae.net/assets/img/references/pixngraph.png" } -)}} - -
    -
    -{{ WIDGET__PAGE_BLOCK__H2_WITH_UL__IMAGE_ON_RIGHT( - TITLE=" - Des e-mails délivrés, - conformes aux standards - ", - IMAGE_URL="https://www.galae.net/assets/img/undraw_futuristic_interface_re_0cm6.svg", - CONTENT_ITEMS=[ - "Notre plateforme supporte nativement DKIM, SPF et DMARC.", - "Vous interagissez avec vos e-mails, carnets d'adresses et agendas via les protocoles standards IMAP, POP3, CalDAV et CardDAV.", - "Nous proposons des filtres SIEVE, des alias, une gestion fine des quotas.", - "Nous sommes attentifs à la délivérabilité de vos e-mails." - ], - CTA_LABEL="Découvrir les tarifs", - CTA_URL="#pricing", - -)}} - -{{{TO-1-LINE -{% include "widgets/page_block_h2_with_ul_content_and_image_right.html" with - -%} -{% include "widgets/page_block_h2_with_ul_content_and_image_left.html" with - TITLE="Vos données en sécurité" - IMAGE_URL="https://www.galae.net/assets/img/undraw_relaxation_re_ohkx.svg" - CONTENT_ITEMS=data.items_data - CTA_LABEL="Découvrir les tarifs" - CTA_URL="#pricing" -%} -{% include "widgets/page_block_h2_with_ul_content_and_image_right.html" with - TITLE="Vous êtes autonomes, accompagnés et souverains." - IMAGE_URL="https://www.galae.net/assets/img/undraw_experts_re_i40h.svg" - CONTENT_ITEMS=data.items_autonomous_sovereign - CTA_LABEL="Découvrir les tarifs" - CTA_URL="#pricing" -%} -TO-1-LINE}}} -
    -
    -{{{TO-1-LINE -{% include "widgets/page_block_h2_with_content_and_primary_secondary_cta.html" with - HTMLID="pricing" - TITLE="Offres et tarifs" - CONTENT="L'offre galae repose sur les 4 offres suivantes :" - MAIN_IMG_URL="https://www.galae.net/assets/img/grille_tarifaire_galae_fr.png" - MAIN_IMG_ALT="prix de galae" - SECONDARY_CTA_URL="https://www.galae.net/assets/docs/grille_tarifaire_galae.pdf" - SECONDARY_CTA_TARGET="_blank" - SECONDARY_CTA_LABEL="Téléchargez la grille tarifaire" - PRIMARY_CTA_URL="https://pay.galae.net/" - PRIMARY_CTA_TARGET="_blank" - PRIMARY_CTA_LABEL="Souscrivez maintenant" - PRIMARY_CTA_ICON="bi-rocket" -%} -{% include "widgets/page_block_h2_with_content_dark_background_no_cta.html" with - HTMLID="" - TITLE="Pourquoi j'ai décidé de créer le service galae ?" - CONTENT=" -

    - Comme nombre d'entre vous, j'ai constaté une dégradation progressive de la qualité des services e-mail et une augmentation des tarifs. -

    -

    - Cette conjoncture et les projets que nous menons avec algoo - pour le compte de nos clients m'ont décidé à lancer un service e-mail conforme aux standards, - s'appuyant exclusivement sur des logiciels libres et évidemment respectueux - des données des utilisateurs. -

    -

    - Lorsque je les ai interrogés, les clients m'ont demandé : -

    - -

    - Nous avons construit le service avec l'équipe, avec la communauté, avec nos clients, pour nos clients. -

    -

    - Et ça continuera d'être ainsi. -

    -

    - Décrié, le mail reste la colonne vertébrale de la majorité des systèmes d'informations. - - Nous — algoo — sommes là pour vous accompagner dans cette aventure avec notre service de - Gestion - Autonome et - Libre - d'Adresses - Email. -

    -
    - \"Damien -
    Damien ACCORSI
    -
    Dirigeant algoo et créateur de galae
    -
    "%}{% include "widgets/page_section_main_cta.html" with - HTMLID="signup" - TITLE="Convaincus que vous avez besoin d'un email éthique facturé à l'usage ?" - SUBTITLE=" - - Souscrivez à galae maintenant ! - - " - SECONDARY_TITLE=" -

    -

    Vous pouvez aussi - nous envoyer un e-mail - ou nous appeler au +33 (0)9.72.49.72.20 -

    - " -%} -TO-1-LINE}}} diff --git a/content/pages/a_page.md b/content/pages/test/dir/a_page.md similarity index 51% rename from content/pages/a_page.md rename to content/pages/test/dir/a_page.md index d58ec84..8464a51 100644 --- a/content/pages/a_page.md +++ b/content/pages/test/dir/a_page.md @@ -11,5 +11,5 @@ engine jinja2

    Page 1

    -

    Go to page 2

    +

    Go to page 2

    diff --git a/content/templates/django/blocks/footer.en.html b/content/templates/django/blocks/footer.en.html index 21a767b..7c279bf 100644 --- a/content/templates/django/blocks/footer.en.html +++ b/content/templates/django/blocks/footer.en.html @@ -21,7 +21,7 @@ Customer testimonials (FR)
  • - Download the price + Download the price list
  • diff --git a/content/templates/django/blocks/footer.fr.html b/content/templates/django/blocks/footer.fr.html index f108149..2cc28c4 100644 --- a/content/templates/django/blocks/footer.fr.html +++ b/content/templates/django/blocks/footer.fr.html @@ -21,7 +21,7 @@ Témoignages clients
  • - Télécharger la + Télécharger la grille tarifaire
  • diff --git a/content/templates/jinja/base.html b/content/templates/jinja2/base.html similarity index 68% rename from content/templates/jinja/base.html rename to content/templates/jinja2/base.html index 89693af..7cf0a0e 100644 --- a/content/templates/jinja/base.html +++ b/content/templates/jinja2/base.html @@ -1,4 +1,4 @@ -{% from "widgets/navbar.html" import navbar %} +{% from "blocks/block.html" import block %} @@ -27,43 +27,29 @@ -{% if object.metadata.lang == "fr" %} - {{ navbar( - CTA_LABEL="Découvrir les tarifs", - CTA_TARGET="", - CTA_URL="#pricing", - CHANGE_LANG_URL="/pages/en-index.html", - CHANGE_LANG_FLAG_URL="assets/img/lang-gb.svg", - CHANGE_LANG_ALT="English version" - ) }} -{% else %} - {{ navbar( - CTA_LABEL="See pricing", - CTA_TARGET="", - CTA_URL="#pricing", - CHANGE_LANG_URL="/pages/fr-index.html", - CHANGE_LANG_FLAG_URL="assets/img/lang-fr.svg", - CHANGE_LANG_ALT="Version française" - ) }} -{% endif %} + {{ block( + NAME = "navbar", + VERSION = object.metadata.lang|default(""), + DEFAULT_NAME = "navbar.fr.html" +) }}
    - {% if object.metadata.lang == "fr" %} - {% include "blocks/header.fr.html" %} - {% else %} - {% include "blocks/header.en.html" %} - {% endif %} + {{ block( + NAME = "header", + VERSION = object.metadata.lang|default(""), + DEFAULT_NAME = "header.fr.html" + ) }}
    {% block content %}{% endblock %}
    -{% if object.metadata.lang == "fr" %} - {% include "blocks/footer.fr.html" %} -{% else %} - {% include "blocks/footer.en.html" %} -{% endif %} +{{ block( + NAME = "footer", + VERSION = object.metadata.lang|default(""), + DEFAULT_NAME = "footer.fr.html" +) }} diff --git a/content/templates/jinja2/blocks/block.html b/content/templates/jinja2/blocks/block.html new file mode 100644 index 0000000..d4de33a --- /dev/null +++ b/content/templates/jinja2/blocks/block.html @@ -0,0 +1,20 @@ + +{% macro block(NAME = "", VERSION = "", DEFAULT_NAME = "") %} + + {% if VERSION != "" %} + {% include [ + "blocks/" + NAME + "." + VERSION + ".html", + "blocks/" + NAME.split('.')[0] + '.' + VERSION + '.' + NAME.split('.')[-1], + "blocks/" + DEFAULT_NAME + ".html", + "blocks/" + DEFAULT_NAME + ] %} + {% else %} + {% include [ + "blocks/" + NAME + ".html", + "blocks/" + NAME, + "blocks/" + DEFAULT_NAME + ".html", + "blocks/" + DEFAULT_NAME + ] %} + {% endif %} + +{% endmacro %} \ No newline at end of file diff --git a/content/templates/jinja2/blocks/navbar.en.html b/content/templates/jinja2/blocks/navbar.en.html new file mode 100644 index 0000000..d2ddb7b --- /dev/null +++ b/content/templates/jinja2/blocks/navbar.en.html @@ -0,0 +1,10 @@ +{% from "widgets/navbar.html" import navbar %} + +{{ navbar( + CTA_LABEL="See pricing", + CTA_TARGET="", + CTA_URL="#pricing", + CHANGE_LANG_URL="fr-index", + CHANGE_LANG_FLAG_URL="assets/img/lang-fr.svg", + CHANGE_LANG_ALT="Version française" + ) }} \ No newline at end of file diff --git a/content/templates/jinja2/blocks/navbar.fr.html b/content/templates/jinja2/blocks/navbar.fr.html new file mode 100644 index 0000000..29345f5 --- /dev/null +++ b/content/templates/jinja2/blocks/navbar.fr.html @@ -0,0 +1,10 @@ +{% from "widgets/navbar.html" import navbar %} + +{{ navbar( + CTA_LABEL="Découvrir les tarifs", + CTA_TARGET="", + CTA_URL="#pricing", + CHANGE_LANG_URL="en-index", + CHANGE_LANG_FLAG_URL="assets/img/lang-gb.svg", + CHANGE_LANG_ALT="English version" + ) }} \ No newline at end of file diff --git a/content/templates/jinja/image.html b/content/templates/jinja2/image.html similarity index 100% rename from content/templates/jinja/image.html rename to content/templates/jinja2/image.html diff --git a/content/templates/jinja/page.html b/content/templates/jinja2/page.html similarity index 100% rename from content/templates/jinja/page.html rename to content/templates/jinja2/page.html diff --git a/content/templates/jinja2/post.html b/content/templates/jinja2/post.html new file mode 100644 index 0000000..1bf8c69 --- /dev/null +++ b/content/templates/jinja2/post.html @@ -0,0 +1,8 @@ +{% extends "base.html" %} + +{% block content %} +Publié le {{ object.timestamp.strftime("%Y-%m-%d") }}. + +

    {{ object.title }}

    +{{ object.content_md|safe }} +{% endblock %} diff --git a/content/templates/jinja/widgets/navbar.html b/content/templates/jinja2/widgets/navbar.html similarity index 91% rename from content/templates/jinja/widgets/navbar.html rename to content/templates/jinja2/widgets/navbar.html index 9f8ee00..f27340c 100644 --- a/content/templates/jinja/widgets/navbar.html +++ b/content/templates/jinja2/widgets/navbar.html @@ -19,11 +19,12 @@ -{% endmacro %} \ No newline at end of file +{% endmacro %} + diff --git a/content/pages/en-index.md b/galae-content/pages/en/en-index.md similarity index 99% rename from content/pages/en-index.md rename to galae-content/pages/en/en-index.md index f39a7ca..4e751d7 100644 --- a/content/pages/en-index.md +++ b/galae-content/pages/en/en-index.md @@ -3,7 +3,8 @@ title galae - ethical and free pay-per-use e-mail slug en-index description galae est un service e-mail éthique et libre facturé à l'usage. Toutes nos offres incluent des boîtes emails et domaines illimités hébergés en France. language French -lang en +lang en +version .en engine jinja2 # open graph metatada og:title galae - ethical and free pay-per-use e-mail diff --git a/content/pages/fr-index.md b/galae-content/pages/fr-index.md similarity index 99% rename from content/pages/fr-index.md rename to galae-content/pages/fr-index.md index 3864ff5..c40d75c 100644 --- a/content/pages/fr-index.md +++ b/galae-content/pages/fr-index.md @@ -5,6 +5,7 @@ description galae est un service e-mail éthique et libre facturé à l'usage. T language French lang fr engine jinja2 +version .fr # open graph metatada og:title galae - le service e-mail éthique et libre facturé à l'usage og:description galae est un service e-mail éthique et libre facturé à l'usage. Toutes nos offres incluent des boîtes emails et domaines illimités hébergés en France. diff --git a/content/pages/generateur-enregistrements-dns.md b/galae-content/pages/fr/generateur-enregistrements-dns.md similarity index 100% rename from content/pages/generateur-enregistrements-dns.md rename to galae-content/pages/fr/generateur-enregistrements-dns.md diff --git a/content/pages/another_page.md b/galae-content/pages/test/another_page.md similarity index 54% rename from content/pages/another_page.md rename to galae-content/pages/test/another_page.md index 0efd582..78b34fb 100644 --- a/content/pages/another_page.md +++ b/galae-content/pages/test/another_page.md @@ -11,4 +11,4 @@ engine jinja2

    Page 2

    -

    Go to page 1

    +

    Go to page 1

    diff --git a/content/static/assets/docs/galae_price_list.pdf b/galae-content/static/assets/docs/galae_price_list.pdf similarity index 100% rename from content/static/assets/docs/galae_price_list.pdf rename to galae-content/static/assets/docs/galae_price_list.pdf diff --git a/content/static/assets/docs/galae_price_list_en.odt b/galae-content/static/assets/docs/galae_price_list_en.odt similarity index 100% rename from content/static/assets/docs/galae_price_list_en.odt rename to galae-content/static/assets/docs/galae_price_list_en.odt diff --git a/content/static/assets/docs/grille_tarifaire_galae.pdf b/galae-content/static/assets/docs/grille_tarifaire_galae.pdf similarity index 100% rename from content/static/assets/docs/grille_tarifaire_galae.pdf rename to galae-content/static/assets/docs/grille_tarifaire_galae.pdf diff --git a/content/static/assets/docs/grille_tarifaire_galae_fr.odt b/galae-content/static/assets/docs/grille_tarifaire_galae_fr.odt similarity index 100% rename from content/static/assets/docs/grille_tarifaire_galae_fr.odt rename to galae-content/static/assets/docs/grille_tarifaire_galae_fr.odt diff --git a/content/static/assets/favicon.ico b/galae-content/static/assets/favicon.ico similarity index 100% rename from content/static/assets/favicon.ico rename to galae-content/static/assets/favicon.ico diff --git a/content/static/assets/fonts/Raleway-Italic-VariableFont_wght.ttf b/galae-content/static/assets/fonts/Raleway-Italic-VariableFont_wght.ttf similarity index 100% rename from content/static/assets/fonts/Raleway-Italic-VariableFont_wght.ttf rename to galae-content/static/assets/fonts/Raleway-Italic-VariableFont_wght.ttf diff --git a/content/static/assets/fonts/Raleway-VariableFont_wght.ttf b/galae-content/static/assets/fonts/Raleway-VariableFont_wght.ttf similarity index 100% rename from content/static/assets/fonts/Raleway-VariableFont_wght.ttf rename to galae-content/static/assets/fonts/Raleway-VariableFont_wght.ttf diff --git a/content/static/assets/fonts/bootstrap-icons.css b/galae-content/static/assets/fonts/bootstrap-icons.css similarity index 100% rename from content/static/assets/fonts/bootstrap-icons.css rename to galae-content/static/assets/fonts/bootstrap-icons.css diff --git a/content/static/assets/fonts/bootstrap-icons.woff b/galae-content/static/assets/fonts/bootstrap-icons.woff similarity index 100% rename from content/static/assets/fonts/bootstrap-icons.woff rename to galae-content/static/assets/fonts/bootstrap-icons.woff diff --git a/content/static/assets/fonts/bootstrap-icons.woff2 b/galae-content/static/assets/fonts/bootstrap-icons.woff2 similarity index 100% rename from content/static/assets/fonts/bootstrap-icons.woff2 rename to galae-content/static/assets/fonts/bootstrap-icons.woff2 diff --git a/content/static/assets/galae.ico b/galae-content/static/assets/galae.ico similarity index 100% rename from content/static/assets/galae.ico rename to galae-content/static/assets/galae.ico diff --git a/content/static/assets/img/damien-accorsi-algoo-galae.jpg b/galae-content/static/assets/img/damien-accorsi-algoo-galae.jpg similarity index 100% rename from content/static/assets/img/damien-accorsi-algoo-galae.jpg rename to galae-content/static/assets/img/damien-accorsi-algoo-galae.jpg diff --git a/content/static/assets/img/galae_logo.png b/galae-content/static/assets/img/galae_logo.png similarity index 100% rename from content/static/assets/img/galae_logo.png rename to galae-content/static/assets/img/galae_logo.png diff --git a/content/static/assets/img/galae_price_list_en.png b/galae-content/static/assets/img/galae_price_list_en.png similarity index 100% rename from content/static/assets/img/galae_price_list_en.png rename to galae-content/static/assets/img/galae_price_list_en.png diff --git a/content/static/assets/img/grille_tarifaire_galae_fr.png b/galae-content/static/assets/img/grille_tarifaire_galae_fr.png similarity index 100% rename from content/static/assets/img/grille_tarifaire_galae_fr.png rename to galae-content/static/assets/img/grille_tarifaire_galae_fr.png diff --git a/content/static/assets/img/lang-fr.svg b/galae-content/static/assets/img/lang-fr.svg similarity index 100% rename from content/static/assets/img/lang-fr.svg rename to galae-content/static/assets/img/lang-fr.svg diff --git a/content/static/assets/img/lang-gb.svg b/galae-content/static/assets/img/lang-gb.svg similarity index 100% rename from content/static/assets/img/lang-gb.svg rename to galae-content/static/assets/img/lang-gb.svg diff --git a/content/static/assets/img/liquid-cheese.svg b/galae-content/static/assets/img/liquid-cheese.svg similarity index 100% rename from content/static/assets/img/liquid-cheese.svg rename to galae-content/static/assets/img/liquid-cheese.svg diff --git a/content/static/assets/img/references/15-09-consulting.webp b/galae-content/static/assets/img/references/15-09-consulting.webp similarity index 100% rename from content/static/assets/img/references/15-09-consulting.webp rename to galae-content/static/assets/img/references/15-09-consulting.webp diff --git a/content/static/assets/img/references/apeiron-technology.webp b/galae-content/static/assets/img/references/apeiron-technology.webp similarity index 100% rename from content/static/assets/img/references/apeiron-technology.webp rename to galae-content/static/assets/img/references/apeiron-technology.webp diff --git a/content/static/assets/img/references/arundo-tech.webp b/galae-content/static/assets/img/references/arundo-tech.webp similarity index 100% rename from content/static/assets/img/references/arundo-tech.webp rename to galae-content/static/assets/img/references/arundo-tech.webp diff --git a/content/static/assets/img/references/association-la-granja.webp b/galae-content/static/assets/img/references/association-la-granja.webp similarity index 100% rename from content/static/assets/img/references/association-la-granja.webp rename to galae-content/static/assets/img/references/association-la-granja.webp diff --git a/content/static/assets/img/references/association-tostaky.webp b/galae-content/static/assets/img/references/association-tostaky.webp similarity index 100% rename from content/static/assets/img/references/association-tostaky.webp rename to galae-content/static/assets/img/references/association-tostaky.webp diff --git a/content/static/assets/img/references/astrolabe-cae.webp b/galae-content/static/assets/img/references/astrolabe-cae.webp similarity index 100% rename from content/static/assets/img/references/astrolabe-cae.webp rename to galae-content/static/assets/img/references/astrolabe-cae.webp diff --git a/content/static/assets/img/references/asvola.webp b/galae-content/static/assets/img/references/asvola.webp similarity index 100% rename from content/static/assets/img/references/asvola.webp rename to galae-content/static/assets/img/references/asvola.webp diff --git a/content/static/assets/img/references/back2data.webp b/galae-content/static/assets/img/references/back2data.webp similarity index 100% rename from content/static/assets/img/references/back2data.webp rename to galae-content/static/assets/img/references/back2data.webp diff --git a/content/static/assets/img/references/bag-era.webp b/galae-content/static/assets/img/references/bag-era.webp similarity index 100% rename from content/static/assets/img/references/bag-era.webp rename to galae-content/static/assets/img/references/bag-era.webp diff --git a/content/static/assets/img/references/cositrex.webp b/galae-content/static/assets/img/references/cositrex.webp similarity index 100% rename from content/static/assets/img/references/cositrex.webp rename to galae-content/static/assets/img/references/cositrex.webp diff --git a/content/static/assets/img/references/dembell.webp b/galae-content/static/assets/img/references/dembell.webp similarity index 100% rename from content/static/assets/img/references/dembell.webp rename to galae-content/static/assets/img/references/dembell.webp diff --git a/content/static/assets/img/references/domeo-conseils.webp b/galae-content/static/assets/img/references/domeo-conseils.webp similarity index 100% rename from content/static/assets/img/references/domeo-conseils.webp rename to galae-content/static/assets/img/references/domeo-conseils.webp diff --git a/content/static/assets/img/references/ecohameau-du-plessis.webp b/galae-content/static/assets/img/references/ecohameau-du-plessis.webp similarity index 100% rename from content/static/assets/img/references/ecohameau-du-plessis.webp rename to galae-content/static/assets/img/references/ecohameau-du-plessis.webp diff --git a/content/static/assets/img/references/educat.webp b/galae-content/static/assets/img/references/educat.webp similarity index 100% rename from content/static/assets/img/references/educat.webp rename to galae-content/static/assets/img/references/educat.webp diff --git a/content/static/assets/img/references/elycoop.webp b/galae-content/static/assets/img/references/elycoop.webp similarity index 100% rename from content/static/assets/img/references/elycoop.webp rename to galae-content/static/assets/img/references/elycoop.webp diff --git a/content/static/assets/img/references/ethicsys.webp b/galae-content/static/assets/img/references/ethicsys.webp similarity index 100% rename from content/static/assets/img/references/ethicsys.webp rename to galae-content/static/assets/img/references/ethicsys.webp diff --git a/content/static/assets/img/references/fc_home.webp b/galae-content/static/assets/img/references/fc_home.webp similarity index 100% rename from content/static/assets/img/references/fc_home.webp rename to galae-content/static/assets/img/references/fc_home.webp diff --git a/content/static/assets/img/references/keyox.webp b/galae-content/static/assets/img/references/keyox.webp similarity index 100% rename from content/static/assets/img/references/keyox.webp rename to galae-content/static/assets/img/references/keyox.webp diff --git a/content/static/assets/img/references/la-bataille-du-libre.webp b/galae-content/static/assets/img/references/la-bataille-du-libre.webp similarity index 100% rename from content/static/assets/img/references/la-bataille-du-libre.webp rename to galae-content/static/assets/img/references/la-bataille-du-libre.webp diff --git a/content/static/assets/img/references/le-mignon.webp b/galae-content/static/assets/img/references/le-mignon.webp similarity index 100% rename from content/static/assets/img/references/le-mignon.webp rename to galae-content/static/assets/img/references/le-mignon.webp diff --git a/content/static/assets/img/references/les-paysans-du-bocage.webp b/galae-content/static/assets/img/references/les-paysans-du-bocage.webp similarity index 100% rename from content/static/assets/img/references/les-paysans-du-bocage.webp rename to galae-content/static/assets/img/references/les-paysans-du-bocage.webp diff --git a/content/static/assets/img/references/manajet.webp b/galae-content/static/assets/img/references/manajet.webp similarity index 100% rename from content/static/assets/img/references/manajet.webp rename to galae-content/static/assets/img/references/manajet.webp diff --git a/content/static/assets/img/references/narm-pc.svg b/galae-content/static/assets/img/references/narm-pc.svg similarity index 100% rename from content/static/assets/img/references/narm-pc.svg rename to galae-content/static/assets/img/references/narm-pc.svg diff --git a/content/static/assets/img/references/oslandia.webp b/galae-content/static/assets/img/references/oslandia.webp similarity index 100% rename from content/static/assets/img/references/oslandia.webp rename to galae-content/static/assets/img/references/oslandia.webp diff --git a/content/static/assets/img/references/paquerette.webp b/galae-content/static/assets/img/references/paquerette.webp similarity index 100% rename from content/static/assets/img/references/paquerette.webp rename to galae-content/static/assets/img/references/paquerette.webp diff --git a/content/static/assets/img/references/pixngraph.webp b/galae-content/static/assets/img/references/pixngraph.webp similarity index 100% rename from content/static/assets/img/references/pixngraph.webp rename to galae-content/static/assets/img/references/pixngraph.webp diff --git a/content/static/assets/img/references/sempiternelia-humanites-numeriques.webp b/galae-content/static/assets/img/references/sempiternelia-humanites-numeriques.webp similarity index 100% rename from content/static/assets/img/references/sempiternelia-humanites-numeriques.webp rename to galae-content/static/assets/img/references/sempiternelia-humanites-numeriques.webp diff --git a/content/static/assets/img/references/spirale-coop.webp b/galae-content/static/assets/img/references/spirale-coop.webp similarity index 100% rename from content/static/assets/img/references/spirale-coop.webp rename to galae-content/static/assets/img/references/spirale-coop.webp diff --git a/content/static/assets/img/references/tele-mille-vaches.webp b/galae-content/static/assets/img/references/tele-mille-vaches.webp similarity index 100% rename from content/static/assets/img/references/tele-mille-vaches.webp rename to galae-content/static/assets/img/references/tele-mille-vaches.webp diff --git a/content/static/assets/img/references/ville-ayn.webp b/galae-content/static/assets/img/references/ville-ayn.webp similarity index 100% rename from content/static/assets/img/references/ville-ayn.webp rename to galae-content/static/assets/img/references/ville-ayn.webp diff --git a/content/static/assets/img/references/ville-dullin.webp b/galae-content/static/assets/img/references/ville-dullin.webp similarity index 100% rename from content/static/assets/img/references/ville-dullin.webp rename to galae-content/static/assets/img/references/ville-dullin.webp diff --git a/content/static/assets/img/testimonials-1.jpg b/galae-content/static/assets/img/testimonials-1.jpg similarity index 100% rename from content/static/assets/img/testimonials-1.jpg rename to galae-content/static/assets/img/testimonials-1.jpg diff --git a/content/static/assets/img/testimonials-2.jpg b/galae-content/static/assets/img/testimonials-2.jpg similarity index 100% rename from content/static/assets/img/testimonials-2.jpg rename to galae-content/static/assets/img/testimonials-2.jpg diff --git a/content/static/assets/img/testimonials-3.jpg b/galae-content/static/assets/img/testimonials-3.jpg similarity index 100% rename from content/static/assets/img/testimonials-3.jpg rename to galae-content/static/assets/img/testimonials-3.jpg diff --git a/content/static/assets/img/testimonials/court-bouillon--lucie-anglade.webp b/galae-content/static/assets/img/testimonials/court-bouillon--lucie-anglade.webp similarity index 100% rename from content/static/assets/img/testimonials/court-bouillon--lucie-anglade.webp rename to galae-content/static/assets/img/testimonials/court-bouillon--lucie-anglade.webp diff --git a/content/static/assets/img/testimonials/court-bouillon.webp b/galae-content/static/assets/img/testimonials/court-bouillon.webp similarity index 100% rename from content/static/assets/img/testimonials/court-bouillon.webp rename to galae-content/static/assets/img/testimonials/court-bouillon.webp diff --git a/content/static/assets/img/testimonials/ecohameau-du-plessis--mathieu-labonne.webp b/galae-content/static/assets/img/testimonials/ecohameau-du-plessis--mathieu-labonne.webp similarity index 100% rename from content/static/assets/img/testimonials/ecohameau-du-plessis--mathieu-labonne.webp rename to galae-content/static/assets/img/testimonials/ecohameau-du-plessis--mathieu-labonne.webp diff --git a/content/static/assets/img/testimonials/educ-at--dominique-hebert.webp b/galae-content/static/assets/img/testimonials/educ-at--dominique-hebert.webp similarity index 100% rename from content/static/assets/img/testimonials/educ-at--dominique-hebert.webp rename to galae-content/static/assets/img/testimonials/educ-at--dominique-hebert.webp diff --git a/content/static/assets/img/testimonials/f-tech-assistance--frederic-rosain.webp b/galae-content/static/assets/img/testimonials/f-tech-assistance--frederic-rosain.webp similarity index 100% rename from content/static/assets/img/testimonials/f-tech-assistance--frederic-rosain.webp rename to galae-content/static/assets/img/testimonials/f-tech-assistance--frederic-rosain.webp diff --git a/content/static/assets/img/testimonials/kevin-guerin.webp b/galae-content/static/assets/img/testimonials/kevin-guerin.webp similarity index 100% rename from content/static/assets/img/testimonials/kevin-guerin.webp rename to galae-content/static/assets/img/testimonials/kevin-guerin.webp diff --git a/content/static/assets/img/undraw_experts_re_i40h.svg b/galae-content/static/assets/img/undraw_experts_re_i40h.svg similarity index 100% rename from content/static/assets/img/undraw_experts_re_i40h.svg rename to galae-content/static/assets/img/undraw_experts_re_i40h.svg diff --git a/content/static/assets/img/undraw_futuristic_interface_re_0cm6.svg b/galae-content/static/assets/img/undraw_futuristic_interface_re_0cm6.svg similarity index 100% rename from content/static/assets/img/undraw_futuristic_interface_re_0cm6.svg rename to galae-content/static/assets/img/undraw_futuristic_interface_re_0cm6.svg diff --git a/content/static/assets/img/undraw_relaxation_re_ohkx.svg b/galae-content/static/assets/img/undraw_relaxation_re_ohkx.svg similarity index 100% rename from content/static/assets/img/undraw_relaxation_re_ohkx.svg rename to galae-content/static/assets/img/undraw_relaxation_re_ohkx.svg diff --git a/content/static/assets/logo-galae.svg b/galae-content/static/assets/logo-galae.svg similarity index 100% rename from content/static/assets/logo-galae.svg rename to galae-content/static/assets/logo-galae.svg diff --git a/content/static/css/custom.css b/galae-content/static/css/custom.css similarity index 100% rename from content/static/css/custom.css rename to galae-content/static/css/custom.css diff --git a/content/static/css/fonts.css b/galae-content/static/css/fonts.css similarity index 100% rename from content/static/css/fonts.css rename to galae-content/static/css/fonts.css diff --git a/content/static/css/styles.css b/galae-content/static/css/styles.css similarity index 100% rename from content/static/css/styles.css rename to galae-content/static/css/styles.css diff --git a/content/static/js/bootstrap.bundle.min.js b/galae-content/static/js/bootstrap.bundle.min.js similarity index 100% rename from content/static/js/bootstrap.bundle.min.js rename to galae-content/static/js/bootstrap.bundle.min.js diff --git a/content/static/js/scripts.js b/galae-content/static/js/scripts.js similarity index 100% rename from content/static/js/scripts.js rename to galae-content/static/js/scripts.js diff --git a/content/static/pygments/monokai.css b/galae-content/static/pygments/monokai.css similarity index 100% rename from content/static/pygments/monokai.css rename to galae-content/static/pygments/monokai.css diff --git a/jssg/jinja2.py b/jssg/jinja2.py index 417f32e..131072f 100644 --- a/jssg/jinja2.py +++ b/jssg/jinja2.py @@ -5,12 +5,24 @@ from jssg.templatetags.filter_opengraph_metadata import filter_opengraph_metadata +from jssg.models import Document +from django.conf import settings + +def url_from_slug(view_name, slug) : + for path in settings.JSSG_PAGES_DIR : + files = path.rglob("*.md") + for f in files : + doc = Document.load(f) + if doc.metadata["slug"] == slug : + return "/" / doc.path.relative_to(path).with_suffix('.html').parent / (doc.metadata["slug"] + ".html") + def environment(**options): env = Environment(**options) env.globals.update( { "static": static, "url": reverse, + "url_slug": url_from_slug, } ) env.filters.update( diff --git a/jssg/models.py b/jssg/models.py index 9c9d037..215661f 100644 --- a/jssg/models.py +++ b/jssg/models.py @@ -18,7 +18,7 @@ import typing from io import StringIO from pathlib import Path -from typing import Iterator, Mapping, Optional +from typing import Iterator, Mapping, Optional, List import markdown2 from django.conf import settings @@ -197,7 +197,7 @@ def load(cls, path: Path) -> "Document": @classmethod def load_glob( - cls, path: Optional[Path] = None, glob: str = "*.md" + cls, path: Optional[List[Path]] = None, dir = "", glob: str = "*.md", all=False ) -> Iterator["Document"]: """Load multiple document. @@ -210,8 +210,15 @@ def load_glob( if path is None: raise RuntimeError("No path and no self.BASE_DIR defined") - - return map(cls.load, path.glob(glob)) + + files = [] + for p in path : + if all : + files += (p / dir).rglob(glob) + else : + files += (p / dir).glob(glob) + print(files) + return map(cls.load, files) class Page(Document): @@ -232,16 +239,23 @@ def __init__(self, content: str, **metadata) -> None: except KeyError: self.slug = slugify(self.title) + p = self.path + while (p not in self.BASE_DIR) : + p = p.parent + self.dir = str(self.path.relative_to(p).parent) + if self.dir == '.' : + self.dir = '' + @classmethod - def load_page_with_slug(cls, slug: str) -> "Page": - return next(filter(lambda p: p.slug == slug, cls.load_glob())) + def load_page_with_slug(cls, slug: str, dir : str) -> "Page": + return next(filter(lambda p: p.slug == slug, cls.load_glob(dir = dir))) @classmethod def load_glob( - cls, path: Optional[Path] = None, glob: str = "*.md" + cls, path: Optional[List[Path]] = None, dir = "", glob: str = "*.md", all = False ) -> Iterator["Page"]: """Overridden only to make the static typing happy.""" - return super().load_glob(path, glob) + return super().load_glob(path, dir, glob, all) class Post(Page): @@ -258,9 +272,16 @@ def __init__(self, content: str, **metadata) -> None: super().__init__(content, **metadata) self.timestamp = datetime.datetime.fromisoformat(metadata["date"]) + p = self.path + while (p not in self.BASE_DIR) : + p = p.parent + self.dir = str(self.path.relative_to(p).parent) + if self.dir == '.' : + self.dir = '' + @classmethod def load_glob( - cls, path: Optional[Path] = None, glob: str = "*.md" + cls, path: Optional[List[Path]] = None, dir = "", glob: str = "*.md", all = False ) -> Iterator["Post"]: """Overridden only to make the static typing happy.""" - return super().load_glob(path, glob) + return super().load_glob(path, dir, glob, all) diff --git a/jssg/settings.py b/jssg/settings.py index 5791d61..2c18781 100644 --- a/jssg/settings.py +++ b/jssg/settings.py @@ -43,11 +43,13 @@ # JSSG -JSSG_CONTENT_DIR = BASE_DIR / "content" -JSSG_PAGES_DIR = JSSG_CONTENT_DIR / "pages" -JSSG_POSTS_DIR = JSSG_CONTENT_DIR / "posts" -JSSG_TEMPLATES_DIR = JSSG_CONTENT_DIR / "templates" -JSSG_STATIC_DIR = JSSG_CONTENT_DIR / "static" +JSSG_CONTENT_DIR = [BASE_DIR / "content"] + [Path.home() / "algoo" / "jssg" / "galae-content"] + [Path.home() / "algoo" / "jssg" / "common-content"] +JSSG_PAGES_DIR = [path / "pages" for path in JSSG_CONTENT_DIR] +JSSG_POSTS_DIR = [path / "posts" for path in JSSG_CONTENT_DIR] +JSSG_TEMPLATES_DIR = [path / "templates" for path in JSSG_CONTENT_DIR] +JSSG_STATIC_DIR = [path / "static" for path in JSSG_CONTENT_DIR] + + # Application definition @@ -71,7 +73,7 @@ TEMPLATES = [ { "BACKEND": "django.template.backends.jinja2.Jinja2", - "DIRS": [JSSG_TEMPLATES_DIR / "jinja"], + "DIRS": [path / "jinja2" for path in JSSG_TEMPLATES_DIR], "APP_DIRS": True, "OPTIONS": { "environment": "jssg.jinja2.environment" @@ -79,7 +81,7 @@ }, { "BACKEND": "django.template.backends.django.DjangoTemplates", - "DIRS": [JSSG_TEMPLATES_DIR / "django"], + "DIRS": [path / "django" for path in JSSG_TEMPLATES_DIR], "APP_DIRS": True, "OPTIONS": { "context_processors": [ @@ -136,7 +138,7 @@ DIST_DIR = BASE_DIR / "dist" STATIC_ROOT = BASE_DIR / "static" -STATICFILES_DIRS = [JSSG_STATIC_DIR] +STATICFILES_DIRS = JSSG_STATIC_DIR # Default primary key field type # https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field diff --git a/jssg/urls.py b/jssg/urls.py index 98032f3..bc957e1 100644 --- a/jssg/urls.py +++ b/jssg/urls.py @@ -12,35 +12,36 @@ # # You should have received a copy of the GNU General Public License along with # this program. If not, see . -from django_distill import distill_path +from django_distill import distill_path, distill_re_path from jssg import views from jssg.models import Page, Post def get_pages(): - return ({"slug": p.slug} for p in Page.load_glob()) - + return ({"dir":p.dir, "slug": p.slug} for p in Page.load_glob(all = True)) def get_posts(): return ({"slug": p.slug} for p in Post.load_glob()) +# print([p for p in get_pages()]) +# print([p for p in get_p()]) urlpatterns = [ distill_path( "", views.IndexView.as_view(), name="index", distill_file="index.html" ), distill_path("atom.xml", views.PostFeedsView(), name="atom_feed"), - distill_path( - "pages/.html", - views.PageView.as_view(), - name="page", - distill_func=get_pages, - ), distill_path( "posts/.html", views.PostView.as_view(), name="post", distill_func=get_posts, ), + distill_re_path( + r'^(?P[a-zA-z0-9-/]*)/(?P[a-zA-z0-9-/]+).html', + views.PageView.as_view(), + name="page", + distill_func=get_pages, + ), ] diff --git a/jssg/views.py b/jssg/views.py index 7385d1f..8986fa1 100644 --- a/jssg/views.py +++ b/jssg/views.py @@ -13,7 +13,7 @@ # You should have received a copy of the GNU General Public License along with # this program. If not, see . -from typing import Any +from typing import Any, List from django.contrib.syndication.views import Feed from django.db.models.base import Model as Model @@ -30,7 +30,7 @@ class PostFeedsView(Feed): link = "" feed_type = Atom1Feed - def items(self) -> list[Post]: + def items(self) -> List[Post]: return sorted(Post.load_glob(), key=lambda p: p.timestamp, reverse=True)[:20] def item_title(self, post: Post) -> str: @@ -51,8 +51,11 @@ class PageView(DetailView): template_name = "page.html" def get_object(self, queryset=None) -> Model: + if "dir" not in self.kwargs.keys() : + self.kwargs["dir"] = "" + print(self.kwargs["dir"]) print(self.kwargs["slug"]) - model = self.model.load_page_with_slug(self.kwargs["slug"]) + model = self.model.load_page_with_slug(self.kwargs["slug"], self.kwargs["dir"]) return model @@ -61,7 +64,8 @@ class IndexView(PageView): template_name = "page.html" def get_object(self, queryset=None) -> Model: - self.kwargs["slug"] = "fr-index" + self.kwargs["dir"] = "en" + self.kwargs["slug"] = "en-index" return super().get_object(queryset)