Posting API

What’s the capability of weblog to incorporate an API for posting from apps like Ulysses and iA Writer (similar to what they use to publish/edit posts to Wordpress, Ghost, and Micro.blog)? I believe they have various endpoints such as XML-RPC and Micropub. This would provide a great middle ground to post from apps, without having to go full-on git.

1 Like

I don’t know about those apps, but at one point I was regularly publishing to the weblog.lol API from Apple Shortcuts.

1 Like

I still haven’t had a chance to really dig into all of the various standards, but from the last time I began to scratch the surface, I came away with the early impression that Micropub was the way to go for weblog.lol. I know iA Writer supports it (not sure about Ulysses). I just need to find the time to really hunker down and explore how it all works so I can try to support it!

1 Like

Unless I missed it, Ulysses supports Micro.blog but not micropub that I can see (thought it had both).

1 Like

Oh wow, I was about to ask if it was possible to create a Micropub endpoint for weblog.lol.

Here’s the latest officially-published reference for Micropub:
https://www.w3.org/TR/micropub/

Here’s the short version:
https://indieweb.org/Micropub

weblog.lol has an API, but IIRC it doesn’t support microformats by default. (TBF people can code the microformat markup in the templates themselves.)

1 Like

Honestly, I find microformats to be really clunky and unintuitive. I’ve had to work with them via Micro.blog theming, and I still don’t understand how they work, nor how to implement them correctly.

1 Like

That’s fair. It took me a while to learn microformats.

I don’t have personal experience with micro.blog. But ideally whichever CMS one uses, one can edit the HTML for their website, because the microformat class tags need to be inside the HTML.

The following is a summary of what I understand about microformats, so someone please correct me if I got something wrong.

h-card

  • Think of this as your calling card, so either <div>, <span>, or <p> enclose the information.
  • u-photo: Link to your profile picture, so should be inside <img>
  • p-name: Your name, so any formatting tag can include it
  • u-url: Link to your homepage, which may or may not be the same as your blog; should be inside <a>

This is the bare minimum for a working h-card. For my weblog, I’ve placed this code in the footer:

<p class="h-card vcard">
	<img src="https://cdn.some.pics/darylsun/645afaf7dd9f7.webp" alt="Young woman in deep violent V-neck shirt" class="u-photo photo" style="margin-left: auto; margin-right: auto" />
	<br />
	Copyright © 2023 <a href="https://darylsun.page/" class="p-name u-url u-uid fn url uid" rel="me">{author}</a>. All rights reserved.
</p>

Yes, I combined the markup for p-name and u-url. The other classes are just optional markup I’ve included.

h-entry

  • This encloses the entire post. div, span, p, and article can work.
  • p-name: Title of the post, so <h1>; for notes or statuses, this should NOT be included
  • e-content: Body of the post, so <p>
  • dt-published: Date and time that the post was published; theoretically, any formatting tag can work?
  • p-author: Your name again; some people turn this into another h-card
  • u-url: Canonical URL/permalink of the post; inside <a>

There are other classes in the h-entry spec, but these above are the minimum that Indiewebifyme looks for.

The relevant code on my weblog:

<article class="h-entry hentry">
	<h1 class="p-name">{post-title}</h1>
	<span class="e-content entry-content">{titleless-body}</span>
	<aside class="post-info">
		<i><a href="{permalink}" class="u-url u-uid url uid" rel="bookmark">Published <time class="dt-published published">{date}</time></a> by <a href="https://darylsun.page/" class="h-card vcard p-author author" rel="me author" style="font-style: italic"> {author}</a></i>
	</aside>
	<aside class="post-tags p-category" rel="category tag">
		{tags}
	</aside>
</article>

Some people just combine the markup for dt-published and u-url, but I didn’t :sweat_smile:

I hope this guide helps! If not, you can ask me questions and I’ll try to answer them as best as I can.

2 Likes

Micro.blog has the ability to edit HTML, so this can definitely be controlled. I’ve typically just left these classes in when using other themes as a base for mine. This is without knowing what they were for. :slight_smile: Thanks for your explanation though, that adds some context.

2 Likes