diff --git a/docs/_blog/feed_template.xml b/docs/_blog/feed_template.xml new file mode 100644 index 00000000..06087d78 --- /dev/null +++ b/docs/_blog/feed_template.xml @@ -0,0 +1,127 @@ +--- +layout: none +permalink: feed/blog.xml +title: "Research Object Crate (RO-Crate) | Blog" +--- + + +{% if page.xsl %} + +{% endif %} + + Jekyll + + + {{ site.time | date_to_xmlschema }} + {{ page.url | absolute_url | xml_escape }} + + {% if page.title %} + {{ page.title | xml_escape }} + {% endif %} + + {% if site.description %} + {{ site.description | xml_escape }} + {% endif %} + + {% if site.feed.icon %} + {% assign feed_icon = site.feed.icon %} + {% unless feed_icon contains "://" %} + {% assign feed_icon = feed_icon | absolute_url %} + {% endunless %} + {{ feed_icon | xml_escape }} + {% endif %} + + {% if site.feed.logo %} + {% assign feed_logo = site.feed.logo %} + {% unless feed_logo contains "://" %} + {% assign feed_logo = feed_logo | absolute_url %} + {% endunless %} + {{ feed_logo | xml_escape }} + {% endif %} + + {% if site.author %} + + {{ site.author.name | default: site.author | xml_escape }} + {% if site.author.email %} + {{ site.author.email | xml_escape }} + {% endif %} + {% if site.author.uri %} + {{ site.author.uri | xml_escape }} + {% endif %} + + {% endif %} + + {% assign posts = site.blog | where_exp: "post", "post.layout == 'post'" %} + {% assign posts = posts | sort: "date" | reverse %} + {% assign posts_limit = site.feed.posts_limit | default: 10 %} + {% assign current_date = "now" | date: '%s' | integer %} + {% for post in posts limit: posts_limit %} + {% unless site.future %} + {% assign post_date = post.date | date: '%s' | integer %} + {% if post_date > current_date %} + {% continue %} + {% endif %} + {% endunless %} + + + {% assign post_title = post.title | smartify | strip_html | normalize_whitespace | xml_escape %} + + {{ post_title }} + + {{ post.date | date_to_xmlschema }} + {{ post.last_modified_at | default: post.date | date_to_xmlschema }} + {{ post.id | absolute_url | xml_escape }} + {% assign excerpt_only = post.feed.excerpt_only | default: site.feed.excerpt_only %} + {% unless excerpt_only %} + + {% endunless %} + + {% assign post_author = post.author | default: post.authors[0] | default: site.author %} + {% assign post_author = site.data.authors[post_author] | default: post_author %} + {% assign post_author_email = post_author.email | default: nil %} + {% assign post_author_uri = post_author.uri | default: nil %} + {% assign post_author_name = post_author.name | default: post_author %} + + + {{ post_author_name | default: "" | xml_escape }} + {% if post_author_email %} + {{ post_author_email | xml_escape }} + {% endif %} + {% if post_author_uri %} + {{ post_author_uri | xml_escape }} + {% endif %} + + + {% if post.category %} + + {% elsif post.categories %} + {% for category in post.categories %} + + {% endfor %} + {% endif %} + + {% for tag in post.tags %} + + {% endfor %} + + {% assign post_summary = post.description | default: post.excerpt %} + {% if post_summary and post_summary != empty %} + + {% endif %} + + {% assign post_image = post.image.path | default: post.image %} + {% if post_image %} + {% unless post_image contains "://" %} + {% assign post_image = post_image | absolute_url %} + {% endunless %} + + + {% endif %} + + {% endfor %} + diff --git a/docs/_config.yml b/docs/_config.yml index 8d938e66..ff9ffc2e 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -107,6 +107,11 @@ collections: permalink: /blog/:path output: true +feed: # RSS/Atom feed settings, used in _blog/feed_template.xml + logo: assets/img/ro-crate.svg + icon: assets/img/favicon.ico + posts_limit: 100 + theme_variables: topnav: theme: light @@ -115,10 +120,6 @@ theme_variables: twitter: false theme_color: 39989F -feed: # RSS/Atom feed settings - collections: - - blog - plugins: - elixir-toolkit-theme-plugins - jekyll-redirect-from