custom blog platform?

So i was planning to create a custom blog platform for myself, so that i can do stuff easily. I don't want any database stuff (kind of flat-style blog)
Here's how i want to do it:

  1. Blog posts are stored as markdown files
  2. A special script should run these markdown files and produce static website content, using some theme and create a folder which contains the html file and assets.
  3. Comments could be handled by disqus
  4. I don't mind uploading generated content to my website, as i have rsync running.

Now, as a beginner, I am thinking on how to accomplish this task. Should I use twig templating engine? Or is there any other way to do it? Thanks

PS: I have looked on Grav, it's good, but way too many features. I want a simple and static blog. Please don't provide names of blog systems, I want to build a custom system.

Comments 2

  • Thanks for starting this discussion! This is an interesting topic. Building an entire static blog platform is a lot of work. It seems easy at first, but when you consider the basic blog features like tag pages, categories, search, author bios it quickly goes out of hand.

    Of course it is possible to build it and learn a lot in the process. Any programming language would do. If you go with node, there are lots of libraries on NPM that you can use. Basically you will need to read markdown and transform it to static HTML pages.

    You can also look into the many existing open source static site generators like Jekyll and Hugo. You can find more here.

  • So I made a theme, and used a simple python script to convert markdown like template (actually a text file) to html by parsing it through the theme. (Theme was made using twig like templating)
    Directory Structure is as follows:

    /my-website/
        /skeleton-posts/
                post1.txt
                post2.txt
        /theme/
        /generated-site/
                /css/
                /js/
                /img
                /blog/
                                /post-1/
                                                    index.html
                                /post-2/
                                                    index.html
        generator.py

    Each index.html under posts of generated site is linked to common css, js directories, to prevent multiple callbacks.

    Now can you help me create the main index page, which should list all these blog posts, along with pagination (see image below, I would like to make it similar to that of tutorialzine, using cards!). I'm a bit poor in javascript and php, so any help would be greatful!

    17a9FSA.png