Hey. Wondering if it’s even possible to do this: I want to host a static page for an event on my Micro.blog. But I’d like the page to be standalone. No navigation, no footer, no site name. Just the information regarding the event.
I can have the same CSS, that’s ok.
Read a few posts here, and went to town.
Created a content/event.md file, and got the normal page.
The front matter has “event” as type, so I copied the baseof.html and the single.html layouts to layouts/event/ and started trying to figure out what I’d have to delete, and what to keep to have it working.
But then I started wondering if I’d have to do the same to head.html and header.html, and if what I’m looking for is even possible. Maybe it’s even simpler and I don’t have to do all this.
At the moment I have a working solution at GitHub Pages, but on a different domain, and would really love to host it here.
The only thing that will definitely be there is what’s in your baseof template. So if your header and footer are partials that are included in baseof, you will have to remove them and move them somewhere else in order to achieve this.
One way to host static HTML pages (or any file) is to put them in the static directory. For example, say you have a file on your computer called event.html, and you want to host it on your Micro.blog. Create a new template named static/event.html and paste the content there. The page will be reachable at https://your.micro.blog/event.html.
If you want a prettier and shorter URL without the .html file ending, you can name the template static/event/index.html instead. Then, the URL will end up https://your.micro.blog/event/.
Yes, it’s mentioned in the docs. It’s unlikely that regular Micro.blog customers stumble upon it, though, as static file hosting is a feature targeted at theme builders and plug-in developers.
You can add them as static files under the “static” folder in the plug-in.
For example, if you want to include a CSS file named “hello.css” in your plug-in, it would be stored at “static/hello.css” and referenced in includes with the path “/hello.css”.