From a465fdfe69dd52eed3a6a1ec38e83fabe070838b Mon Sep 17 00:00:00 2001 From: Adrien Beudin Date: Fri, 4 Nov 2016 12:55:02 +0100 Subject: [PATCH 01/12] add support of Open Graph --- .../themes/exposure/templates/base.html | 58 +++-- .../themes/exposure/templates/example.html | 110 +++++----- prosopopee/themes/exposure/templates/feed.xml | 20 +- .../themes/exposure/templates/footer.html | 11 +- .../exposure/templates/gallery-index.html | 203 +++++++++--------- .../themes/exposure/templates/index.html | 90 ++++---- .../themes/exposure/templates/item.html | 23 +- .../themes/exposure/templates/menu.html | 14 +- .../themes/exposure/templates/opengraph.html | 13 ++ .../exposure/templates/page-example.html | 156 +++++++------- .../themes/exposure/templates/page.html | 14 +- .../exposure/templates/sections/author.html | 58 ++--- .../templates/sections/bordered-picture.html | 98 +++++---- .../templates/sections/full-picture.html | 90 ++++---- .../exposure/templates/sections/html.html | 12 +- .../exposure/templates/sections/panorama.html | 2 +- .../templates/sections/paragraph.html | 20 +- .../templates/sections/pictures-group.html | 95 ++++---- .../exposure/templates/sections/text.html | 14 +- .../themes/exposure/templates/share.html | 16 +- .../themes/light/templates/gallery-index.html | 66 +++--- .../themes/light/templates/opengraph.html | 13 ++ .../material/templates/gallery-index.html | 194 +++++++++-------- .../themes/material/templates/opengraph.html | 13 ++ 24 files changed, 709 insertions(+), 694 deletions(-) create mode 100644 prosopopee/themes/exposure/templates/opengraph.html create mode 100644 prosopopee/themes/light/templates/opengraph.html create mode 100644 prosopopee/themes/material/templates/opengraph.html diff --git a/prosopopee/themes/exposure/templates/base.html b/prosopopee/themes/exposure/templates/base.html index 3f11aa9..7197ebd 100644 --- a/prosopopee/themes/exposure/templates/base.html +++ b/prosopopee/themes/exposure/templates/base.html @@ -1,35 +1,29 @@ - - - {% block css %} - {% endblock %} - {% if settings.rss -%} - - {% endif -%} - - - {{ settings.title }} - - - - - - - - {% block content %} - {% endblock %} - - {% include 'footer.html' %} - - + + + {% block css %} + {% endblock %} + {% if settings.rss %} + + {% endif %} + + + {{ settings.title }} + + + + {% block content %} + {% endblock %} + {% include 'footer.html' %} + diff --git a/prosopopee/themes/exposure/templates/example.html b/prosopopee/themes/exposure/templates/example.html index 3d0b3f8..987ea09 100644 --- a/prosopopee/themes/exposure/templates/example.html +++ b/prosopopee/themes/exposure/templates/example.html @@ -1,74 +1,74 @@ - - - + + + - - - + + + - + - -
+ +
-

.

+

.

