Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP, DO NOT MERGE] Adding native integrations to support IndieWeb #118

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

Tristor
Copy link
Contributor

@Tristor Tristor commented Feb 27, 2021

Howdy,

This is a larger patchset than previously, so it's still in the works. I've got initial support for adding an h-card using a shortcode. I've done this on my site by re-doing my intro in my About page. Additionally, I've got posts and the main index/summary page that lists summaries of posts appropriately classed for h-entry, but without any added parameters.

This work is intended to add native support for the IndieWeb into the Blackburn theme, validated by IndieWebifyMe. The goal is to support workflows where site authors can utilize POSSE to reduce their reliance on social media walled gardens like Facebook. Part of my motivations for beginning work on my personal site again is a desire to move away from using Facebook so much myself.

Here's my current todo for this workstream:

  • Rework the h-card shortcode to be more flexible/dynamic.
  • Add an author item into post layouts and summary with the appropriate rel="author" and a class="p-author h-card" attributes linking back to the site's About page. This could be customizable as to where it links by having author name and h-card location in the front matter for posts.
  • Figure out the way p-category is supposed to work, because both topics and tags seem to fit, but if both are marked (as it is now) it creates duplicate entries in the computed category list when parsing the h-entry.
  • Add a timezone reference to <time> entry to meet the requirements for dt-published
  • Add a self-referential URL to the permalink of each post to meet the POSSE requirements of having a u-url attribute
  • Add front-matter support for providing links to syndications with u-syndication
  • Add in basic support for WebMention via some external free service. Daniel Goldsmith has figured out how to integrate this into his Hugo site and written about it which provides a possible pathway. Resultant implementation should validate with webmention.rocks.
  • Expand WebMention support by adding the capability to include Reply Contexts to enable federated comments in replacement of or alongside my earlier addition of Commento

Please do not merge this patch set yet, it is still very much a work in progress. I'm making the PR now so I can have a single place to track this work and also collect comments from @yoshiharuyamashita and others on whether this work would be helpful to upstream or if I should maintain it in a site-specific branch.

…Auth via RelMeAuth is already supported by the structure relme attributes in partials/social.html.
…opulated by the Author value from the site config and a link to /about or it will be populated with what is included in the post frontmatter using the author and authorcard variables. The authorcard variable must be a fully-qualified path to a valid h-card.
…f the p-category taxonomy rules, this most strongly applies to topics only. This change resolves a pending todo list item, as having both tags and topics marked as p-category creates duplicates in h-entry parsed output when tags and topis both contain the same strings.
@Tristor
Copy link
Contributor Author

Tristor commented Feb 27, 2021

Just making a research note here, to keep a record of some of the stuff I'm finding as I'm working on this that may need to go into the documentation:

IndieAuth has some naming confusion going on because IndieAuth is both a protocol, and a service, and the service does not require the use of the protocol. Currently, I've added in a previous commit two integrations with IndieAuth.

One uses the existing RelMeAuth capabilities allowed by the social partial including rel="me" in the social links. Additionally, I added optional support for providing a path to your OpenPGP key in your site config, which can be used a passwordless and decentralized alternative to RelMeAuth to authenticating through IndieAuth.

In either case, I've also added the necessary relations to support using IndieAuth as an OpenID provider, so that you can use your own domain/website to authenticate on any site which supports OpenID. The underlying authentication is provided via RelMeAuth or PGP Key Auth via IndieAuth as a gateway.

@Tristor
Copy link
Contributor Author

Tristor commented Feb 27, 2021

I've modified the Post Meta partial to add an Author element below the date. In order to support this, the logic flow (should be, as I understand my implementation vs current Hugo behavior) that it will use in preference order the provided author name in the post front matter, followed by the author value set in the site config. In either case, the author's name appears as a link, which contains the h-card class and must link to a valid h-card.

In order to support linking to an h-card, it checks to see if the post frontmatter contains an authorcard variable, if so, it is used. If not, it will use the site config's BaseURL + /about/. This assumes, then, that a valid h-card should be present on /about, which may not be a valid assumption (and seems to differ somewhat from a broader IndieWeb expectation that an h-card should be present on the main index).

My recommendation to make use of this would be to set the correct values in the post front matter, as they'll be used as-is. This also means you can theoretically support multiple authors or accurately reflect guest authorship on a site. This should also ensure that the main page has valid h-card references contained on it.

… for the Date of the post. It also makes the date a link which is a self-referential u-url to the Permalink of the post.
@Tristor
Copy link
Contributor Author

Tristor commented Feb 28, 2021

Okay, so my changes to add the author to the Post Meta don't work (I should have tested before pushing, but my local branch structure makes local testing difficult right now... nevermind that). What's interesting is it appears to not work because Hugo originally was designed so that there would be a single author set in the site config (which is how my site is configured and the example site config in the theme currently) but has now been changed so that the .Site.Author variable is a map of identifiers that reference a set of data objects that are supposed to exist in data/_authors in JSON, YAML, or TOML format, each which contains a set of associated data. There's a partial implementation in page_author.go but it doesn't seem finished and the Hugo documentation hasn't been properly updated.

I found a lot out in the process of doing some code spelunking, but it definitely doesn't look as straightforward as it should be in theory for something that is conceptually relatively simple. I've started a support post on the Hugo Discourse to see if anyone in the community can shed some light on the current state of this. I also found an abandoned stale PR where someone had put in a lot of work towards making this a complete implementation but it was never merged.

I think it's possible that authorship is just fundamentally broken in Hugo right now, but I could maybe get it partially working (enough to move this workstream forward at least).

@Tristor
Copy link
Contributor Author

Tristor commented Mar 1, 2021

I've gotten tied up. I will work on this more this weekend, but probably won't touch it this week.

@Tristor
Copy link
Contributor Author

Tristor commented Apr 4, 2021

I haven't forgotten about this. I've just been otherwise tied up. The forum thread linked above actually has a proper answer now, as it seems my question triggered some of the devs to update the docs and reconsider some of the codebase in Hugo. I'm going to pick this back up probably in 2-3 weeks.

@Tristor
Copy link
Contributor Author

Tristor commented Jun 9, 2021

Just wanted to bump this and say I haven't forgotten about it, I'm just pretty tied up and haven't been able to get back to it. It's on my list. I'd also like to write a shortcode for creating recipe inserts that follow the microformats2 h-recipe spec at some point after this as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants