Simplified data generation code

Signed-off-by: Valentin Popov <info@valentineus.link>
This commit is contained in:
Valentin Popov 2020-01-23 20:21:21 +04:00
parent 28aec1dfdd
commit 11c402a293
Signed by: Valentin Popov
GPG Key ID: 269A00ACA90A8EA3
7 changed files with 17 additions and 17 deletions

View File

@ -3,9 +3,9 @@
<ul>
{% for contact in site.data.contacts %}
<li>
<a href="{{ contact.url | strip_newlines | strip_html | strip | normalize_whitespace | relative_url | uri_escape }}" target="_blank">{{ contact.title | strip_newlines | strip_html | strip | normalize_whitespace | smartify | xml_escape }}</a>
<a href="{{ contact.url | relative_url | uri_escape }}" target="_blank">{{ contact.title | strip | normalize_whitespace | xml_escape }}</a>
<span></span>
<span>{{ contact.description | strip_newlines | strip_html | strip | normalize_whitespace | smartify | xml_escape }}</span>
<span>{{ contact.description | strip | normalize_whitespace | xml_escape }}</span>
</li>
{% endfor %}
</ul>

View File

@ -8,20 +8,20 @@
<!-- Advanced meta tags -->
{% for tag in site.data.meta_tags %}
<meta name="{{ tag.name | strip_newlines | strip_html | strip | normalize_whitespace | smartify | xml_escape }}" content="{{ tag.content | strip_newlines | strip_html | strip | normalize_whitespace | smartify | xml_escape }}" />
<meta name="{{ tag.name | strip | normalize_whitespace | xml_escape }}" content="{{ tag.content | strip | normalize_whitespace | xml_escape }}" />
{% endfor %}
<!-- Open Graph -->
<meta property="og:title" content="{{ page.title | default: site.title | strip_newlines | strip_html | strip | normalize_whitespace | smartify | xml_escape }}" />
<meta property="og:description" content="{{ page.description | default: site.description | strip_newlines | strip_html | strip | normalize_whitespace | smartify | xml_escape }}" />
<meta property="og:title" content="{{ page.title | default: site.title | strip | normalize_whitespace | xml_escape }}" />
<meta property="og:description" content="{{ page.description | default: site.description | strip | normalize_whitespace | xml_escape }}" />
<meta property="og:type" content="{{ page.layout | replace: 'post', 'article' | replace: 'page', 'website' | default: 'website' }}" />
<meta property="og:image" content="{{ page.image | absolute_url | uri_escape }}" />
<meta property="og:url" content="{{ page.url | absolute_url | uri_escape }}" />
<!-- Title / Description -->
<meta name="application-name" content="{{ page.title | default: site.title | strip_newlines | strip_html | strip | normalize_whitespace | smartify | xml_escape }}" />
<meta name="description" content="{{ page.description | default: site.description | strip_newlines | strip_html | strip | normalize_whitespace | smartify | xml_escape }}" />
<title>{{ page.title | default: site.title | strip_newlines | strip_html | strip | normalize_whitespace | smartify | xml_escape }}</title>
<meta name="application-name" content="{{ page.title | default: site.title | strip | normalize_whitespace | xml_escape }}" />
<meta name="description" content="{{ page.description | default: site.description | strip | normalize_whitespace | xml_escape }}" />
<title>{{ page.title | default: site.title | strip | normalize_whitespace | xml_escape }}</title>
<!-- CSS -->
<link rel="stylesheet" href="{{ '/assets/css/styles.css' | relative_url | uri_escape }}" />

View File

@ -3,9 +3,9 @@
<ul>
{% for link in site.data.links %}
<li>
<a href="{{ link.url | strip_newlines | strip_html | strip | normalize_whitespace | relative_url | uri_escape }}" target="_blank">{{ link.title | strip_newlines | strip_html | strip | normalize_whitespace | smartify | xml_escape }}</a>
<a href="{{ link.url | relative_url | uri_escape }}" target="_blank">{{ link.title | strip | normalize_whitespace | xml_escape }}</a>
<span></span>
<span>{{ link.description | strip_newlines | strip_html | strip | normalize_whitespace | smartify | xml_escape }}</span>
<span>{{ link.description | strip | normalize_whitespace | xml_escape }}</span>
</li>
{% endfor %}
</ul>

View File

@ -3,8 +3,8 @@
<ul>
{% for post in site.posts %}
<li>
<a href="{{ post.url | relative_url | uri_escape }}">{{ post.title | strip_newlines | strip_html | strip | normalize_whitespace | smartify | xml_escape }}</a>
(<time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: '%d-%m-%Y' | strip_newlines | strip_html | strip | normalize_whitespace | smartify | xml_escape }}</time>)
<a href="{{ post.url | relative_url | uri_escape }}">{{ post.title | strip | normalize_whitespace | xml_escape }}</a>
(<time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: '%d-%m-%Y' | strip | normalize_whitespace | xml_escape }}</time>)
</li>
{% endfor %}
</ul>

View File

@ -3,7 +3,7 @@ layout: compress
---
<!DOCTYPE html>
<html lang="{{ site.lang | strip_newlines | strip_html | strip | slugify }}">
<html lang="{{ site.lang | strip | slugify | xml_escape }}">
{% include head.html %}
<body>

View File

@ -4,7 +4,7 @@ layout: default
<main class="container">
<header>
<h1>{{ page.title | default: site.title | strip_newlines | strip_html | strip | normalize_whitespace | smartify | xml_escape }}</h1>
<h1>{{ page.title | default: site.title | strip | normalize_whitespace | xml_escape }}</h1>
</header>
{{ content }}

View File

@ -5,15 +5,15 @@ layout: default
<article class="container">
<small>
<span>Published</span>
<time datetime="{{ page.date | date_to_xmlschema }}">{{ page.date | date: '%Y-%m-%d' | strip_newlines | strip_html | strip | normalize_whitespace | smartify | xml_escape }}</time>
<time datetime="{{ page.date | date_to_xmlschema }}">{{ page.date | date: '%Y-%m-%d' | strip | normalize_whitespace | xml_escape }}</time>
<span>on</span>
<a href="{{ site.url | absolute_url | uri_escape }}" target="_self">{{ site.title | strip_newlines | strip_html | strip | normalize_whitespace | smartify | xml_escape }}</a>
<a href="{{ site.url | absolute_url | uri_escape }}" target="_self">{{ site.title | strip | normalize_whitespace | xml_escape }}</a>
<span>|</span>
<a href="{{ page.url | absolute_url | uri_escape }}" target="_blank">Permalink</a>
</small>
<header>
<h1>{{ site.title | strip_newlines | strip_html | strip | normalize_whitespace | smartify | xml_escape }}</h1>
<h1>{{ site.title | strip | normalize_whitespace | xml_escape }}</h1>
</header>
{{ content }}