- + diff --git a/prosopopee/themes/exposure/templates/feed.xml b/prosopopee/themes/exposure/templates/feed.xml index 8bc193c..cecd1af 100644 --- a/prosopopee/themes/exposure/templates/feed.xml +++ b/prosopopee/themes/exposure/templates/feed.xml @@ -1,13 +1,13 @@ - - {{ settings.title }} - {{ settings.sub_title }} - {{ settings.url }} - - {% for gallery in galleries %} - {% set absolute_url = settings.url + "/" %} - {% include "item.html" %} - {% endfor %} - + + {{ settings.title }} + {{ settings.sub_title }} + {{ settings.url }} + + {% for gallery in galleries %} + {% set absolute_url = settings.url + "/" %} + {% include "item.html" %} + {% endfor %} + diff --git a/prosopopee/themes/exposure/templates/footer.html b/prosopopee/themes/exposure/templates/footer.html index 96451fe..295d26a 100644 --- a/prosopopee/themes/exposure/templates/footer.html +++ b/prosopopee/themes/exposure/templates/footer.html @@ -1,11 +1,10 @@ {% if settings.licence is not defined %} -{% set licence_url = 'https://creativecommons.org/licenses/by-sa/3.0/' -%} -{% set licence_name = 'CC-BY-SA' -%} +{% set licence_url = 'https://creativecommons.org/licenses/by-sa/3.0/' %} +{% set licence_name = 'CC-BY-SA' %} {% else %} -{% set licence_url = settings.licence.url -%} -{% set licence_name = settings.licence.name -%} +{% set licence_url = settings.licence.url %} +{% set licence_name = settings.licence.name %} {% endif %} - diff --git a/prosopopee/themes/exposure/templates/gallery-index.html b/prosopopee/themes/exposure/templates/gallery-index.html index 9406c61..71cc3f9 100644 --- a/prosopopee/themes/exposure/templates/gallery-index.html +++ b/prosopopee/themes/exposure/templates/gallery-index.html @@ -1,132 +1,127 @@ - - - - - - - - - - - {% if gallery.description %} - - {% endif %} - {% if gallery.lang %} - - {% endif %} - {{ gallery.title }} · {{ settings.title }} - - - - {% for section in gallery.sections %} - {% include "sections/" + section.type + ".html" %} - {% endfor %} - - {% if settings.share %} - {% include "share.html" %} - {% endif %} - -
-
- - - + + + + + + + + + + {% if gallery.description %} + + {% endif %} + {% if gallery.lang %} + + {% endif %} + {% if settings.settings.og %} + {% include "opengraph.html" %} + {% endif %} + {{ gallery.title }} · {{ settings.title }} + + + {% for section in gallery.sections %} + {% include "sections/" + section.type + ".html" %} + {% endfor %} + {% if settings.share %} + {% include "share.html" %} + {% endif %} +
+
+ + - - - - - - - + + + + + - - {% include "footer.html" %} - - + + {% include "footer.html" %} + diff --git a/prosopopee/themes/exposure/templates/index.html b/prosopopee/themes/exposure/templates/index.html index 28d5541..74409a4 100644 --- a/prosopopee/themes/exposure/templates/index.html +++ b/prosopopee/themes/exposure/templates/index.html @@ -1,57 +1,57 @@ {% extends "base.html" %} {% block css %} - - + + {% endblock %} {% block logo %} - {% if sub_index %} -
-
-
- - +{% if sub_index %} + +{% else %} + +{% endif %} {% endblock %} {% block content %} -
- {% for galleries_line in galleries|reverse|batch(3)|reverse %} -
- {% for gallery in galleries_line|reverse %}{% endfor %} +
+ {% for galleries_line in galleries|reverse|batch(3)|reverse %} +
+ {% for gallery in galleries_line|reverse %} -

.

+
+ {% if gallery.cover_type == "video" %} + {% set video = Video(gallery.cover) %} + {{ video.copy() }} + + {% else %} + {% set cover = Image(gallery.cover) %} + {{ cover.copy() }} + + {% endif %} +
{% endfor %} +
+ {% endfor %} +
+

.

{% endblock %} diff --git a/prosopopee/themes/exposure/templates/item.html b/prosopopee/themes/exposure/templates/item.html index 7696dd4..0109eb1 100644 --- a/prosopopee/themes/exposure/templates/item.html +++ b/prosopopee/themes/exposure/templates/item.html @@ -1,16 +1,15 @@ -{% set absolute_url = absolute_url+ gallery.link+"/" -%} +{% set absolute_url = absolute_url+ gallery.link+"/" %} - {{ gallery.title }} - {{ absolute_url }} - {{ gallery.link }} - {% if gallery.sub_title -%} - {{ gallery.sub_title }} - {% endif -%} - {{ gallery.date }} +{{ gallery.title }} +{{ absolute_url }} +{{ gallery.link }} +{% if gallery.sub_title %} +{{ gallery.sub_title }} +{% endif -%} +{{ gallery.date }} {% for sub_gallery in gallery.sub_gallery %} - {% with gallery=sub_gallery %} - {% include "item.html" %} - {% endwith %} +{% with gallery=sub_gallery %} +{% include "item.html" %} +{% endwith %} {% endfor %} - diff --git a/prosopopee/themes/exposure/templates/menu.html b/prosopopee/themes/exposure/templates/menu.html index f871b84..25f1362 100644 --- a/prosopopee/themes/exposure/templates/menu.html +++ b/prosopopee/themes/exposure/templates/menu.html @@ -1,19 +1,19 @@ diff --git a/prosopopee/themes/exposure/templates/opengraph.html b/prosopopee/themes/exposure/templates/opengraph.html new file mode 100644 index 0000000..fbcbb89 --- /dev/null +++ b/prosopopee/themes/exposure/templates/opengraph.html @@ -0,0 +1,13 @@ + + + +{% if gallery.description %} + +{% endif %} + + +{% if gallery.tags %} +{% for tag in gallery.tags %} + +{% endfor %} +{% endif %} diff --git a/prosopopee/themes/exposure/templates/page-example.html b/prosopopee/themes/exposure/templates/page-example.html index bf04078..1c8274c 100644 --- a/prosopopee/themes/exposure/templates/page-example.html +++ b/prosopopee/themes/exposure/templates/page-example.html @@ -1,103 +1,103 @@ - - - - - + + + + + - - - + + + - +
-
-
-

