Tuesday December 21, 2021; 4:00 AM EST
- Here's my first working version to parse an OPML blog outline to "11ty" Markdown templates #
- Fetch the outline from drummer.scripting.com#
- With opml.parse read the outline into an object#
- Find all nodes with type of 'outline' that have subs (as an array, I'm ignoring titleless posts for now)#
- For each node#
- title is the node text#
- date is the created attribute (as a Date object)#
- Create a textArray of the text of all subs (ignoring hierarchy for now) #
- Append the textArray entries to a body string separated by two returns (one return if within a code block, designated with "```" Markdown syntax)#
- Push {title, date, body} to a results array#
- Return the results array to 11ty #
- This array can be used by 11ty as data in a paginated template (pagination is an 11ty feature to render several files from a single template).#