refactor: migrate to /blog subdirectory
This commit is contained in:
29
src/_pages/blog/feed/json.njk
Normal file
29
src/_pages/blog/feed/json.njk
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
# Metadata comes from _data/metadata.json
|
||||
permalink: /blog/feed/feed.json
|
||||
---
|
||||
{
|
||||
"version": "https://jsonfeed.org/version/1.1",
|
||||
"title": "{{ metadata.title }}",
|
||||
"language": "{{ metadata.language }}",
|
||||
"home_page_url": "{{ metadata.url | addPathPrefixToFullUrl }}",
|
||||
"feed_url": "{{ permalink | htmlBaseUrl(metadata.url) }}",
|
||||
"description": "{{ metadata.description }}",
|
||||
"author": {
|
||||
"name": "{{ metadata.author.name }}",
|
||||
"url": "{{ metadata.author.url }}"
|
||||
},
|
||||
"items": [
|
||||
{%- for article in collections.articles | reverse %}
|
||||
{%- set absoluteArticleUrl = article.url | htmlBaseUrl(metadata.url) %}
|
||||
{
|
||||
"id": "{{ absoluteArticleUrl }}",
|
||||
"url": "{{ absoluteArticleUrl }}",
|
||||
"title": "{{ article.data.title }}",
|
||||
"content_html": {% if article.templateContent %}{{ article.templateContent | transformWithHtmlBase(absoluteArticleUrl, article.url) | dump | safe }}{% else %}""{% endif %},
|
||||
"date_published": "{{ article.date | dateToRfc3339 }}"
|
||||
}
|
||||
{% if not loop.last %},{% endif %}
|
||||
{%- endfor %}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user