updating feeds

This commit is contained in:
L3D 2022-05-06 00:54:43 +02:00
parent e5e315345b
commit c95a16e225
Signed by: l3d
GPG key ID: CD08445BFF4313D1
8 changed files with 108 additions and 0 deletions

1
assets/css/rezeptfeed.min.css vendored Normal file
View file

@ -0,0 +1 @@
feed:before{content:"Dies ist der XML-Feed, mit dem man Änderungen der Rezepte beobachten kann.";padding-top:10px;padding-bottom:20px;display:block;padding-left:0.5em;font-size:16pt}id,updated,author,content{display:none}entry{display:block;border:1px solid gray;margin:0.5em;padding:0.5em;background-color:whitesmoke;list-style:none;color:black}

1
assets/css/sitemap.min.css vendored Normal file
View file

@ -0,0 +1 @@
url{display:block;border:1px solid gray;margin:0.5em;padding:0.5em;background-color:whitesmoke;list-style:none;color:black}urlset:before{content:"Eine Sitemap ist eine Datei, in der Informationen zu dieser Seite stehen. Zum Beispiel welche Unterseiten es hier alles gibt.";padding-top:10px;padding-bottom:20px;display:block;padding-left:0.5em;font-size:16pt}

View file

@ -0,0 +1,33 @@
/* this custom SCSS stylesheet
is under the MIT license
MIT (C) 2022 by L3D <l3d@c3woc.de>
this stylesheet has the purpose
to make the rezept XML Feed more
attractive and graphically enhance it.
*/
feed:before {
content: "Dies ist der XML-Feed, mit dem man Änderungen der Rezepte beobachten kann.";
padding-top: 10px;
padding-bottom: 20px;
display: block;
padding-left: 0.5em;
font-size: 16pt;
}
id,
updated,
author,
content {
display: none;
}
entry {
display:block;
border: 1px solid gray;
margin:0.5em;
padding:0.5em;
background-color:whitesmoke;
list-style: none;
color: black;
}

25
assets/scss/sitemap.scss Normal file
View file

@ -0,0 +1,25 @@
/* this custom SCSS stylesheet
is under the MIT license
MIT (C) 2022 by L3D <l3d@c3woc.de>
this stylesheet has the purpose
to make the sitemap XML Feed more
attractive and graphically enhance it.
*/
url {
display:block;
border: 1px solid gray;
margin:0.5em;
padding:0.5em;
background-color:whitesmoke;
list-style: none;
color: black;
}
urlset:before {
content: "Eine Sitemap ist eine Datei, in der Informationen zu dieser Seite stehen. Zum Beispiel welche Unterseiten es hier alles gibt.";
padding-top: 10px;
padding-bottom: 20px;
display: block;
padding-left: 0.5em;
font-size: 16pt;
}

View file

@ -0,0 +1,4 @@
_template: rezept_feed.xml
---
_model: none
_discoverable: no

View file

@ -0,0 +1,4 @@
_template: sitemap.xml
---
_model: none
_discoverable: no

37
templates/rezept_feed.xml Normal file
View file

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
{%- if '/css/rezeptfeed.min.css'|asseturl is defined -%}
<?xml-stylesheet href="{{ '/css/rezeptfeed.min.css'|asseturl }}" type="text/css" ?>
{%- endif %}
{%- set baseurl = "https://c3woc.de/" -%}
{%- set search = "/rezept" %}
<feed xmlns="http://www.w3.org/2005/Atom">
<title type="text">{%
if bag('translate', this.alt, 'projectfeed') %}{{ bag('translate', this.alt, 'projectfeed') }}{%
else %}Rezepte des C3WOC{% endif %}</title>
<id>{{ this._gid }}</id>
<updated>{{ none|datetimeformat('YYYY-MM-ddThh:mm:ss') }}Z</updated>
<link href="{{ search | url(external=true) }}" />
<link href="{{ this | url(external=true) }}" rel="self" />
<author>
<name>{% if this.author %}{{ this.author }}{% else %}C3WOC{% endif %}</name>
</author>{%
set pages = site.query('/rezept').include_undiscoverable(true).all() %}{%
for page in pages %}{% if not page._hidden %}
<entry xml:base=" {{ page._path | url}}/">
<title type="text">{{ page.title }}</title>
<id>{{ page._gid }}</id>
<link href="{{ page._path | url(external=false) }}" xml:base="{{ '/' | url(external=true) }}" />
<author>
<name>{% if page.author %}{{ page.author }}{% else %}C3WOC{% endif %}</name>
</author>
<content type="text">
{%- if page.meta_description %}
{{ page.meta_description }}
{%- else %}
Hier findet man die Anleitung für {{ page.title }}
{%- endif %}
</content>
</entry>
{%- endif %}
{%- endfor %}
</feed>

View file

@ -1,4 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
{%- if '/css/sitemap.min.css'|asseturl is defined -%}
<?xml-stylesheet href="{{ '/css/sitemap.min.css'|asseturl }}" type="text/css" ?>
{%- endif %}
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{%- for page in [site.root] if page != this recursive %} {%- for page in [site.root] if page != this recursive %}
{%- if not page.hide_from_global_index %} {%- if not page.hide_from_global_index %}