From 259e8ab7a3a7e607263ca07e53787d85881bab8a Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Tue, 25 Sep 2018 19:13:16 +0200 Subject: Re-bumped much of the application MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miquel Sabaté Solà --- _includes/grid.html | 75 +++++++++++++++++++++++++++++++++++++++++++++++++ _includes/header.html | 6 ++++ _includes/listtags.html | 21 ++++++++++++++ _includes/postmeta.html | 18 ++++++++++++ _includes/tags.html | 18 ++++++++++++ 5 files changed, 138 insertions(+) create mode 100644 _includes/grid.html create mode 100644 _includes/listtags.html create mode 100644 _includes/postmeta.html create mode 100644 _includes/tags.html (limited to '_includes') diff --git a/_includes/grid.html b/_includes/grid.html new file mode 100644 index 0000000..26771a9 --- /dev/null +++ b/_includes/grid.html @@ -0,0 +1,75 @@ +
+
+ {% if include.hasfeed %} +

+ {% t titles.blog %} + + + {% if site.lang == "ca" %} + RSS Feed + {% else %} + RSS Feed + {% endif %} + +

+ {% endif %} + +

+ {% if include.index %} + {% t index.intro %} + {% t titles.writingsu %} + {% t index.after %} + {% t titles.blogu %}. + {% t index.final %} + {% elsif include.writings %} + {% t writings.intro %} + {% else %} + {% t blog.intro %} + {% endif %} +

+ +

+ Filtering by the tag: + . + Click here to cancel. +

+
+ +
+ {% t blog.empty_search %} +
+ +
+ {% if page.url == "/" %} + {% assign posts = site.posts | where:"lang",site.lang %} + {% elsif page.url == "/blog/" %} + {% assign posts = site.posts | where:"lang",site.lang | where:"blogpost",true %} + {% else %} + {% assign posts = site.posts | where:"lang",site.lang | where:"blogpost",false %} + {% endif %} + + {% capture posts_count %}{{ posts | size }}{% endcapture %} + {% if posts_count == "0" %} +
{% t blog.empty %}
+ {% endif %} + + {% for post in posts %} + {% if site.lang == post.lang %} +
+ +

+ {{ post.title }}{% if post.subtitle %}. {{ post.subtitle }}{% endif %} +

+
+ + {% include postmeta.html date=post.date tags=post.tags %} + +
+ {{ post.content | truncatewords: 50 | strip_html }} + [{% t blog.read %} {% t blog.more %}] +
+
+ {% endif %} + {% endfor %} +
+
diff --git a/_includes/header.html b/_includes/header.html index b7296b6..ca0eeca 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -1,3 +1,7 @@ +{% if site.tags != "" %} + {% include tags.html %} +{% endif %} + diff --git a/_includes/listtags.html b/_includes/listtags.html new file mode 100644 index 0000000..dcfa280 --- /dev/null +++ b/_includes/listtags.html @@ -0,0 +1,21 @@ +
+{% for tag in include.tags %} + {% capture tag_name %}{{ tag }}{% endcapture %} + + {% if include.urltobeused == "" %} + {% assign url = page.url %} + {% else %} + {% assign url = "/" %} + {% endif %} + + {% if site.lang == "ca" %} + {% capture tag_url %}{{ url }}?tag={{ tag_name }}{% endcapture %} + {% else %} + {% capture tag_url %}en/{{ url }}?tag={{ tag_name }}{% endcapture %} + {% endif %} + + + {{ tag_name }} + +{% endfor %} +
diff --git a/_includes/postmeta.html b/_includes/postmeta.html new file mode 100644 index 0000000..0c7416d --- /dev/null +++ b/_includes/postmeta.html @@ -0,0 +1,18 @@ + diff --git a/_includes/tags.html b/_includes/tags.html new file mode 100644 index 0000000..0f187e5 --- /dev/null +++ b/_includes/tags.html @@ -0,0 +1,18 @@ +{% assign rawtags = "" %} +{% for post in site.posts %} + {% assign ttags = post.tags | join:'|' | append:'|' %} + {% assign rawtags = rawtags | append:ttags %} +{% endfor %} +{% assign rawtags = rawtags | split:'|' | sort %} + +{% assign site.tags = "" %} +{% for tag in rawtags %} + {% if tag != "" %} + {% if tags == "" %} + {% assign tags = tag | split:'|' %} + {% endif %} + {% unless tags contains tag %} + {% assign tags = tags | join:'|' | append:'|' | append:tag | split:'|' %} + {% endunless %} + {% endif %} +{% endfor %} -- cgit v1.2.3