Oleksandr Gavenko's blog
2021-04-04 18:34 Blog4u has been rewritten to support Markdown

Earlier I stopped posting from 2011 till 2017 while "slowly" built own static blog engine.

In 2017 I managed to convert RST files to HTML and published this time self-hosted blog online (just before starting a job search to keep a journal helping me with an interview preparation).

I made several ridiculous design decisions. The structure of compiled pages made it impossible to host rich content (like supplementary pictures or code).

In 2021 I redesigned generated structure to overcome limitations and added support for Markdown.

All that time (since 2011) I collected more than 10000 articles for publishing. So you'll see some in the near future ))

The main issue with old generated blog structure was difficulty to supplement articles with pictures and code. All generated posts were placed into the root, like:

post-608859f7-a1a7-449b-b0c4-d649942412b0.html
tag-emacs.html
feed-emacs.atom

Origin of such structure: when you have flat structure it is easy to navigate between HTML pages with relative links, no need to worry about base path.

During the design I chose to store a post meta in a separate file:

Another decision was also to keep summary/excerpt in a separate file, otherwise you face the same problems:

New structure is documented and then implemented.

I chose to place each post into separate directory so images and code could be placed nearby and referenced via relative path, like img/stats.png or code/java/App.java.

Other resources began to be stored structurally.

Together that made impossible to browse HTML pages using file: protocol as I started to reference to resources via absolute base path, basically every href= or src= became like:

href="/css/main.css"
href="/post/about-java/post.html
href="/tag/posix.html"
src="/js/main.js"

So I had to set local Web server (Lighttpd) and point it to build directory to test blog generator.

Static blog generator Blog4u is not yet done, still it can convert:

Upcoming work for static blog generator Blog4u is:

For the blog itself I plan automate publishing a bit by setting hg hook on push.

blog, python, markdown, txt, rst

Feeds

all / emacs / java

Tags

adb(1), admin(1), android(1), anki(1), ansible(2), aop(1), blog(2), bytecode(1), c(1), css(2), cygwin(2), driver(1), emacs(3), fs(1), git(3), google(1), gradle(1), hardware(1), hg(2), html(1), interview(13), java(4), js(3), lang(2), lighttpd(1), markdown(1), mobile(1), naming(1), oracle(1), print(1), problem(5), python(1), quiz(6), rst(2), security(3), spring(2), sql(2), srs(1), style(1), tls(2), txt(1), unit(1), utils(1), vcs(3), web(2), win(2), windows(1)

Archive