Some title on the picture

-

Some subtitle

-
march 3th 2015
-
+
+
+

Some title on the picture

+

Some subtitle

+
march 3th 2015
+
- - - + + +
-
-
- - - -
-
-
- - - -
-
-
- - - -
+
+ -
-
- - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
+
+ +
+
+ + + +
+
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
- - - -
+ + + - +
+ diff --git a/prosopopee/themes/exposure/templates/page.html b/prosopopee/themes/exposure/templates/page.html index 71e8757..cf5ffc9 100644 --- a/prosopopee/themes/exposure/templates/page.html +++ b/prosopopee/themes/exposure/templates/page.html @@ -1,32 +1,26 @@ {% extends "base.html" %} - {% block css %} {% endblock %} - {% block logo %} {% endblock %} - {% block content %}

{{ gallery.title }}

- {% for section in gallery.sections %} - {% include "sections/" + section.type + ".html" %} +{% include "sections/" + section.type + ".html" %} {% endfor %} - - {% endblock %} diff --git a/prosopopee/themes/exposure/templates/sections/author.html b/prosopopee/themes/exposure/templates/sections/author.html index e38e196..ee0d870 100644 --- a/prosopopee/themes/exposure/templates/sections/author.html +++ b/prosopopee/themes/exposure/templates/sections/author.html @@ -1,33 +1,33 @@ {% set image = Image(section.image) %} {{ image.copy() }}
- -
- Story by -

{{ section.name }}

- {% if section.text %} -
{{ section.text }}
- {% endif %} -
-
-
-
- {% if section.twitter %} - - Twitter - - | - {% endif %} - {% if section.facebook %} - - Facebook - - | - {% endif %} - {% if section.website %} - - {{ section.website }} - - {% endif %} -
+ +
+ Story by +

{{ section.name }}

+ {% if section.text %} +
{{ section.text }}
+ {% endif %} +
+
+
+
+ {% if section.twitter %} + + Twitter + + | + {% endif %} + {% if section.facebook %} + + Facebook + + | + {% endif %} + {% if section.website %} + + {{ section.website }} + + {% endif %} +
diff --git a/prosopopee/themes/exposure/templates/sections/bordered-picture.html b/prosopopee/themes/exposure/templates/sections/bordered-picture.html index cc70590..2db4a2b 100644 --- a/prosopopee/themes/exposure/templates/sections/bordered-picture.html +++ b/prosopopee/themes/exposure/templates/sections/bordered-picture.html @@ -1,53 +1,51 @@ {% if section.background %} -
-{% endif %} - -{% if section.image.type == "video" %} - {% set video = Video(section.image) %} - {% set caption = section.text %} - {{ video.copy() }} -
-
- - - {% if caption %} -
-
{{ caption }}
-
- {% endif %} -
-
-{% else %} - {% set image = Image(section.image) %} - {% set caption = section.text %} - {{ image.copy() }} -
- -
-{% endif %} - -{% if section.background %} +
+ {% endif %} + {% if section.image.type == "video" %} + {% set video = Video(section.image) %} + {% set caption = section.text %} + {{ video.copy() }} +
+
+ + + {% if caption %} +
+
{{ caption }}
+
+ {% endif %}
+
+ {% else %} + {% set image = Image(section.image) %} + {% set caption = section.text %} + {{ image.copy() }} +
+ +
+ {% endif %} + {% if section.background %} +
{% endif %} diff --git a/prosopopee/themes/exposure/templates/sections/full-picture.html b/prosopopee/themes/exposure/templates/sections/full-picture.html index dfb5467..656d44d 100644 --- a/prosopopee/themes/exposure/templates/sections/full-picture.html +++ b/prosopopee/themes/exposure/templates/sections/full-picture.html @@ -1,53 +1,45 @@ {% if section.image.type == "video" %} - {% set video = Video(section.image) %} - {{ video.copy() }} - -
-
- {% if section.text %} -
-
-

{{ section.text.title }}

-

{{ section.text.sub_title }}

- {% if section.text.date_end %} -
{{ section.text.date.strftime("%d %B %Y") }} to {{ section.text.date_end.strftime("%d %B %Y") }}
- {% else %} - {% if section.text.date %} -
{{ section.text.date.strftime("%d %B %Y") }}
{% endif %} - {% endif %} -
-
- {% endif %} - - - - - -
-
- -{% else %} - {% set image = Image(section.image) %} - {{ image.copy() }} - -
- +{% set video = Video(section.image) %} +{{ video.copy() }} +
+
{% if section.text %} -
-
-

{{ section.text.title }}

-

{{ section.text.sub_title }}

