Last active
March 29, 2021 03:53
-
-
Save walt/8da71fead3b8ba321f91efd954f0cb32 to your computer and use it in GitHub Desktop.
JSON Feed template for Movable Type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "https://jsonfeed.org/version/1", | |
"title": "<$mt:BlogName smarty_pants="1" remove_html="1" escape_for_json="1"$>", | |
"home_page_url": "<$mt:BlogURL$>", | |
"feed_url": "<$mt:BlogURL$>feed.json", | |
"description": "<$mt:BlogDescription smarty_pants="1" remove_html="1" escape_for_json="1"$>", | |
"favicon": "<$mt:BlogURL$>favicon.ico", | |
"items": [ | |
<mt:Entries lastn="5"> | |
{ | |
"id": "<$mt:EntryPermalink$>", | |
"url": "<$mt:EntryPermalink$>", | |
"title": "<$mt:EntryTitle smarty_pants="1" remove_html="1" escape_for_json="1"$>", | |
"content_html": "<$mt:EntryBody escape_for_json="1"$>", | |
"summary": "<$mt:EntryExcerpt escape_for_json="1"$>", | |
"date_published": "<$mt:EntryDate utc="1" format_name="iso8601"$>", | |
"date_modified": "<$mt:EntryModifiedDate utc="1" format_name="iso8601"$>", | |
"author": { | |
"name": "<$mt:EntryAuthorDisplayName escape_for_json="1"$>" | |
} | |
}<mt:Unless name="__last__">,</mt:Unless> | |
</mt:Entries> | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I note that your template doesn't have an entry for
tags
(aka categories). I think the following works:JSONfeed doesn't distinguish between tags and categories, so I've combined them. However, because of (I think) the lack of boolean "or", I split this into two parts, one of there are Categories and possibly tags, and another if there are only tags.