View Source LastCrusader.Micropub (Last Crusader v0.11.0)

Handles the logic of micro-publishing.

See also:

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

Link to this function

add_keyword_to_post(published_page_url, arg)

View Source

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 }}
Link to this function

publish(headers, params)

View Source

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