Ask HN: What is setup for your static blog generator?

70 points by chauhankiran ↗ HN
I have tried Jekyll, Hexo and few other static blog generator but not happy with theme. I want to build something in which I have total control. Like I have few scss/css files, few markup files and some other templates for design and based on them I can create a complete html files so that I can publish them on GitHub.

Many of you might have some scripts that generate your blog posts from some setup. If it is possible then can you share your setup configuration?

I am looking for following things with setup:

* I should have backup of my all posts if I want to move other other configuration. * I can easily tweak css or html. * I can generate a complete html blog that can be publish over GitHub or any other places.

97 comments

[ 3.2 ms ] story [ 121 ms ] thread
(comment deleted)
makefile + rst2html
I wrote one a while back. It uses git, webhook to auto publish blog posts.

Here's the git repo https://github.com/snehesht/blog

Nice. I'd be interested in opening a PR for the 'Social Buttons ( HN, Twitter )' in your todo-- Do you still maintain?
I use Hakyll, which is a Haskell clone of Jekyll. I wouldn’t recommend it unless you are already proficient in Haskell and Haskell is your favorite language, but it does give you total control: write a few markdown files, your own HTML templates, your own CSS, etc.
This will probably forever be too half-baked to "release", but I wrote my own: https://github.com/jakelazaroff/adjective

It's written in Node and features multithreading and incremental builds for fast development.

I host on Netlify, which has continuous integration built in, so it builds and deploys the site every time I push to GitLab.

I'm also using Netlify (with Hugo). Their service is simple to use, and send to work quite well.
Github pages + Bash + Python script. I have a very simple page layout for posts. A drafts directory maintains ASCIIDoc files for posts I'm writing.

After writing I run `post.sh` with the file as the argument. It invokes a Python script which generates the HTML and puts it in a directory for published posts sorted by date/month/year (e.g. published/2018/01/29). The Bash script generates a directory/link listing and an index page for the blog roll, followed by a "git push".

I run https://blog.jeaye.com/ on Github Pages, but I manually build with Jekyll locally, with a publish script, and then force push the built site + assets to the gh-pages branch. This allows me to use all sorts of Jekyll plugins which Github won't whitelist.

I'm currently writing a post detailing how all of this works, for anyone interested.

    git subtree push --prefix build origin gh-pages  
  
is a nice simple way to push your build directory to the gh-pages branch.
> I'm currently writing a post detailing how all of this works, for anyone interested.

Yes please. I need to support localisation on a site I maintain, and for that will need one (or more) plugins that github don't support so would be interested in your setup.

Not a direct answer, but I just wanted to point out how handy it is that you can publish to your public keybase directory, and have it hosted at keybase.pub, something like this:

https://abhi.keybase.pub/2016/02/15/git-and-keybasefs.html

The general gist is that keybase.io is promising that it will only serve data at abhi.keybase.pub that has been signed for by that user.

This is brilliant information. Thanks for sharing it.
I have Jekyll setup (not recommended, see below) to generate my sites in a Docker container. The builder container outputs my websites into a volume that's shared with nginx. I have shared assets for multiple websites and had to create a custom plugin to support this setup in Jekyll:

https://github.com/sumdog/jekyll-multisite

There are open issues and pull requests for the plugin. I started building a test suite so I could start doing tests against multiple Jekyll versions and make it more universal, but it currently fails tests even with the same Gemfile/lockfiles.

Currently I have to keep my site pegged to Jekyll 3.0.1 because of all the custom plugins I've written, and think Jekyll-multisite might be tied directly to my build. :( I've put little effort into it lately since Jekyll themes are suppose to address the multi-site capabilities. I just keep it building a a docker container so I can use the older version without trouble.

I have that nginx container running behind the official HAProxy container and have Certbot running in its official container as well. I have a guide on how to set this up including all the Dockerfiles on github that you can use and modify:

http://penguindreams.org/blog/bee2-automating-haproxy-and-le...

As you can see, my blog isn't on the new setup yet (no https/letsencrypt). I'm working on that though, and hope to have it all migrated over this week.

I would NOT recommend Jekyll if I was starting again. I had to do a lot of hacking and custom ruby coding to get really basic things I wanted working. Under the shell of Jekyll is a huge mess. It likes to iterate over things .. a lot .. all the time, for everything. Lots of the path resolution stuff is broken and lots of Jekyll is built around github pages, making some things impossible without violating the security model.

I wouldn't recommend trying to fit a square peg into a round hole either.
I use Hugo (https://gohugo.io) on my local machine to create the website and upload the resulting static site to the server via rsync. The website templates and CSS sheets are all custom, so I get total control over the result.
For anyone interested I created a privacy focussed theme for Hugo, with no third party scripts or assets:

https://github.com/lucaspiller/hugo-privacy-cactus-theme

I wanted a minimalist theme that's fast to load, but a lot of commonly cited examples are too extreme or look too dated for my liking. I wanted the same results, but something a bit more up to date and with code highlighting. You can see the end result on my blog (total network transfer 78kB):

http://www.stackednotion.com/blog/2016/07/09/setting-up-a-ne...

same here, I had created my custom themed html templates and css for pelican, but recently moved everthing to hugo. Complete control, no third party dependencies, no javascript (outside of pages with ttyrec recordings) and extremely fast to regenerate. Note this does assume you do your css preprocessing/minifying outside of Hugo though (I use compass), from Hugo's perspective your css is just another file.
I use Jekyll for most of my blogs. For my company's, we needed multiple authors including non-technical people, so we couldn't use git for that. I recently discovered Ghost which I highly recommend:

* https://ghost.org/

* Kickstarted in 2013

* Markdown-based

* Open source, self-hostable

* Hosted solution (https://ghost.org/pricing/) with support for your own domain name

* Beautiful themes out of the box with custom css/js on an article, site-wide or theme level

* Third party static site generation tools (https://github.com/axitkhurana/buster/, https://github.com/lexoyo/static-ghost)

Example blog (default theme): https://blog.ghost.org/

I've been using Ghost for a few years now, mostly because it interested me and looked nice to use. I've gone through a bunch of static blog generators and while they were cool (and cheap) I just really like the ability to login to my site, start drafting, have it auto-save and come back to it later. I'm not super fussed about having it version controlled, though I can export all my data (minus images) into a JSON format and version control that if I want.

I self host on the lowest Digital Ocean droplet which is now $5/mo and is plenty for my small time blog and I'm happy to pay $5/mo for the delight of using Ghost. Also with a cron job I can auto-update every few days and get the latest features without touching the box.

Ghost will auto-roll back if an update fails which is nice and I don't have that many viewers so if it goes down I don't mind so much right now.

A final bonus is that it uses handlebars for it's theme creation and rendering. I'm a node dev who uses handlebars for my own projects so editing my theme is a breeze.

You mention trying Jekyll, etc, but not what doesn't work about them for you.

Jekyll really does give you full control. It also powers some pretty large websites. Breitbart.com and Forthepeople.com (shameless plug) spring to mind.

Jekyll for my podcast's web site (https://allthingsgit.com/). I became a fan of Jekyll when I worked at GitHub, but I don't use GitHub Pages, I needed to scale it larger. (edit: in particular, I needed something that can host audio and video.) So my workflow is GitHub for hosting, and Visual Studio Team Services for CI builds. It monitors the GitHub repository and on commits to master, it runs Jekyll in a docker container. It then deploys to Azure, where I host the static web site. (I use Azure CDN for hosting the audio episodes.)

I would use VSTS for the whole pipeline, including the Git repository hosting, but I wanted to have a public repository, in case listeners wanted to submit pull requests. So far that hasn't happened, so I'm missing out on some of the VSTS features, but maybe it still will.

I also have a weekly newsletter (https://developertoolsweekly.com/) that uses a static site generator that I build myself. It's very Jekyll-inspired and uses Liquid templates, but instead of generally processing markdown, it takes a simple list of links and descriptions and emits a website as well as the HTML and plain text for the emails.

This workflow is similar, the generator is run in a Docker container, but this workflow is entirely VSTS and Azure.

Jekyll was slow and hard to customize. A tiny script can convert a template + a directory of markdown files to a blog pretty easily.

Less code and configuration makes it easy to add custom features; I stuck incremental rebuilds and hot reloading into my blog while keeping it below 70 LOC:

https://github.com/1wheel/roadtolarissa/blob/master/index.js

(comment deleted)
I generate html from templates which are html interspersed with js. JS is used to generate the dynamic parts. A simple js program prepopulates some data structures and hands it over to the template. Once html files are generated I put them up on S3. I write the posts in HTML because I've generally had bad luck with getting markdown to get things to look exactly as i want them.
We use https://processwire.com for our blog and future more content sections. It's kind of a static generator which creates JSON-Files with meta-information and the rendered HTML-maincontent. The static processing is made with ProCache module and a python script which loads an sitemap and requests all sites each 1-2 hours.

we choosed this setting because we wanted the content-heavy parts in an easy to handle CMS (from a editor perspective). We wanted to integrate the content in our main webshop and not with a subdomain and between our main header and footer coming from our main webshop system (sap hybris).

show hn: https://www.blue-tomato.com/blue-world/