- {% if section.text.date_end %} -
{{ section.text.date.strftime("%d %B %Y") }} to {{ section.text.date_end.strftime("%d %B %Y") }}
- {% else %} - {% if section.text.date %} -
{{ section.text.date.strftime("%d %B %Y") }}
{% endif %} - {% endif %} -
-
+
+
+

{{ section.text.title }}

+

{{ section.text.sub_title }}

+ {% if section.text.date_end %} +
{{ section.text.date.strftime("%d %B %Y") }} to {{ section.text.date_end.strftime("%d %B %Y") }}
+ {% else %} + {% if section.text.date %} +
{{ section.text.date.strftime("%d %B %Y") }}
{% endif %} + {% endif %} +
+
{% endif %} - -
+ + +
+ +{% else %} +{% set image = Image(section.image) %} +{{ image.copy() }} +
+ {% if section.text %} +
+
+

{{ section.text.title }}

+

{{ section.text.sub_title }}

+ {% if section.text.date_end %} +
{{ section.text.date.strftime("%d %B %Y") }} to {{ section.text.date_end.strftime("%d %B %Y") }}
+ {% else %} + {% if section.text.date %} +
{{ section.text.date.strftime("%d %B %Y") }}
{% endif %} + {% endif %} +
+
+ {% endif %} +
{% endif %} diff --git a/prosopopee/themes/exposure/templates/sections/html.html b/prosopopee/themes/exposure/templates/sections/html.html index 8bd5a39..31f2851 100644 --- a/prosopopee/themes/exposure/templates/sections/html.html +++ b/prosopopee/themes/exposure/templates/sections/html.html @@ -1,11 +1,11 @@ {% if section.background or section.color %} -
-{% endif %} -
+
+ {% endif %} +
- {{ section.html }} + {{ section.html }}
-
-{% if section.background or section.color %} +
+ {% if section.background or section.color %}
{% endif %} diff --git a/prosopopee/themes/exposure/templates/sections/panorama.html b/prosopopee/themes/exposure/templates/sections/panorama.html index a9e2767..e019744 100644 --- a/prosopopee/themes/exposure/templates/sections/panorama.html +++ b/prosopopee/themes/exposure/templates/sections/panorama.html @@ -1,5 +1,5 @@ {% set image = Image(section.image) %} {{ image.copy() }}
- +
diff --git a/prosopopee/themes/exposure/templates/sections/paragraph.html b/prosopopee/themes/exposure/templates/sections/paragraph.html index 8c9aba1..c870afe 100644 --- a/prosopopee/themes/exposure/templates/sections/paragraph.html +++ b/prosopopee/themes/exposure/templates/sections/paragraph.html @@ -1,18 +1,14 @@ {% if section.background or section.color %} -
-{% endif %} - -
- +
+ {% endif %} +
{% if section.title %} -

{{ section.title }}

+

{{ section.title }}

{% else %} -
+
{% endif %} -

{{ section.text }}

