bmann / microglue

A small glue API server to create a micropub endpoint that can publish to Jekyll and other static sites via git
MIT License
6 stars 0 forks source link

Support Jekyll-compatible front matter #3

Open bmann opened 5 years ago

bmann commented 5 years ago

Jekyll is the initially supported static site generator we want to target, especially when it is also hosted on GitHub Pages.

Along with the body of the post, Jekyll requires “front matter” — metadata at the top of text files. See https://jekyllrb.com/docs/frontmatter/

The server needs to accept a micropub formatted posted from microblog as per #1 and then create a Jekyll compatible markdown text file and push it to the Git repo.

The default front matter should look like this:

---
layout: post # use this as default for now; post is usually a default layout so should work out of the box
title: 
date: # publish date
categories:
tags:
micropub: true # this allows layout / theme / other logic to know this post came from microglue / is micropub compatible
---

The rest of the file should include the body of the content.

TO DO:

bmann commented 5 years ago

@patdryburgh I know you had more front matter. I trimmed it to be more “Jekyll minimal”. eg I know you put “published” as one entry. Is that a true/false or a published date? And permalink I personally only use for pages and set in config for posts.

Can you please document the front matter you use and what you use the entries for?

And review what I’ve written here to see if it makes sense.

This should be configurable, but it would be nice if it “just worked” on a first test, without special layout, and then users could edit config files and/or their own Jekyll site to customize it.

patdryburgh commented 5 years ago

@bmann Published is a Boolean that allows you to save posts as drafts. It is true by default, and I don’t think we need to support draft posts at this time, so I’m good to drop it.

Also good to drop Permalink for the reasons you’ve given.

The only other fields we may consider — though it’s debatable whether they’re required for an MVP — are:

The only custom variable I’ve started to use is audio for my podcast, but I’m not sure what apps like Wavelength for Micro.blog are doing for this.

Everything else looks 👍😊