Simple go blog that serves http://oyvindsk.com.
I’m currently using it to test Google Cloud Run. It used to run on App Engine Standard, and I might convert it back in the future. Both are container based PaaS solutions. Run is newer, is Docker based and offers more flexibility. It does lack some App Engine’s features though. Both are fully managed (yay!) and can scale up "infinitely" and down to zero when there’s no traffic (also yay).
Serve pages, blog posts and static files.
Support useful things like RSS and comments (todo)
Generate blog posts from AsciiDoc, styled using the Tachyons css toolkit.
AsciiDoc + metadata => Asciidoc python or asciidoctor, run locally with ./asciidoc-runner => generates html and pdf => Find and load metadata files for pages and blogposts (.toml) => HTML PostProcess: fix some things, like absolute image urls, that are needed for PDFs generation but wrong in the html => HTML PostProcess: remove standard css classes and add Tachyons classes => Go Templates: Put together a complete page from html, metadata and templates => Serve the pdf as well, as an alternative
I’m currently re-writing this with a new layout and cleaner code. It uses an overly complicated way of producing html: Pages and blogposts are written in Asciidoc (similar to Markdown) and styled with the Tachyons CSS toolkit.
This is done mostly for fun, not necessarily recommended for anyone else =)
Asciidoctor generates html you don’t really have any control over. This is usually true for markdown processors as well. You would usually take the default styling (css) or write css customized to the Asciidoc generators html.
But Tachyons does not work this way. It expects you to style by putting the classe you want directly in the html code. See this example for Tailwind CSS, which works in a similar way.
The html coming out of AsciiDoctor does not "work" with Tachyons. Therefore we want to change that, remove the stuff we don’t want (unneeded classes etc) and add Tachyones clases we want.
Processing html is actually not that hard using the golang.org/x/net/html go lib.
See the blogbackend/internal/tachyons/ package.
Fun!
Separation of content (the Asciidoc) from the presentations: 1) Go code + Tachyons, 2) PDF 3) Others, like Docbook?
The asciidoc can later be converted into pdfs, ebooks or alternative html+css with one of the two main AsciiDoc implementations (Asciidoc and Asciidoctor)
AsciiDoc is really nice to write in, hopefully saves me from having to go back and edit old blogposts in the future when I change my layout and design.
AsciiDoc will be useful for writing longer form as well, like an ebook.
-
RSS
-
Tags for blogposts
-
Comments?
-
Cleanup old code, remove "new-"
-
Layouts etc:
-
Footer: flexbox? https://webdevtrick.com/html-css-footer/ https://css-tricks.com/couple-takes-sticky-footer/
-
Nye sider: Home, Hire Me, Projects and Clients, Contact me, Now
-
Image in blogposts: Scale on mobile? midtstill?
-
-
PDFs:
-
Better filename when downloading pdfs
-
Can relative links work in pdfs?
-