1
0
Fork 0

Footer + feed improvements

This commit is contained in:
Daniel Kempkens 2015-01-01 20:51:56 +01:00
parent 5d3c72343a
commit e346f44f8a
9 changed files with 94 additions and 42 deletions

View file

@ -16,4 +16,5 @@ upload:
superfeedr:
@echo "=== Notifying Superfeedr"
@curl -X POST https://kempkens.superfeedr.com -d "hub.mode=publish" -d "hub.url=https://blog.kempkens.io/feed.xml"
@curl -X POST https://kempkens.superfeedr.com -d "hub.mode=publish" -d "hub.url=https://blog.kempkens.io/feed-with-links.xml"
@echo "Done."

36
_includes/feed.xml Normal file
View file

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>{{ site.title | append: include.title }}</title>
<link rel="self" href="{{ include.path | prepend: site.url }}" />
<link href="{{ site.url }}/" />
<link rel="hub" href="{{ site.hub_url }}/" />
<updated>{{ site.time | date_to_xmlschema }}</updated>
<id>{{ site.url | append: include.id }}</id>
<author>
<name>{{ site.author.name }}</name>
<email>{{ site.author.email }}</email>
</author>
{% for post in include.posts %}
<entry>
<id>{{ site.url }}{{ post.id }}</id>
<title>{% if post.category == "links" %}Link: {% endif %}{{ post.title }}</title>
<link href="{{ post.url | prepend: site.url }}" />
<published>{{ post.date | date_to_xmlschema }}</published>
{% if post.modified != nil %}
<updated>{{ post.modified | date_to_xmlschema }}</updated>
{% else %}
<updated>{{ post.date | date_to_xmlschema }}</updated>
{% endif %}
{% if post.category == "links" %}
<content type="html">
{% capture linktext %}<p><strong>Link:</strong> <a href="{{ post.link }}">{{ post.link | hostname }}</a></p>{% endcapture %}
{{ linktext | xml_escape }}
{{ post.content | xml_escape }}
</content>
{% else %}
<content type="html">{{ post.content | xml_escape }}</content>
{% endif %}
</entry>
{% endfor %}
</feed>

View file

@ -25,6 +25,7 @@
<!-- RSS -->
<link rel="alternate" type="application/atom+xml" title="{{ site.title }} Feed" href="{{ "/feed.xml" | prepend: site.url }}">
<link rel="alternate" type="application/atom+xml" title="{{ site.title }} Feed (with links)" href="{{ "/feed-with-links.xml" | prepend: site.url }}">
<!-- humans.txt -->
<link rel="author" href="humans.txt">

View file

@ -9,6 +9,20 @@
<div class="content container">
{{ content }}
<div class="footer">
<ul class="footer-links">
<li><a href="{{ "feed.xml" | prepend: site.baseurl }}">Feed</a></li>
<li class="divider">|</li>
<li><a href="{{ "feed-with-links.xml" | prepend: site.baseurl }}">Feed (with links)</a></li>
<li class="divider">|</li>
<li><a href="https://github.com/nifoc">GitHub</a></li>
<li class="divider">|</li>
<li><a href="http://ip6.nl/#!blog.kempkens.io">IPv6</a></li>
<li class="divider">|</li>
<li><a href="https://www.freebsd.org">FreeBSD</a></li>
</ul>
</div>
</div>
<!-- Asynchronous Google Analytics snippet -->

View file

@ -3,10 +3,10 @@ layout: default
---
<div class="post">
<h1 class="post-title">{{ page.title }}</h1>
<h1 class="post-title">&#9875; {{ page.title }}</h1>
<span class="post-date">{{ page.date | date_to_string }}</span>
<p>&#9875; <a href="{{ page.link }}" rel="external">{{ page.link | hostname }}</a></p>
<p class="post-link"><span>Link:</span> <a href="{{ page.link }}" rel="external">{{ page.link | hostname }}</a></p>
{{ content }}
</div>

View file

@ -17,10 +17,6 @@ title: Post Archive
{% endif %}
<li>
{% if post.category == "links" %}
&#9875; <a href="{{ post.link }}" rel="external">{{ post.title }}</a>
{% else %}
<a href="{{ post.url }}">{{ post.title }}</a>
{% endif %}
{% if post.category == "links" %}&#9875;{% endif %} <a href="{{ post.url }}">{{ post.title }}</a>
</li>
{% endfor %}

4
feed-with-links.xml Normal file
View file

@ -0,0 +1,4 @@
---
layout: null
---
{% include feed.xml id="/feed-with-links.xml" path="/feed-with-links.xml" title=" (with links)" posts=site.posts %}

View file

@ -1,31 +1,4 @@
---
layout: null
---
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>{{ site.title }}</title>
<link rel="self" href="{{ "/feed.xml" | prepend: site.url }}" />
<link href="{{ site.url }}/"/>
<link rel="hub" href="{{ site.hub_url }}/" />
<updated>{{ site.time | date_to_xmlschema }}</updated>
<id>{{ site.url }}</id>
<author>
<name>{{ site.author.name }}</name>
<email>{{ site.author.email }}</email>
</author>
{% for post in site.categories['posts'] %}
<entry>
<id>{{ site.url }}{{ post.id }}</id>
<title>{{ post.title }}</title>
<link href="{{ post.url | prepend: site.url }}" />
<published>{{ post.date | date_to_xmlschema }}</published>
{% if post.modified != nil %}
<updated>{{ post.modified | date_to_xmlschema }}</updated>
{% else %}
<updated>{{ post.date | date_to_xmlschema }}</updated>
{% endif %}
<content type="html">{{ post.content | xml_escape }}</content>
</entry>
{% endfor %}
</feed>
{% include feed.xml path="/feed.xml" posts=site.categories.posts %}

View file

@ -351,13 +351,6 @@ tbody tr:nth-child(odd) th {
margin-bottom: 1rem;
color: #9a9a9a;
}
.post-date a {
color: #9a9a9a;
}
.post-date a:hover {
color: #303030;
text-decoration: none;
}
/* Related posts */
.related {
@ -416,6 +409,40 @@ a.pagination-item:hover {
background-color: #f5f5f5;
}
/* Custom */
.post-date a {
color: #9a9a9a;
}
.post-date a:hover {
color: #303030;
text-decoration: none;
}
.post-link > span {
font-weight: bold;
}
.footer {
margin-top: 3rem;
font-size: 75%;
}
.footer-links {
margin: 0;
padding: 0;
list-style-type: none;
text-align: center;
}
.footer-links li {
display: inline;
}
.footer-links li.divider {
color: #eee;
}
.footer-links li a {
color: #515151;
}
@media (min-width: 30em) {
.pagination {
margin: 3rem 0;