aboutsummaryrefslogtreecommitdiff
path: root/_includes
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <msabate@suse.com>2018-09-25 19:13:16 +0200
committerMiquel Sabaté Solà <msabate@suse.com>2018-09-25 19:13:16 +0200
commit259e8ab7a3a7e607263ca07e53787d85881bab8a (patch)
treea726ede11d679fe93515cca062692bfc29e7d87f /_includes
parentf5329b13315fcc501cd6c8630e0158eae4a88f16 (diff)
downloadjo.mssola.com-259e8ab7a3a7e607263ca07e53787d85881bab8a.tar.gz
jo.mssola.com-259e8ab7a3a7e607263ca07e53787d85881bab8a.zip
Re-bumped much of the application
Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
Diffstat (limited to '_includes')
-rw-r--r--_includes/grid.html75
-rw-r--r--_includes/header.html6
-rw-r--r--_includes/listtags.html21
-rw-r--r--_includes/postmeta.html18
-rw-r--r--_includes/tags.html18
5 files changed, 138 insertions, 0 deletions
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 @@
+<div class="container">
+ <div id="blog-intro" class="row">
+ {% if include.hasfeed %}
+ <h2>
+ {% t titles.blog %}
+
+ <small>
+ {% if site.lang == "ca" %}
+ <a href="/feed.xml">RSS Feed</a>
+ {% else %}
+ <a href="/feed.en.xml">RSS Feed</a>
+ {% endif %}
+ </small>
+ </h2>
+ {% endif %}
+
+ <p>
+ {% if include.index %}
+ {% t index.intro %}
+ <a href="{% tl writings %}" title="{% t titles.writings %}">{% t titles.writingsu %}</a>
+ {% t index.after %}
+ <a href="{% tl blog %}" title="{% t titles.blog %}">{% t titles.blogu %}</a>.
+ {% t index.final %}
+ {% elsif include.writings %}
+ {% t writings.intro %}
+ {% else %}
+ {% t blog.intro %}
+ {% endif %}
+ </p>
+
+ <p id="tag-search-message">
+ Filtering by the tag:
+ <code id="tag-searched"></code>.
+ Click <a href="{{ page.url | prepend: site.baseurl }}">here</a> to cancel.
+ </p>
+ </div>
+
+ <center id="oh-its-empty">
+ {% t blog.empty_search %}
+ </center>
+
+ <div id="posts-list" class="row">
+ {% 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" %}
+ <center>{% t blog.empty %}</center>
+ {% endif %}
+
+ {% for post in posts %}
+ {% if site.lang == post.lang %}
+ <div class="post-preview col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
+ <a href="{{ post.url | prepend: site.baseurl }}">
+ <h2 class="post-title">
+ {{ post.title }}{% if post.subtitle %}.<small class="post-subtitle"> {{ post.subtitle }}</small>{% endif %}
+ </h2>
+ </a>
+
+ {% include postmeta.html date=post.date tags=post.tags %}
+
+ <div class="post-entry">
+ {{ post.content | truncatewords: 50 | strip_html }}
+ <a href="{{ post.url | prepend: site.baseurl }}" class="post-read-more">[{% t blog.read %}&nbsp;{% t blog.more %}]</a>
+ </div>
+ </div>
+ {% endif %}
+ {% endfor %}
+ </div>
+</div>
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 %}
+
<header class="site-header" role="banner">
<div class="wrapper">
<div class="left-header header-component">
@@ -18,7 +22,9 @@
{% endif %}
{% endif %}
+ <a title="{% t titles.writings %}" href="{% tl writings %}">{% t titles.writings %}</a>
<a title="{% t titles.blog %}" href="{% tl blog %}">{% t titles.blog %}</a>
+ <a title="{% t titles.about %}" href="{% tl about %}">{% t titles.about %}</a>
</nav>
</div>
</header>
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 @@
+<div id="taglist">
+{% 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 %}
+
+ <a href="{{ tag_url }}">
+ <code><nobr class="tag">{{ tag_name }}</nobr></code>
+ </a>
+{% endfor %}
+</div>
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 @@
+<div class="post-meta">
+ <div class="autor">
+ {% t blog.posted_on %}
+
+ {% if site.lang == "ca" %}
+ {% include date.html date=include.date %}
+ {{ pre }}{{ day }} de {{ month }} del {{ year }}
+ {% else %}
+ {{ post.date | date: "%B %-d, %Y" }}
+ {% endif %}
+
+ {% t footer.by %} {{ site.author }}.
+ <span>{% t blog.tags %}: </span>
+ </div>
+ <div class="separator"></div>
+
+ {% include listtags.html tags=include.tags urltobeused=include.urltobeused %}
+</div>
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 %}