Ask HN: What is setup for your static blog generator?
70 points| chauhankiran | 8 years ago | reply
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.
[+] [-] nathan_f77|8 years ago|reply
Netlify is like Heroku for static sites. You can connect Netlify to GitLab (free private repos), and Netlify will build and deploy your site when you git push. I also use the Netlify nameservers for many of my domains, and it's really easy to set up SSL with Let's Encrypt. I can buy a domain on Namecheap, and have a new blog or landing page deployed in less than 5 minutes.
* https://gohugo.io/
* https://gitlab.com/
* https://www.netlify.com/
[+] [-] alwillis|8 years ago|reply
The goal is to have Ruby 3 run 3× faster than Ruby 2.0; Ruby 2.5.0 is at 165% of Ruby 2.0 right now: https://appfolio-engineering.squarespace.com/appfolio-engine...
[+] [-] seanwilson|8 years ago|reply
[+] [-] andrei_says_|8 years ago|reply
These are the things that keep me with Jekyll and middleman.
[+] [-] scrollaway|8 years ago|reply
* 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/
[+] [-] bluehatbrit|8 years ago|reply
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.
[+] [-] gmueckl|8 years ago|reply
[+] [-] lucaspiller|8 years ago|reply
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...
[+] [-] tetraodonpuffer|8 years ago|reply
[+] [-] sago|8 years ago|reply
Then your scss/less->css is probably best done with the command line compiler, driven from your build tool.
And for HTML, take a template language you enjoy and write a simple driver script. If you want multiple templates, add metadata to your source files. In my case I want Markdown->HTML, using various templates, so I use YAML for the metadata, then Python's markdown compiler, and finally Jinja2 for templating. Again you can write the driver in a few dozen lines for your own purpose.
My build tools then calls The AWS API to send it to its S3 bucket, in most cases. But in one it commits to a github pages branch and pushes.
It is exceptionally simple to code your own static site generator, if you can do basic command line scripting. And doing it that way allows you to be very flexible and add things like uploading, version control, etc.
I think it's better off seen as a command line tool, than a special 'static blog generator' task. In general I think we are erring too far on the 'build a niche vertical app' rather than 'automate powerful general-purpose tools'.
[+] [-] zeroping|8 years ago|reply
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.
[+] [-] dcreemer|8 years ago|reply
[+] [-] jakelazaroff|8 years ago|reply
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.
[+] [-] dcreemer|8 years ago|reply
[+] [-] stevenicr|8 years ago|reply
add a plugin from the repo "simply static" - generate the html files.
download, then ftp.
It's not elegant and lean like the others - but it's saved me a ton of time for the use cases I've used it for.
There is another decent static generator in the repo, but it failed on a recent site I was trying yesterday, so it's not on my currently using list.
I know it's possible to put wp dynamic files on a server and use a domain mapping plugin to generate files for a bunch of domains on the same server easily - could probably find someone smarter than me to add in this simply static plugin and mod it to shoot the files to the sub domains...
then just install a bunch of themes and other plugins to the main install - and might be kind of heavenly for a lot of situations.
Some of my wp sites need contact forms - so I'm leaving those live / dynamic. If it was easier to make and upload something like the coffee cup form builder files I'd convert a few more sites to static files this week.
If someone found a way to use the wordpress themes with these other generators it would be awesome. Then it would just be the few sites that need the extra plugins power that really need the wordpress php files and such. One can dream.
[+] [-] viraptor|8 years ago|reply
[+] [-] beisner|8 years ago|reply
[+] [-] ethomson|8 years ago|reply
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.
[+] [-] rayalez|8 years ago|reply
https://startuplab.io/blog
It's very flexible, written in python, easy to customize, has plugins for any purpose.
I've made a custom theme, configured pelican a bit, and served with nginx on digital ocean(but it could as well have been served for free on github pages).
You can see the code and my custom theme here:
https://github.com/raymestalez/startuplab
[+] [-] CogDisco|8 years ago|reply
[+] [-] gshrikant|8 years ago|reply
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".
[+] [-] 1wheel|8 years ago|reply
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
[+] [-] rwieruch|8 years ago|reply
- [0] https://gohugo.io/
- [1] http://themes.gohugo.io/
- [2] https://pages.github.com/
- [3] https://www.digitalocean.com/
- [4] https://www.robinwieruch.de/own-website-in-five-days/
- [5] https://www.robinwieruch.de/deploy-applications-digital-ocea...
[+] [-] cperciva|8 years ago|reply
Happy to share with anyone who wants it. Some day I'll get around to putting it up on github.
[+] [-] deadcoder0904|8 years ago|reply
Then now. Personal opinion but I love Gatsby ( https://www.gatsbyjs.org ). For me, it is the best static site generator out there. Yes more than static site generator as it is a PWA by default. It is infinitely scalable. It prefetches content before its loaded (think about this as you get the data of Previous Blog Post & Next Blog Post when you are on the Current Blog Post). Its so fast that you will actually feel the speed. Also, with little efforts you can make it work offline too.
[+] [-] TDettmering|8 years ago|reply
[+] [-] nfrmatk|8 years ago|reply
When I'm ready to publish I just copy the public directory right to my webserver, but I could just as easily publish to GitHub or the like if I didn't enjoy maintaining my own domain.
[+] [-] Keats|8 years ago|reply
In short, I just write my content in markdown, style in Sass and HTML in Tera (https://github.com/Keats/tera/) which is very similar to Jinja2.
I then automatically build & deploy from https://www.netlify.com/ on commits. Netlify will also get built-in support the next time they deploy their build image (ie all you need for your site to be deployed will be a file like https://github.com/Keats/gutenberg/blob/a2b55a927981727ce00a...) like Hugo does.
My own site is a bit difference as I have a DO instance for it but the script is simply copying the public folder to the server and have Caddy serve it.
[+] [-] kettlecorn|8 years ago|reply
So I made my own tool.
With this tool (which I dubbed ‘Wabi’) you put a bunch of files in a folder and the files are processed and copied to a corresponding location in an output folder.
Files with metadata at the top are processed specially and can be used as templates or to write markdown files that are turned into pages.
Wabi helps you setup Git integration so that when you run the “publish” command all local changes are immediately published to your website. I didn’t want to mess around with git stuff most of the time so I implemented that command so I could publish iteratively and quickly.
Wabi is sort of my answer to wanting control over how I build my website, while also wanting a tool that does not get in the way of the creative parts of making and running a website.
That said, it’s of no use to you because it’s completely undocumented and not polished, but probably over the next few months I’ll fix it up as I use it to create my own personal website. For those interested you can check out the source (it’s written in Go): https://github.com/kettle11/wabi
[+] [-] Jeaye|8 years ago|reply
I'm currently writing a post detailing how all of this works, for anyone interested.
[+] [-] city41|8 years ago|reply
[+] [-] leejo|8 years ago|reply
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.