From c95a16e2259b0ee110a5987bf305628f2b99448a Mon Sep 17 00:00:00 2001 From: L3D Date: Fri, 6 May 2022 00:54:43 +0200 Subject: [PATCH] updating feeds --- assets/css/rezeptfeed.min.css | 1 + assets/css/sitemap.min.css | 1 + assets/scss/rezeptfeed.scss | 33 +++++++++++++++++++++++++ assets/scss/sitemap.scss | 25 +++++++++++++++++++ content/feed_rezepte.xml/contents.lr | 4 +++ content/sitemap.xml/contents.lr | 4 +++ templates/rezept_feed.xml | 37 ++++++++++++++++++++++++++++ templates/sitemap.xml | 3 +++ 8 files changed, 108 insertions(+) create mode 100644 assets/css/rezeptfeed.min.css create mode 100644 assets/css/sitemap.min.css create mode 100644 assets/scss/rezeptfeed.scss create mode 100644 assets/scss/sitemap.scss create mode 100644 content/feed_rezepte.xml/contents.lr create mode 100644 content/sitemap.xml/contents.lr create mode 100644 templates/rezept_feed.xml diff --git a/assets/css/rezeptfeed.min.css b/assets/css/rezeptfeed.min.css new file mode 100644 index 0000000..35fc9a5 --- /dev/null +++ b/assets/css/rezeptfeed.min.css @@ -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} diff --git a/assets/css/sitemap.min.css b/assets/css/sitemap.min.css new file mode 100644 index 0000000..0e63341 --- /dev/null +++ b/assets/css/sitemap.min.css @@ -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} diff --git a/assets/scss/rezeptfeed.scss b/assets/scss/rezeptfeed.scss new file mode 100644 index 0000000..fe2b72f --- /dev/null +++ b/assets/scss/rezeptfeed.scss @@ -0,0 +1,33 @@ +/* this custom SCSS stylesheet + is under the MIT license + MIT (C) 2022 by L3D + + 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; +} diff --git a/assets/scss/sitemap.scss b/assets/scss/sitemap.scss new file mode 100644 index 0000000..d248c9d --- /dev/null +++ b/assets/scss/sitemap.scss @@ -0,0 +1,25 @@ +/* this custom SCSS stylesheet + is under the MIT license + MIT (C) 2022 by L3D + + 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; +} diff --git a/content/feed_rezepte.xml/contents.lr b/content/feed_rezepte.xml/contents.lr new file mode 100644 index 0000000..5fa8eb2 --- /dev/null +++ b/content/feed_rezepte.xml/contents.lr @@ -0,0 +1,4 @@ +_template: rezept_feed.xml +--- +_model: none +_discoverable: no diff --git a/content/sitemap.xml/contents.lr b/content/sitemap.xml/contents.lr new file mode 100644 index 0000000..ffd5fad --- /dev/null +++ b/content/sitemap.xml/contents.lr @@ -0,0 +1,4 @@ +_template: sitemap.xml +--- +_model: none +_discoverable: no diff --git a/templates/rezept_feed.xml b/templates/rezept_feed.xml new file mode 100644 index 0000000..5724066 --- /dev/null +++ b/templates/rezept_feed.xml @@ -0,0 +1,37 @@ + +{%- if '/css/rezeptfeed.min.css'|asseturl is defined -%} + +{%- endif %} +{%- set baseurl = "https://c3woc.de/" -%} +{%- set search = "/rezept" %} + + {% + if bag('translate', this.alt, 'projectfeed') %}{{ bag('translate', this.alt, 'projectfeed') }}{% + else %}Rezepte des C3WOC{% endif %} + {{ this._gid }} + {{ none|datetimeformat('YYYY-MM-ddThh:mm:ss') }}Z + + + + {% if this.author %}{{ this.author }}{% else %}C3WOC{% endif %} + {% + set pages = site.query('/rezept').include_undiscoverable(true).all() %}{% + for page in pages %}{% if not page._hidden %} + + {{ page.title }} + {{ page._gid }} + + + {% if page.author %}{{ page.author }}{% else %}C3WOC{% endif %} + + + {%- if page.meta_description %} + {{ page.meta_description }} + {%- else %} + Hier findet man die Anleitung für {{ page.title }} + {%- endif %} + + + {%- endif %} +{%- endfor %} + diff --git a/templates/sitemap.xml b/templates/sitemap.xml index 0c524e8..95680f4 100644 --- a/templates/sitemap.xml +++ b/templates/sitemap.xml @@ -1,4 +1,7 @@ +{%- if '/css/sitemap.min.css'|asseturl is defined -%} + +{%- endif %} {%- for page in [site.root] if page != this recursive %} {%- if not page.hide_from_global_index %}