Search code examples
jekyll

Jekyll markdown without any layout


I am trying to add a webfinger file to Jekyll (under .well-known/webfinger) in a markdown file (e.g. webfinger.md with the path in the front-matter).

---
layout: null
permalink: /.well-known/webfinger
---
{
  "subject": "acct:[email protected]",
  "aliases": [
    "https://blah.com/@blah",
    "https://blah.com/users/blah"
  ],
  "links": [
    {
      "rel": "http://webfinger.net/rel/profile-page",
      "type": "text/html",
      "href": "https://blah.com/@blah"
    },
    {
      "rel": "self",
      "type": "application/activity+json",
      "href": "https://blah.com/users/blah"
    },
    {
      "rel": "http://ostatus.org/schema/1.0/subscribe",
      "template": "https://mastodon.nz/authorize_interaction?uri={uri}"
    }
  ]
}

I thought that the html would spit out the raw JSON, but it is wrapped with a HTML <p> tag. Is there any way to avoid that?


Solution

  • I've just done the same thing only a few minutes ago. If you change the name of the file to webfinger without the .md extension, then it should work.

    I made the change in https://github.com/mgriffin/mikegriffin/pull/51 and you can see the result at https://mikegriffin.ie/.well-known/webfinger but it downloads the file if you visit it through a browser for some reason...