View Source LastCrusader.Micropub (Last Crusader v0.11.0)
Handles the logic of micro-publishing.
See also:
LastCrusader.Micropub.Hugo
LastCrusader.Micropub.Github
Summary
Functions
Adds a keyword to a published post (most of the time, it will be the syndication link).
Adds a comment to a post into Github repo. It checks that the commented page exists in the Github repo (not on the real website).
Publishes as Hugo post to Github repo
Functions
Adds a keyword to a published post (most of the time, it will be the syndication link).
Adds a comment to a post into Github repo. It checks that the commented page exists in the Github repo (not on the real website).
To make it work in Hugo, you have to publish your content as Pages Bundles. In your post template, include the following partial:
{{ partial "comments.html" . }}
The Hugo partial ("comments.html") to display comments looks like this:
{{ $comments := (.Resources.Match "comments/*yml") }}
{{ range $comments }}
<li>
<i class="fas fa-reply"></i>
{{ $comment := (.Content | transform.Unmarshal) }}
<a href="{{ $comment.link }}">{{ $comment.author }}</a> le {{ substr $comment.date 0 10 }} :
{{ $comment.comment | markdownify }}
</li>
{{ end }}
Publishes as Hugo post to Github repo:
- checks auth code and scope
- discovers post type
- transforms it as a Hugo post
- commits to Github repo
- schedules sending webmentions if needed