implemented also atom feed via template
This commit is contained in:
parent
8b17e93d74
commit
cfab9ef5c0
10 changed files with 259 additions and 114 deletions
52
web/planet-mars/templates/atom.xml
Normal file
52
web/planet-mars/templates/atom.xml
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<feed xmlns="http://www.w3.org/2005/Atom">
|
||||
<title>Planet TVL</title>
|
||||
<link href="https::/planet.tvl.fyi"/>
|
||||
<updated>{{now()|date(format="%Y-%m-%dT%H:%M:%SZ")}}</updated>
|
||||
<id>https::/planet.tvl.fyi</id>
|
||||
<generator uri="{{ PKG_HOMEPAGE }}" version="{{ PKG_VERSION }}">
|
||||
{{ PKG_NAME }} by {{ PKG_AUTHORS }}
|
||||
</generator>
|
||||
<icon>https://planet.tvl.fyi/logo.svg</icon>
|
||||
|
||||
{% for entry in entries %}
|
||||
<entry>
|
||||
<id>{{ entry.id }}/planet.tvl.fyi</id>
|
||||
{% if entry.title -%}
|
||||
<title>{{ entry.title.content }}</title>
|
||||
{% endif -%}
|
||||
{% for link in entry.links %}
|
||||
<link href="{{ link.href }}" {% if link.rel %}rel="{{ link.rel }}"{% endif %}/>
|
||||
{% endfor %}
|
||||
{% if entry.updated %}
|
||||
<updated>{{ entry.updated }}</updated>
|
||||
{% endif %}
|
||||
{% if entry.published %}
|
||||
<published>{{ entry.published }}</published>
|
||||
{% endif %}
|
||||
{% if entry.summary -%}
|
||||
<summary>
|
||||
{{ entry.summary.content|escape }}
|
||||
</summary>
|
||||
{% endif -%}
|
||||
{% for author in entry.authors %}
|
||||
<author>
|
||||
{% if author.name -%}
|
||||
<name>{{ author.name }}</name>
|
||||
{% endif -%}
|
||||
{% if author.email -%}
|
||||
<email>{{ author.email }}</email>
|
||||
{% endif -%}
|
||||
</author>
|
||||
{% if author.email -%}
|
||||
<uri>{{ author.uri }}</uri>
|
||||
{% endif -%}
|
||||
{% endfor %}
|
||||
{% if entry.content -%}
|
||||
<content {% if entry.content.type %}type="{{ entry.content.type }}"{% endif %} {% if entry.content.src %}type="{{ entry.content.src }}"{% endif %}>
|
||||
{{ entry.content.body|escape }}
|
||||
</content>
|
||||
{% endif -%}
|
||||
</entry>
|
||||
{% endfor %}
|
||||
</feed>
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
{% set dateformat = "%d.%m.%Y %H:%M" -%}
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Planet TVL</title>
|
||||
|
|
@ -5,7 +7,6 @@
|
|||
<meta name="generator" content="planet-mars">
|
||||
<link rel="shortcut icon" href="/favicon.ico">
|
||||
<link rel="stylesheet" href="planet.css" type="text/css">
|
||||
{# todo <link rel="alternate" type="application/rss+xml" title="Planet Haskell RSS Feed" href="rss20.xml"> #}
|
||||
<link rel="alternate" type="application/xml+atom" title="Planet Haskell Atom Feed" href="atom.xml">
|
||||
</head>
|
||||
<body>
|
||||
|
|
@ -14,17 +15,50 @@
|
|||
</header>
|
||||
<div id="maincontainer">
|
||||
<main>
|
||||
{% for entry in entries %}
|
||||
{% for entry in entries -%}
|
||||
{% if loop.index > 1 -%}
|
||||
<hr class="entry_sep">
|
||||
{% endif -%}
|
||||
{% if entry.links.0 -%}
|
||||
{% set link = entry.links.0.href -%}
|
||||
{% else -%}
|
||||
{% set link = "" -%}
|
||||
{% endif -%}
|
||||
<article>
|
||||
<h2><a href="{{entry.link}}">{{ entry.title|striptags }}<a></h2>
|
||||
<date>{% if entry.published %}{{ entry.published | date(format="%Y-%m-%d %H:%M", timezone="Europe/Moscow") }}{% endif %}</date>{# todo: maybe group posts by day? #}
|
||||
<p class="entry_author">{{ entry.author|striptags }}</p>
|
||||
<div class="entry_content">
|
||||
{{ entry.content }}
|
||||
<h2 class="entry_header">
|
||||
<a {% if link -%}href="{{link}}"{% endif -%}>
|
||||
{% if entry.title -%}
|
||||
{{ entry.title.content|striptags }}
|
||||
{% else -%}
|
||||
NO TITLE
|
||||
{% endif -%}
|
||||
</a>
|
||||
</h2>
|
||||
<div class="entry_meta">
|
||||
<date>
|
||||
{% if entry.updated -%}
|
||||
<span>{{ entry.updated | date(format=dateformat) }}</span>
|
||||
{% else -%}
|
||||
<span>{{ entry.published | date(format=dateformat) }}</span>
|
||||
{% endif -%}
|
||||
</date>
|
||||
{% if entry.authors -%}
|
||||
— <span class="entry_author">{{ entry.authors.0.name | striptags }}</span>
|
||||
{% endif -%}
|
||||
</div>
|
||||
<p><a href="{{entry.link}}">full post</a></p>
|
||||
|
||||
{% if entry.summary -%}
|
||||
<div class="entry_summary">
|
||||
{{ entry.summary.content }}
|
||||
</div>
|
||||
{% endif -%}
|
||||
{% if entry.content -%}
|
||||
<div class="entry_content">
|
||||
{{ entry.content.body }}
|
||||
</div>
|
||||
{% endif -%}
|
||||
</article>
|
||||
{% endfor %}
|
||||
{% endfor -%}
|
||||
</main>
|
||||
|
||||
<aside>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue