sitewriter icon indicating copy to clipboard operation
sitewriter copied to clipboard

Content updates

Open gerwitz opened this issue 7 years ago • 1 comments

I would love to support update scenarios, which I have a plan for. I'd also like “add to the existing metadata” as a possibility, but I think that’s too likely to limit our publishing options.

Webmentions and other features may want to update (not replace) a post's content. Once we have #10 we ought to be able to retrieve existing content, but then we need to target the update.

Let's start with a simple substitution approach. Say you include {{webmentions_list_html}} in a template, then you’d have something detectable like:

<!-- sitewriter:webmention_list -->
<ul>
<li><a href=“url”>mentioning post title</a></li>
</ul>
<!-- /sitewriter:webmention_list -→

…and when a new webmention comes in the service can retrieve the current post, find this markup, and replace the contents.

There could be a webmention_list_markdown and even a webmention_list_yaml for power users that want it in metadata for their templates to handle.

HTML comments probably don't always work, so we'll have to add an awareness of content format type so we can select how to demarcate.

gerwitz avatar Apr 11 '18 07:04 gerwitz

How do we do this with YAML, for adding syndication URLs? Perhaps {{syndications_list_yaml}} produces:

---
title: Testing
syndicated-to:
# sitewriter:syndications_list
- https://twitter.com/gerwitz/status/42232
# /sitewriter:syndications_list
---

gerwitz avatar May 08 '19 13:05 gerwitz