-
- -{% if section.background or section.color %} -
+
+ {% if section.background or section.color %} +
{% endif %} diff --git a/prosopopee/themes/exposure/templates/sections/pictures-group.html b/prosopopee/themes/exposure/templates/sections/pictures-group.html index 747bba2..13843ab 100644 --- a/prosopopee/themes/exposure/templates/sections/pictures-group.html +++ b/prosopopee/themes/exposure/templates/sections/pictures-group.html @@ -1,59 +1,50 @@ {% if section.background %} -
-{% endif %} - -
-{% for line in section.images %} +
+ {% endif %} +
+ {% for line in section.images %}
- {% for image in line %} -
+ {% for image in line %} +
{% if image.type == "video" %} - {% set caption = image.text %} - {% set video = Video(image) %} - {{ video.copy() }} - - - - {% if caption %} -
-
{{ caption }}
-
- {% endif %} - - {% else %} - {% set caption = image.text %} - {% set image = Image(image) %} - {{ image.copy() }} - - - {% if caption %} -
-
{{ caption }}
-
- {% endif %} -
- - {% endif %} - + {% set caption = image.text %} + {% set video = Video(image) %} + {{ video.copy() }} + + + {% if caption %} +
+
{{ caption }}
- - {% if not loop.last %} -
{% endif %} - + {% else %} + {% set caption = image.text %} + {% set image = Image(image) %} + {{ image.copy() }} + + + {% if caption %} +
+
{{ caption }}
+
+ {% endif %} +
+ {% endif %} +
+ {% if not loop.last %} +
+ {% endif %} + {% endfor %} +
{% endfor %} -
- -{% endfor %} -
- -{% if section.background %} -
+
+ {% if section.background %} +
{% endif %} diff --git a/prosopopee/themes/exposure/templates/sections/text.html b/prosopopee/themes/exposure/templates/sections/text.html index ea09657..499b2a1 100644 --- a/prosopopee/themes/exposure/templates/sections/text.html +++ b/prosopopee/themes/exposure/templates/sections/text.html @@ -1,11 +1,9 @@ {% if section.background or section.color %} -
-{% endif %} - -
+
+ {% endif %} +
{{ section.text }} -
- -{% if section.background or section.color %} -
+
+ {% if section.background or section.color %} +
{% endif %} diff --git a/prosopopee/themes/exposure/templates/share.html b/prosopopee/themes/exposure/templates/share.html index 6626c49..a37929f 100644 --- a/prosopopee/themes/exposure/templates/share.html +++ b/prosopopee/themes/exposure/templates/share.html @@ -1,18 +1,18 @@ -{% set absolute_url = settings.url + "/" + link -%} +{% set absolute_url = settings.url + "/" + link %} diff --git a/prosopopee/themes/light/templates/gallery-index.html b/prosopopee/themes/light/templates/gallery-index.html index c5b3ebd..ea0e48b 100644 --- a/prosopopee/themes/light/templates/gallery-index.html +++ b/prosopopee/themes/light/templates/gallery-index.html @@ -5,36 +5,46 @@ {% endif %} - - - - - + + + + + - - - {{ gallery.title }} · {{ settings.title }} - + + + {% if gallery.description %} + + {% endif %} + {% if gallery.lang %} + + {% endif %} + {% if settings.settings.og %} + {% include "opengraph.html" %} + {% endif %} - -
- {% for section in gallery.sections %} - {% include "sections/" + section.type + ".html" %} - {% endfor %} + {{ gallery.title }} · {{ settings.title }} + - {% if settings.share %} - {% include "share.html" %} - {% endif %} + +
+ {% for section in gallery.sections %} + {% include "sections/" + section.type + ".html" %} + {% endfor %} - -
- {% include "footer.html" %} - + {% if settings.share %} + {% include "share.html" %} + {% endif %} + + +
+ {% include "footer.html" %} + diff --git a/prosopopee/themes/light/templates/opengraph.html b/prosopopee/themes/light/templates/opengraph.html new file mode 100644 index 0000000..fbcbb89 --- /dev/null +++ b/prosopopee/themes/light/templates/opengraph.html @@ -0,0 +1,13 @@ + + + +{% if gallery.description %} + +{% endif %} + + +{% if gallery.tags %} +{% for tag in gallery.tags %} + +{% endfor %} +{% endif %} diff --git a/prosopopee/themes/material/templates/gallery-index.html b/prosopopee/themes/material/templates/gallery-index.html index d847fd0..1d96aea 100644 --- a/prosopopee/themes/material/templates/gallery-index.html +++ b/prosopopee/themes/material/templates/gallery-index.html @@ -1,128 +1,138 @@ - - - - - - - - {% if settings.share %} - - {% endif %} + + + + + + + + {% if settings.share %} + + {% endif %} - - - {{ gallery.title }} · {{ settings.title }} - + + + {% if gallery.description %} + + {% endif %} + {% if gallery.lang %} + + {% endif %} + {% if settings.settings.og %} + {% include "opengraph.html" %} + {% endif %} - -
+ {{ gallery.title }} · {{ settings.title }} + - {% for section in gallery.sections %} - {% include "sections/" + section.type + ".html" %} - {% endfor %} + +
+ + {% for section in gallery.sections %} + {% include "sections/" + section.type + ".html" %} + {% endfor %} - {% if settings.share %} - {% include 'share.html' -%} - {% else -%} -
- - - -
- {% endif %} + {% if settings.share %} + {% include 'share.html' -%} + {% else -%} +
+ + + +
+ {% endif %} - - - - - - + + + + + -
- {% include 'footer.html'%} - + +
+ {% include 'footer.html'%} + diff --git a/prosopopee/themes/material/templates/opengraph.html b/prosopopee/themes/material/templates/opengraph.html new file mode 100644 index 0000000..fbcbb89 --- /dev/null +++ b/prosopopee/themes/material/templates/opengraph.html @@ -0,0 +1,13 @@ + + + +{% if gallery.description %} + +{% endif %} + + +{% if gallery.tags %} +{% for tag in gallery.tags %} + +{% endfor %} +{% endif %} From 7c8d17fbcb552121437a2df397a637b431c34b8c Mon Sep 17 00:00:00 2001 From: Adrien Beudin Date: Fri, 4 Nov 2016 14:37:46 +0100 Subject: [PATCH 02/12] fix bug og:image --- prosopopee/prosopopee.py | 3 ++- prosopopee/themes/exposure/templates/opengraph.html | 4 +++- prosopopee/themes/light/templates/opengraph.html | 4 +++- prosopopee/themes/material/templates/opengraph.html | 4 +++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/prosopopee/prosopopee.py b/prosopopee/prosopopee.py index f355480..7c3ef6a 100644 --- a/prosopopee/prosopopee.py +++ b/prosopopee/prosopopee.py @@ -363,7 +363,8 @@ def build_gallery(settings, gallery_settings, gallery_path, template): gallery=gallery_settings, Image=Image, Video=Video, - link=gallery_path + link=gallery_path, + name=gallery_path.split('/', 1)[-1] ).encode("Utf-8") open(Path("build").joinpath(gallery_path, "index.html"), "w").write(html) diff --git a/prosopopee/themes/exposure/templates/opengraph.html b/prosopopee/themes/exposure/templates/opengraph.html index fbcbb89..f2e75d1 100644 --- a/prosopopee/themes/exposure/templates/opengraph.html +++ b/prosopopee/themes/exposure/templates/opengraph.html @@ -1,5 +1,7 @@ + +{% set absolute_url = settings.url + "/" + name %} - + {% if gallery.description %} diff --git a/prosopopee/themes/light/templates/opengraph.html b/prosopopee/themes/light/templates/opengraph.html index fbcbb89..f2e75d1 100644 --- a/prosopopee/themes/light/templates/opengraph.html +++ b/prosopopee/themes/light/templates/opengraph.html @@ -1,5 +1,7 @@ + +{% set absolute_url = settings.url + "/" + name %} - + {% if gallery.description %} diff --git a/prosopopee/themes/material/templates/opengraph.html b/prosopopee/themes/material/templates/opengraph.html index fbcbb89..f2e75d1 100644 --- a/prosopopee/themes/material/templates/opengraph.html +++ b/prosopopee/themes/material/templates/opengraph.html @@ -1,5 +1,7 @@ + +{% set absolute_url = settings.url + "/" + name %} - + {% if gallery.description %} From d29a75fbba76f2faa889dc5b704d3f4eab7d648b Mon Sep 17 00:00:00 2001 From: Adrien Beudin Date: Fri, 4 Nov 2016 14:43:09 +0100 Subject: [PATCH 03/12] add rss in light theme --- prosopopee/themes/light/templates/feed.xml | 30 +++++++-------------- prosopopee/themes/light/templates/item.html | 15 +++++++++++ 2 files changed, 25 insertions(+), 20 deletions(-) create mode 100644 prosopopee/themes/light/templates/item.html diff --git a/prosopopee/themes/light/templates/feed.xml b/prosopopee/themes/light/templates/feed.xml index ba5b2dd..cecd1af 100644 --- a/prosopopee/themes/light/templates/feed.xml +++ b/prosopopee/themes/light/templates/feed.xml @@ -1,23 +1,13 @@ - - {{ settings.title }} - {{ settings.sub_title }} - {{ settings.url }} - - - {% for gallery in galleries %} - {% set absolute_url = settings.url + "/" + gallery.link %} - - {{ gallery.title }} - {{ absolute_url }} - {{ gallery.link }} - {% if gallery.sub_title %} - {{ gallery.sub_title }} - {% endif %} - {{ gallery.date }} - - {% endfor %} - - + + {{ settings.title }} + {{ settings.sub_title }} + {{ settings.url }} + + {% for gallery in galleries %} + {% set absolute_url = settings.url + "/" %} + {% include "item.html" %} + {% endfor %} + diff --git a/prosopopee/themes/light/templates/item.html b/prosopopee/themes/light/templates/item.html new file mode 100644 index 0000000..0109eb1 --- /dev/null +++ b/prosopopee/themes/light/templates/item.html @@ -0,0 +1,15 @@ +{% set absolute_url = absolute_url+ gallery.link+"/" %} + +{{ gallery.title }} +{{ absolute_url }} +{{ gallery.link }} +{% if gallery.sub_title %} +{{ gallery.sub_title }} +{% endif -%} +{{ gallery.date }} + +{% for sub_gallery in gallery.sub_gallery %} +{% with gallery=sub_gallery %} +{% include "item.html" %} +{% endwith %} +{% endfor %} From 3440a8cfcb0d85dcfb98915d5799939978fcaee6 Mon Sep 17 00:00:00 2001 From: Adrien Beudin Date: Fri, 4 Nov 2016 14:43:29 +0100 Subject: [PATCH 04/12] fix og in light theme --- prosopopee/prosopopee.py | 1 + 1 file changed, 1 insertion(+) diff --git a/prosopopee/prosopopee.py b/prosopopee/prosopopee.py index 7c3ef6a..835520a 100644 --- a/prosopopee/prosopopee.py +++ b/prosopopee/prosopopee.py @@ -395,6 +395,7 @@ def build_gallery(settings, gallery_settings, gallery_path, template): Image=Image, Video=Video, link=gallery_light_path + name=gallery_path.split('/', 1)[-1] ).encode("Utf-8") open(Path("build").joinpath(gallery_light_path, "index.html"), "w").write(html) From dd10770e86db9e8cf5acfc16cc5801063671799e Mon Sep 17 00:00:00 2001 From: Adrien Beudin Date: Fri, 4 Nov 2016 14:44:40 +0100 Subject: [PATCH 05/12] fix error --- prosopopee/prosopopee.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prosopopee/prosopopee.py b/prosopopee/prosopopee.py index 835520a..9e52553 100644 --- a/prosopopee/prosopopee.py +++ b/prosopopee/prosopopee.py @@ -394,7 +394,7 @@ def build_gallery(settings, gallery_settings, gallery_path, template): gallery=gallery_settings, Image=Image, Video=Video, - link=gallery_light_path + link=gallery_light_path, name=gallery_path.split('/', 1)[-1] ).encode("Utf-8") From 1d04ef306aa6121e755430480edc74baa8472260 Mon Sep 17 00:00:00 2001 From: Adrien Beudin Date: Fri, 4 Nov 2016 14:47:47 +0100 Subject: [PATCH 06/12] fix url of og:image --- prosopopee/themes/exposure/templates/opengraph.html | 2 +- prosopopee/themes/light/templates/opengraph.html | 2 +- prosopopee/themes/material/templates/opengraph.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/prosopopee/themes/exposure/templates/opengraph.html b/prosopopee/themes/exposure/templates/opengraph.html index f2e75d1..b1b5638 100644 --- a/prosopopee/themes/exposure/templates/opengraph.html +++ b/prosopopee/themes/exposure/templates/opengraph.html @@ -1,5 +1,5 @@ -{% set absolute_url = settings.url + "/" + name %} +{% set absolute_url = settings.url + "/" + name + "/" %} diff --git a/prosopopee/themes/light/templates/opengraph.html b/prosopopee/themes/light/templates/opengraph.html index f2e75d1..b1b5638 100644 --- a/prosopopee/themes/light/templates/opengraph.html +++ b/prosopopee/themes/light/templates/opengraph.html @@ -1,5 +1,5 @@ -{% set absolute_url = settings.url + "/" + name %} +{% set absolute_url = settings.url + "/" + name + "/" %} diff --git a/prosopopee/themes/material/templates/opengraph.html b/prosopopee/themes/material/templates/opengraph.html index f2e75d1..b1b5638 100644 --- a/prosopopee/themes/material/templates/opengraph.html +++ b/prosopopee/themes/material/templates/opengraph.html @@ -1,5 +1,5 @@ -{% set absolute_url = settings.url + "/" + name %} +{% set absolute_url = settings.url + "/" + name + "/" %} From b57efe00c95f8e2800893b1ffaed323e60aeb090 Mon Sep 17 00:00:00 2001 From: Adrien Beudin Date: Fri, 4 Nov 2016 14:55:04 +0100 Subject: [PATCH 07/12] reduce size of cover --- prosopopee/themes/exposure/templates/opengraph.html | 2 +- prosopopee/themes/light/templates/opengraph.html | 2 +- prosopopee/themes/material/templates/opengraph.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/prosopopee/themes/exposure/templates/opengraph.html b/prosopopee/themes/exposure/templates/opengraph.html index b1b5638..776a356 100644 --- a/prosopopee/themes/exposure/templates/opengraph.html +++ b/prosopopee/themes/exposure/templates/opengraph.html @@ -1,7 +1,7 @@ {% set absolute_url = settings.url + "/" + name + "/" %} - + {% if gallery.description %} diff --git a/prosopopee/themes/light/templates/opengraph.html b/prosopopee/themes/light/templates/opengraph.html index b1b5638..776a356 100644 --- a/prosopopee/themes/light/templates/opengraph.html +++ b/prosopopee/themes/light/templates/opengraph.html @@ -1,7 +1,7 @@ {% set absolute_url = settings.url + "/" + name + "/" %} - + {% if gallery.description %} diff --git a/prosopopee/themes/material/templates/opengraph.html b/prosopopee/themes/material/templates/opengraph.html index b1b5638..776a356 100644 --- a/prosopopee/themes/material/templates/opengraph.html +++ b/prosopopee/themes/material/templates/opengraph.html @@ -1,7 +1,7 @@ {% set absolute_url = settings.url + "/" + name + "/" %} - + {% if gallery.description %} From 0ecd4cde5f8e7926f69207b7b92d4975365c0a4f Mon Sep 17 00:00:00 2001 From: Adrien Beudin Date: Fri, 4 Nov 2016 15:02:18 +0100 Subject: [PATCH 08/12] reduce size of cover --- prosopopee/themes/exposure/templates/opengraph.html | 5 +++-- prosopopee/themes/light/templates/opengraph.html | 5 +++-- prosopopee/themes/material/templates/opengraph.html | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/prosopopee/themes/exposure/templates/opengraph.html b/prosopopee/themes/exposure/templates/opengraph.html index 776a356..29dffcb 100644 --- a/prosopopee/themes/exposure/templates/opengraph.html +++ b/prosopopee/themes/exposure/templates/opengraph.html @@ -1,7 +1,8 @@ - {% set absolute_url = settings.url + "/" + name + "/" %} +{% set cover = Image(gallery.cover) %} +{{ cover.copy() }} - + {% if gallery.description %} diff --git a/prosopopee/themes/light/templates/opengraph.html b/prosopopee/themes/light/templates/opengraph.html index 776a356..29dffcb 100644 --- a/prosopopee/themes/light/templates/opengraph.html +++ b/prosopopee/themes/light/templates/opengraph.html @@ -1,7 +1,8 @@ - {% set absolute_url = settings.url + "/" + name + "/" %} +{% set cover = Image(gallery.cover) %} +{{ cover.copy() }} - + {% if gallery.description %} diff --git a/prosopopee/themes/material/templates/opengraph.html b/prosopopee/themes/material/templates/opengraph.html index 776a356..29dffcb 100644 --- a/prosopopee/themes/material/templates/opengraph.html +++ b/prosopopee/themes/material/templates/opengraph.html @@ -1,7 +1,8 @@ - {% set absolute_url = settings.url + "/" + name + "/" %} +{% set cover = Image(gallery.cover) %} +{{ cover.copy() }} - + {% if gallery.description %} From b3d9b41f132e987e56e9e97ec6f518decc2a7100 Mon Sep 17 00:00:00 2001 From: Adrien Beudin Date: Fri, 4 Nov 2016 15:43:17 +0100 Subject: [PATCH 09/12] optionnal fixed background for full-picture --- docs/sections.rst | 6 ++++++ .../themes/exposure/templates/sections/full-picture.html | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/sections.rst b/docs/sections.rst index e219b99..d3c4384 100644 --- a/docs/sections.rst +++ b/docs/sections.rst @@ -46,6 +46,12 @@ Without text:: - type: full-picture image: big_picture.jpg + +If you want fixed backgroup use can use this optionnal option (only with the exposure theme):: + + - type: full-picture + fixed: true + Bordered picture ________________ diff --git a/prosopopee/themes/exposure/templates/sections/full-picture.html b/prosopopee/themes/exposure/templates/sections/full-picture.html index 656d44d..7b88dc8 100644 --- a/prosopopee/themes/exposure/templates/sections/full-picture.html +++ b/prosopopee/themes/exposure/templates/sections/full-picture.html @@ -26,7 +26,7 @@ {% else %} {% set image = Image(section.image) %} {{ image.copy() }} -
+
{% if section.text %}
From 68ccad5d69a41520957eaa14fcd8c4548a18a475 Mon Sep 17 00:00:00 2001 From: Adrien Beudin Date: Fri, 4 Nov 2016 15:48:18 +0100 Subject: [PATCH 10/12] add description and lang settings --- docs/configuration.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/configuration.rst b/docs/configuration.rst index 862fb1a..7c132f9 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -196,6 +196,8 @@ _______ sub_title: Gallery sub-title date: 2016-01-15 cover: my_cover_picture.jpg + description: Some text + lang: en_US tags: - #yolo - #travel From bf0b34c45468f35b1b181766be5cf0ce3368c4f3 Mon Sep 17 00:00:00 2001 From: Adrien Beudin Date: Fri, 4 Nov 2016 15:51:20 +0100 Subject: [PATCH 11/12] add og meta --- docs/configuration.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/configuration.rst b/docs/configuration.rst index 7c132f9..bb1d583 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -176,6 +176,15 @@ For activate the RSS you need add this key in **root** settings.yaml:: url: "http://prosopopee.com" +Open Graph Meta +~~~~~~~~~~~~~~~ + +For activate the Open Graph Meta you need add this key in **root** settings.yaml:: + + og: true + +Optionnal: You need use description and lang key in settings gallery. + Gallery settings.yaml --------------------- From 616f67c74d4bc42fb16b97e67c70a42509d35a1b Mon Sep 17 00:00:00 2001 From: Adrien Beudin Date: Fri, 4 Nov 2016 16:46:43 +0100 Subject: [PATCH 12/12] add link open graph --- docs/configuration.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/configuration.rst b/docs/configuration.rst index bb1d583..61f35e6 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -185,6 +185,8 @@ For activate the Open Graph Meta you need add this key in **root** settings.yam Optionnal: You need use description and lang key in settings gallery. +for more informations about Open Graph http://ogp.me/ + Gallery settings.yaml ---------------------