diff --git a/common-content/templates/jinja2/blocks/en/header.html b/common-content/templates/jinja2/blocks/en/header.html deleted file mode 100644 index 4e72697..0000000 --- a/common-content/templates/jinja2/blocks/en/header.html +++ /dev/null @@ -1,6 +0,0 @@ -{% from "widgets/page_header.html" import page_header%} - -{{ page_header( - PRIMARY_TITLE = "galae - the free, ethical, pay-per-use e-mail service", - SECONDARY_TITLE = "Standard, interoperable e-mails and a service entirely based on self-hosting ready technologies", -) }} \ No newline at end of file diff --git a/common-content/templates/jinja2/blocks/fr/header.html b/common-content/templates/jinja2/blocks/fr/header.html deleted file mode 100644 index 0b60efa..0000000 --- a/common-content/templates/jinja2/blocks/fr/header.html +++ /dev/null @@ -1,6 +0,0 @@ -{% from "widgets/page_header.html" import 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 !" -) }} \ No newline at end of file diff --git a/content/templates/django/blocks/footer.en.html b/content/templates/django/blocks/footer.en.html deleted file mode 100644 index 7c279bf..0000000 --- a/content/templates/django/blocks/footer.en.html +++ /dev/null @@ -1,77 +0,0 @@ - \ No newline at end of file diff --git a/content/templates/django/blocks/footer.fr.html b/content/templates/django/blocks/footer.fr.html deleted file mode 100644 index 2cc28c4..0000000 --- a/content/templates/django/blocks/footer.fr.html +++ /dev/null @@ -1,78 +0,0 @@ - diff --git a/content/templates/django/blocks/header.en.html b/content/templates/django/blocks/header.en.html deleted file mode 100644 index 79eb2c8..0000000 --- a/content/templates/django/blocks/header.en.html +++ /dev/null @@ -1,6 +0,0 @@ -{% include "widgets/page_header.html" - with PRIMARY_TITLE="galae - the free, ethical, pay-per-use e-mail service" - 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/django/blocks/header.fr.html b/content/templates/django/blocks/header.fr.html deleted file mode 100644 index eaa9ef5..0000000 --- a/content/templates/django/blocks/header.fr.html +++ /dev/null @@ -1,6 +0,0 @@ -{% include "widgets/page_header.html" - with 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/django/post.html b/content/templates/django/post.html deleted file mode 100644 index c3e60f3..0000000 --- a/content/templates/django/post.html +++ /dev/null @@ -1,8 +0,0 @@ -{% extends "base.html" %} - -{% block "content" %} -Publié le {{ object.timestamp|date:"Y-m-d" }}. - -

{{ object.title }}

-{{ object.content_md|safe }} -{% endblock %} diff --git a/content/templates/django/widgets/navbar.html b/content/templates/django/widgets/navbar.html deleted file mode 100644 index 08e6279..0000000 --- a/content/templates/django/widgets/navbar.html +++ /dev/null @@ -1,19 +0,0 @@ -{% load static %} - - - \ No newline at end of file diff --git a/content/templates/django/widgets/page_block_h2_with_content_and_primary_secondary_cta.html b/content/templates/django/widgets/page_block_h2_with_content_and_primary_secondary_cta.html deleted file mode 100644 index 9246c8b..0000000 --- a/content/templates/django/widgets/page_block_h2_with_content_and_primary_secondary_cta.html +++ /dev/null @@ -1,32 +0,0 @@ -{% load static %} - -
-
-

{{ TITLE }}

-
- -
-
-
\ No newline at end of file diff --git a/content/templates/django/widgets/page_block_h2_with_content_dark_background_no_cta.html b/content/templates/django/widgets/page_block_h2_with_content_dark_background_no_cta.html deleted file mode 100644 index 3b19e46..0000000 --- a/content/templates/django/widgets/page_block_h2_with_content_dark_background_no_cta.html +++ /dev/null @@ -1,10 +0,0 @@ -
-
-

{{ TITLE }}

-
-
- {{ CONTENT }} -
-
-
-
\ No newline at end of file diff --git a/content/templates/django/widgets/page_block_h2_with_ul_content_and_image_left.html b/content/templates/django/widgets/page_block_h2_with_ul_content_and_image_left.html deleted file mode 100644 index 3356b5e..0000000 --- a/content/templates/django/widgets/page_block_h2_with_ul_content_and_image_left.html +++ /dev/null @@ -1,16 +0,0 @@ -{% load static %} - -
-
-
-
-
-
-

{{ TITLE }}

-

-

-

-

{{ CTA_LABEL }}

-
-
diff --git a/content/templates/django/widgets/page_block_h2_with_ul_content_and_image_right.html b/content/templates/django/widgets/page_block_h2_with_ul_content_and_image_right.html deleted file mode 100644 index 57c6d0a..0000000 --- a/content/templates/django/widgets/page_block_h2_with_ul_content_and_image_right.html +++ /dev/null @@ -1,16 +0,0 @@ -{% load static %} - -
-
-
-
-
-
-

{{ TITLE }}

-

-

-

-

{{ CTA_LABEL }}

-
-
\ No newline at end of file diff --git a/content/templates/django/widgets/page_header.html b/content/templates/django/widgets/page_header.html deleted file mode 100644 index f1cfa27..0000000 --- a/content/templates/django/widgets/page_header.html +++ /dev/null @@ -1,21 +0,0 @@ - -
-
-
-
-
- -

- {{ PRIMARY_TITLE|safe }} -

- {% if SECONDARY_TITLE %} -

{{ SECONDARY_TITLE|safe }}

- {% endif %} - {% if THIRD_TITLE %} - - {% endif %} -
-
-
-
-
\ No newline at end of file diff --git a/content/templates/django/widgets/page_section_main_cta.html b/content/templates/django/widgets/page_section_main_cta.html deleted file mode 100644 index d7463bf..0000000 --- a/content/templates/django/widgets/page_section_main_cta.html +++ /dev/null @@ -1,20 +0,0 @@ - -
-
-
-
-

- {{ TITLE }} -

- {{ SUBTITLE }} -
-
-
-
-

- {{ SECONDARY_TITLE }} -

-
-
-
-
\ No newline at end of file diff --git a/content/templates/django/widgets/page_section_reference_logos.html b/content/templates/django/widgets/page_section_reference_logos.html deleted file mode 100644 index 5ab6d54..0000000 --- a/content/templates/django/widgets/page_section_reference_logos.html +++ /dev/null @@ -1,15 +0,0 @@ -{% load static %} - - -
-
-
-
- {% for reference in REFERENCES %} - ils utilisent le service email galae: {{ reference.name }} - {% endfor %} -
-
-
-
\ No newline at end of file diff --git a/content/templates/django/widgets/testimonials.html b/content/templates/django/widgets/testimonials.html deleted file mode 100644 index 6a9d1bf..0000000 --- a/content/templates/django/widgets/testimonials.html +++ /dev/null @@ -1,23 +0,0 @@ -{% load static %} - - -
-
-

Ce qu'en disent nos clients ...

-
- {% for reference in PERSONS %} -
-
- -
{{reference.name}}
-
{{reference.fonction}}
-

- « {{reference.testimonial}} » -

-
-
- {% endfor %} - -
-
-
\ No newline at end of file diff --git a/content/templates/jinja2/base.html b/content/templates/jinja2/base.html index f770cbd..412eb63 100644 --- a/content/templates/jinja2/base.html +++ b/content/templates/jinja2/base.html @@ -1,5 +1,5 @@ {% from "blocks/block.html" import block %} - +{% from "widgets/page_header.html" import page_header %} @@ -34,10 +34,10 @@ ) }}
- {{ block( - NAME = "header", - VERSION = object.metadata.header_version|default(object.metadata.lang)|default(""), - DEFAULT_NAME = "fr/header.html" + {{ page_header( + PRIMARY_TITLE = object.metadata.page_header_h1|default(""), + SECONDARY_TITLE = object.metadata.page_header_h2|default(""), + THIRD_TITLE = object.metadata.page_header_h3|default("") ) }}
diff --git a/content/templates/jinja2/page.html b/content/templates/jinja2/page.html index f155370..d829a40 100644 --- a/content/templates/jinja2/page.html +++ b/content/templates/jinja2/page.html @@ -1,2 +1,2 @@ {% extends "base.html" %} -{% block content %}{{ object.content_md|safe }}{% endblock %} +{% block content %}{{ object.content|safe }}{% endblock %} diff --git a/content/templates/jinja2/post.html b/content/templates/jinja2/post.html index 1bf8c69..804119a 100644 --- a/content/templates/jinja2/post.html +++ b/content/templates/jinja2/post.html @@ -4,5 +4,5 @@ Publié le {{ object.timestamp.strftime("%Y-%m-%d") }}.

{{ object.title }}

-{{ object.content_md|safe }} +{{ object.content|safe }} {% endblock %} diff --git a/galae-content/pages/en-index.md b/galae-content/pages/en-index.md index 5ea1af8..0aa0457 100644 --- a/galae-content/pages/en-index.md +++ b/galae-content/pages/en-index.md @@ -1,11 +1,15 @@ --- METADATA (first) --- -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 -version .en + +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 template_engine jinja2 + +page_header_h1 galae - the free, ethical, pay-per-use e-mail service +page_header_h2 Standard, interoperable e-mails and a service entirely based on self-hosting ready technologies + # open graph metatada og:title galae - ethical and free pay-per-use e-mail 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/galae-content/pages/fr-index.md b/galae-content/pages/fr-index.md index 2d7fd01..a0313e9 100644 --- a/galae-content/pages/fr-index.md +++ b/galae-content/pages/fr-index.md @@ -1,11 +1,15 @@ --- METADATA (first) --- -title galae - le service e-mail éthique et libre facturé à l'usage -slug fr-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 +title galae - le service e-mail éthique et libre facturé à l'usage +slug fr-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 template_engine jinja2 -version .fr + +page_header_h1 le service e-mail éthique et libre facturé à l'usage +page_header_h2 pour des e-mails standards et interopérables et un service intégralement basé sur des technologies auto-hébergeables +page_header_h3 Le service est désormais ouvert ! + # 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/galae-content/pages/generateur-enregistrements-dns.md b/galae-content/pages/generateur-enregistrements-dns.md index da462cb..a776c70 100644 --- a/galae-content/pages/generateur-enregistrements-dns.md +++ b/galae-content/pages/generateur-enregistrements-dns.md @@ -1,11 +1,12 @@ --- -title generateur-enregistrements-dns -description galae est un service e-mail éthique et libre facturé à l'usage. Toutes nos offres incluent des boîtes e-mails et domaines illimités hébergés en France. -slug generateur-enregistrements-dns -language French -lang fr +title generateur-enregistrements-dns +description galae est un service e-mail éthique et libre facturé à l'usage. Toutes nos offres incluent des boîtes e-mails et domaines illimités hébergés en France. +slug generateur-enregistrements-dns +language French +lang fr template_engine jinja2 -header_version genenrdns + +page_header_h1 Générez les enregistrements DNS de vos domaines og:title galae - le service e-mail éthique et libre facturé à l'usage og:description Cette page vous aide à générer les enregistrements DNS pour vos noms de domaines @@ -27,6 +28,40 @@ og:locale fr
+ +
+
+
+

+ Saisissez votre nom de domaine + + + + +
+
+
+
+
+ + Continuer +
+
+
+

+
+
+
+
diff --git a/galae-content/pages/temoignages-clients.md b/galae-content/pages/temoignages-clients.md index 09bd036..3fa259d 100644 --- a/galae-content/pages/temoignages-clients.md +++ b/galae-content/pages/temoignages-clients.md @@ -1,10 +1,10 @@ --- -title Temoignages clients -slug temoignages-clients -lang fr +title Temoignages clients +slug temoignages-clients +lang fr template_engine jinja2 -header_version testimonial +page_header_h1 Nos clients témoignent ... --- { diff --git a/galae-content/templates/jinja2/blocks/genenrdns/header.html b/galae-content/templates/jinja2/blocks/genenrdns/header.html deleted file mode 100644 index d48f857..0000000 --- a/galae-content/templates/jinja2/blocks/genenrdns/header.html +++ /dev/null @@ -1,46 +0,0 @@ -
-
-
-
-
- -

- Générez les enregistrements DNS de vos domaines -

-
-
-
- -

- Saisissez votre nom de domaine - - - - -
-
-
-
-
- - Continuer -
-
-
-

-
- - -
-
-
- \ No newline at end of file diff --git a/galae-content/templates/jinja2/blocks/testimonial/header.html b/galae-content/templates/jinja2/blocks/testimonial/header.html deleted file mode 100644 index 0c8c929..0000000 --- a/galae-content/templates/jinja2/blocks/testimonial/header.html +++ /dev/null @@ -1,4 +0,0 @@ -{% from "widgets/page_header.html" import page_header%} -{{ page_header ( - PRIMARY_TITLE = "Nos clients témoignent ...", -) }} \ No newline at end of file diff --git a/jssg/models.py b/jssg/models.py index f27d1b3..9498ed8 100644 --- a/jssg/models.py +++ b/jssg/models.py @@ -44,13 +44,13 @@ def __init__(self, content: str, **metadata: Mapping[str, str]) -> None: :param content: The content (body) of the document :param metadata: Associated metadata """ - self.content = content + self.body = content self.metadata = dict(metadata) self.path = metadata["path"] self.data = {} @property - def content_md(self) -> str: + def content(self) -> str: """Render the content as markdown to html. Note: the content will be processed by the django template engine @@ -68,9 +68,6 @@ def content_md(self) -> str: # multiline text # easy to read" # }}} - def convert_case(match_obj): - return match_obj.group(2).replace("\n", " ") - self.content = re.sub("({{{TO-1-LINE)(((?!TO-1-LINE}}}).)*)(TO-1-LINE}}})", convert_case, self.content, flags=re.DOTALL) # INFO - D.A. - Original code is below and is returned a markdown-based processed content # this works only with unindented HTML templates because markdown interprets indentation @@ -78,7 +75,7 @@ def convert_case(match_obj): # Expected: allow to process both HTML and markdown content types # # return markdown2.markdown( - # Template(self.content).render( + # Template(self.body).render( # Context( # { # "posts": sorted( @@ -91,6 +88,7 @@ def convert_case(match_obj): # extras=["fenced-code-blocks", "tables"], # ) + if "template_engine" in self.metadata.keys() and self.metadata["template_engine"] == "django" : return Template(self.content).render( Context( diff --git a/jssg/views.py b/jssg/views.py index e58963e..ead7530 100644 --- a/jssg/views.py +++ b/jssg/views.py @@ -37,7 +37,7 @@ def item_title(self, post: Post) -> str: return post.title def item_description(self, item: Post): - return item.content_md + return item.content def item_link(self, post: Post) -> str: return reverse("post", args=(post.slug,))