14 ms·
Show HN: Gutenberg – A static site engine as a single executable
- dangom 9y agoAre there examples of pages generated with Gutenberg?
- Keats 9y agoThe site is built with Gutenberg so you can open the inspector to view some.
- davidpelayo 9y agoHowever, it would be nice to have some at the source code.
- slig 9y agoIt's on the repo https://github.com/Keats/gutenberg/tree/master/docs/templates https://github.com/Keats/gutenberg/tree/master/docs/template...
- bemmu 9y agoPre-compiled binaries: https://github.com/Keats/gutenberg/releases https://github.com/Keats/gutenberg/releases Didn't notice those at first. Read the "installation" page, but jumped straight to the subheading "mac os x" and thought it was unavailable. Maybe you could have a"download for <Mac OS X/Windows>" button on the main page that would lead to the relevant binary for the visitor's platform.
- ekianjo 9y ago> download for <Mac OS X/Windows/Linux> Corrected that for you Bemmu :)
- Keats 9y agoGood idea. Hopefully someone will package it for Brew/Chocolatey (is that what is used on Windows?) but it's a good stopgap solution.
- eradicatethots 9y agoI think most people are still just running installers on windows
- leichtgewicht 9y agoThe homepage misses how its different/better than all the other solutions. Rust ftw?
- Keats 9y agoFor my own usecase, Sass and syntax highlighting built-in are the things I wanted - Hugo now has highlighting built-in too though - and all of that in a single binary. I don't want to mess with virtualenvs or JS packages. Compared to Hugo (which is what I was using until then), it has: - the mentioned Sass compilation - a much better template engine (I'm a bit biased there since I also wrote it) - assets colocations: keep images etc next to the post I also find it much easier to use than Hugo but I wrote Gutenberg for my own usecase so this point would need external validation. I wrote a bit about the motivation when I released the initial version on my blog: https://vincent.is/announcing-gutenberg/ https://vincent.is/announcing-gutenberg/ but I agree it should be better communicated on the landing page. Rust is an implementation detail: it could have been done in any language compiling to a binary, I just picked the one I prefer.
- weberc2 9y agoThis is cool, and props for scratching your own itch, but this does seem like an incremental/niche improvement over Hugo. I'm curious if you talked to the Hugo community about supporting those features? I don't mean to imply that you should have done so--"I wanted to build my own" is a totally valid reason not to bother.
- Keats 9y agoI don't really like the template engine available in Go (especially the godawful one in the std) so I would have needed to write one or use pongo2 but probably wouldn't have been accepted in Hugo: https://github.com/gohugoio/hugo/issues/1359 https://github.com/gohugoio/hugo/issues/1359 The assets colocations issue was raised in 2014 and it might come soon but I don't think it's there yet: https://discourse.gohugo.io/t/keep-images-content-together/51 https://discourse.gohugo.io/t/keep-images-content-together/5.... Same thing for Sass compilation: https://discourse.gohugo.io/t/support-for-html-css-js-preprocessors/127 https://discourse.gohugo.io/t/support-for-html-css-js-prepro...
- clintonb 9y agoWhy should anyone use this over Jekyll or any of the numerous other static site generators?
- pathsjs 9y agoFor one thing it is a single binary, which is much easier to handle than, say, jekyll, for people that do not use ruby
- leichtgewicht 9y agoNot one "binary" but one thing? https://github.com/jekyll/docker https://github.com/jekyll/docker
- pathsjs 9y agoRight. You still need docker for that, though
- trigoman 9y agoThat's essentially what I had to do[1], it's not ideal but it works. I was looking at switching to Hugo, but this static site generator looks promising. [1]: https://blog.jvtrigueros.com/2017/07/12/jekyll-docker-environment/ https://blog.jvtrigueros.com/2017/07/12/jekyll-docker-enviro...
- sotojuan 9y agoSo is Hugo, and that's in Homebrew for macOS users.
- Cthulhu_ 9y agoJekyll doesn't work on Windows last time I checked, not without going through a long list of steps. It also needs a Ruby runtime.
- steveklabnik 9y agoIt does work on Windows, and is fairly easy. It's true that it needs an entire Ruby environment.
- stephen82 9y agoOne thing it would get people's attention would be how much time a compilation test of 150K or more posts / pages would take to finish with Gutenberg. That is something we, users, have discussed with the Nikola team and it's something others have already discussed about it with other static website generators. Here's the discussion in case you are interested in: https://github.com/getnikola/nikola/issues/2842 https://github.com/getnikola/nikola/issues/2842
- Keats 9y agoI haven't really looked into performance that much yet but it is rendering one of my bench site of 10k pages in 61s on my 4 years old laptop. Gutenberg does load all posts in memory as well though so it's likely to run into the same issue.
- eterm 9y agoDoes anyone know why the page flashes when clicking "Docs" at the top, but not when moving to the "installation" link on the left hand side which is the same url?
- ARCarr 9y agoBecause the "Docs" link at the top goes to a blank page that then redirects you to the installation page.
- Keats 9y agoThe Docs link lands on the documentation section which redirects to the getting started section which redirects to the installation page. I could link directly to the installation page from the header, didn't think about it that much.
- djcollier 9y agoVery nice, that is one of the most annoying things about Jekyll. I know i'm in the minority of users here who is on Windows, but setting up a Ruby in environment is a pain. Nice work, the site is also well designed.
- sandGorgon 9y agoHugo is written in go and does exactly this. Has a pretty large community and themes already. http://themes.gohugo.io http://themes.gohugo.io
- Keats 9y agoI'm aware of it, the majority of my static sites are still using Hugo since I haven't touched them for ages. The two features I really wanted when I started Gutenbrg were Sass compilation and syntax highlighting built-in: a clean build of my blog with Hugo + Pygments was taking ~20s for ~20 pages at the time and needed virtualenv for Pygments, Node.JS/npm for gulp-sass and the Hugo binary. Hugo now has syntax highlighting in Go so that part should be better though. Themes are supported in Gutenberg but there is only one so far as I didn't want to spend time on that yet. It is pretty fast to port themes though - took me about 10 minutes for Hyde: https://github.com/Keats/hyde https://github.com/Keats/hyde - so I might port ~10 or so next week to get the ecosystem started.
- dualogy 9y ago> with Hugo + Pygments was taking ~20s for ~20 pages at the time That's long! Glad I wrote my own in Haskell (and I'm a Gopher! just did it to get my feet wet in Hs) --- 92 pages in 1s (full rebuild; incremental is of course just a fraction) feels good to me now. http://github.com/metaleap/haxtatic http://github.com/metaleap/haxtatic No CSS magic tooling though. Just don't find vanilla CSS troublesome enough yet =) Edit: I saw you do ~10k pages in ~60s so guess we can see the Rust bonus there now --- certainly beats my extrapolated expected ~5-6k for the same time-frame. (Though I hope you were talking there about complex layouts with component-like-sub-templates / programmatic sub-renderers and date-time formatting, not just dumping-inner-markup-into-outer-markup =)
- piranha 9y agoI would expect lower timings, see https://github.com/piranha/gostatic/blob/master/README.md#speed https://github.com/piranha/gostatic/blob/master/README.md#sp...
- dctoedt 9y agoMy first impression was that this was related to Project Gutenberg; that might raise trademark issues.
- jwilk 9y agoI don't think that's how trademarks work. Still, terrible and unoriginal name choice: https://github.com/search?q=gutenberg https://github.com/search?q=gutenberg
- oconnor0 9y ago"Terrible and unoriginal name choice" is probably a little dramatic: https://github.com/search?utf8=%E2%9C%93&q=gutenberg+static+site&type= https://github.com/search?utf8=%E2%9C%93&q=gutenberg+static+...
- jannes 9y agoCan you even trademark the name of a historic person like that? He's been dead for 549 years. Could I start using Einstein (dead for 62 years) or Galileo (dead for 375 years) as a trademark?
- 1wheel 9y agoYup. Baby Einstein is trademarked: https://en.wikipedia.org/wiki/Baby_Einstein https://en.wikipedia.org/wiki/Baby_Einstein https://trademarks.justia.com/757/49/baby-75749035.html https://trademarks.justia.com/757/49/baby-75749035.html
- tomkin 9y agoSteve Gutenberg would differ in opinion.
- virgil_disgr4ce 9y agoI believe the Stonecutters own the trademark on his name
- 9y ago
- StevePerkins 9y agoSo........ basically Hugo, for people who care that it's written in Rust rather than Go, and who don't care that there's no themes ecosystem?
- bojanvidanovic 9y agoJust moved from Jekyll to Hugo and I'm planing to stay there. BTW it's nice to see more alternatives to Jekyll coming on the scene.
- dorfsmay 9y agoIdeally the perfect static site system should be a meta language, like one of the wiki languages, for which several solutions could be used to translate to HTML etc... We shouldn't have to rewrite our blogs every time a new cool programing language comes around!
- geraldcombs 9y agoThe Website Meta Language has been around since 1996: http://thewml.org/ http://thewml.org/. I used it to generate content years ago before more modern tools came out.
- Kadin 9y agoI think that Liquid, the template language used by Jekyll and some other products, is designed to basically be that. https://shopify.github.io/liquid/ https://shopify.github.io/liquid/ The problem is that it's written in Ruby and therefore most implementations of it require you to have the whole Ruby dependency chain. That really increases its footprint on a cheap webhost, if you want the SSG to happen server-side (e.g. triggered by a Git hook).
- Keats 9y agoLiquid is just a template engine, I don't think this is what the OP meant.
- kaushalmodi 9y agoIs this what you mean: I write my blog posts in Org mode. So I wrote this package ox-hugo that exports that to Markdown + the front-matter required by Hugo, in the folder structure for Hugo. Now I just write in normal Org, and don't worry about manually setting up the post front-matter -- https://ox-hugo.scripter.co https://ox-hugo.scripter.co (That site is generated by ox-hugo + Hugo btw :))
- dorfsmay 9y agoYes, although I'm not an emacs user. I've been trying to pick a "meta language", eventually given up but I cannot remember why, I need to pick it up again.
- laurent123456 9y agoAs I'm familiar with PHP, I find it way simpler to just do `php somefile.php > somefile.html`, then I don't need to learn a new templating language and go around the quirks of a custom building tool. I guess it could make sense for somebody who doesn't know any other templating language.
- _jal 9y agoOr for someone who considers PHP a bucket of suck and avoids it whenever possible. Or for someone who doesn't want the PHP dependency graph installed. Or who likes the conventions of this one better than coming up with their own or using some third-party PHP monstrosity with its own dependency graph. Or... There are many reasons different tools exist.
- wolco 9y ago2011 wants its memes back. PHP has changed, if you still have the opinion PHP is a bucket of suck give it another try the tooling around php has changed so much not to mention the language amnd speed improvements.
- _jal 9y agoGeez, people get touchy about their tools. I wasn't attacking PHP. I pointing out in passing that some folks feel that way. But no, I'm not going to look at new 'n improved PHP, because I don't care about it and life's too short. I only ever used it in a past life when doing contract work fixing other people's messes.
- eberkund 9y agoThat's rather ignorant. But if you'd prefer to stick your head in the sand and keep espousing your negative experience with PHP from many years ago despite numerous people advocating the many improvements that happened over the years then that is your prerogative.
- andrewmcwatters 9y agoThere's a lot of me-too software out there, and honestly I wish that developers would just be more candid about their goals. What is this really? A state site engine with no dependencies... but is it? ...or is that just one of the things it is? If one had more plainly said "a static site engine written in Rust" then maybe it would be more compelling to at least one particular ecosystem. I just don't understand the selling point unless you're completely candid. Hugo is; it doesn't even pretend to be something it's not. It directly sells to people who invest in Go. And Jekyll has a powerful stance as being integrated with platforms like GitHub. What's the pitch here?
- Keats 9y agoWhy would an end user care which language the tool is made with? The only times it matters is if they want to contribute or if it requires you to install their toolchain, which is not the case here.
- andrewmcwatters 9y agoIt definitely has a larger impact with language ecosystems like Rust's and Go's.
- forlorn 9y agoCould you suggest a more general purpose static site generator? 99% of them target blogs but most of times you need a bit more. Hugo looks like the most advanced of them but its documentation leaves much to be desired and doesn't include real-life examples of different projects. I'd love to have a tool to generate a catalogue, a simple journal, etc.
- Keats 9y agoDo you have an example of catalogue/journal that you would want to do? Gutenberg can do blogs but I originally built it for any kind of content: landing page, landing page + knowledge base, landing page + blog etc so it should work in theory. However, if your data is coming from an API/database something like Gatsby (https://www.gatsbyjs.org https://www.gatsbyjs.org) would be better.
- llccbb 9y agoIf you want lots of customization and are friendly with Python I would suggest rolling your own project with Flask and Flask-Freeze. You get all the benefits of complete customization from URLs to templated pages and scripts. Really anything. While this isn't a canned solution, it is a really robust solution.
- llccbb 9y agoJust to continue on... With this setup you can have anything (ANYTHING!) powering the data side. From CSVs to any SQL server local or remote, directories of markdown files, directories of ZIP archives, random (or deterministic) numbers or generable sequences. Flask gives you so much freedom with the backend implementation you can draw from anywhere. You just need to define the URL patterns and supply the functions that respond with HTML. Flask-Freeze then crawls your site (or a list of pages you specify) and renders the HTML with whatever function you supplied. Couldn't be easier to understand and it is unbelievably flexible.
- nkantar 9y agoYou may be better served by Lektor: https://www.getlektor.com/ https://www.getlektor.com/
- seertaak 9y agoI have to say I don't really understand the point of these projects. Faced with the problem of generating a static part for my website, I just used Django to "print" the static part. I'm not saying you need to use Django (although in my case it has clear advantages, namely that you write everything using a single tool), but.... left pad, anyone?
- dualogy 9y agoGood starter project for learning a new language. You get to touch various interesting areas from IO to templating to a simple modicum of "dependency tracking" (for incremental rebuilds), many neat areas to learn/try optimizations, and now matter how hard it is at first or how deep down the feature-creep rabbit hole you go, at some point it's just gonna be done. Not a bad package
- Keats 9y ago> but.... left pad, anyone? Actually, unless you're committing the wheels in your repo left-pad is more likely to happen with your solution than with a binary since someone could login and remove all versions of Django from Pypi (unless it's just yanking them instead of completely deleting them, not sure). On the other hand, you can just commit a binary in the repo and it will keep working assuming you don't change platform.
- BeetleB 9y ago>Faced with the problem of generating a static part for my website, I just used Django to "print" the static part. Because I don't want to spend too much time maintaining my site. When I used Wordpress, it got hacked. I don't want to check every few months for security updates. When I used Django, it would randomly "go down" when some library changed on my host. Then I'd have to figure out how to fix it. Which almost always involved upgrading to the latest Django, which was never straightforward. But the static site generator I have? Runs on my machine and not on a server. I still have the same problems with it as with Django (upgrades breaking stuff). The important thing is that it breaks stuff on my PC and not on the server. People can still access my site while my generator is broken. I feel no pressure to fix it (and indeed, it is usually months before I do fix it). And, finally, I think you don't really know what SSG's do for you. It's not about making one or a few pages static. It is about making it appear dynamic while being static (tag pages, categories, etc). In fact, I would invert the question. Given that a SSG can do pretty much anything a blog can do, why would someone use a server side process to write a blog? What's the point of having your blog in Django when a simple SSG will do the task for you?
- yoz-y 9y agoIs there any push to unify the way content is arranged so one could hop from one static site generator to another? I currently use middleman but I find it quite slow I might be tempted to go somewhere else but I am putting it away because even the migration from v3 to v4 of middleman took quite a while.
- groovy2shoes 9y agoNo dependencies? Then what's all this? [dependencies] clap = "2" chrono = "0.4" toml = "0.4" term-painter = "0.2" # Used in init to ensure the url given as base_url is a valid one url = "1.5" # Below is for the serve cmd staticfile = "0.4" iron = "0.5" mount = "0.3" notify = "4" ws = "0.7" Not to mention the Rust toolchain! You and I must have different ideas of what constitutes a dependency ;)
- daemin 9y agoYeah, based on the title I was expecting a single exe file (with themes and supporting directories) which would be more of a turn key solution.
- fenwick67 9y agoThey just mean their releases come as a single binary file, so really it's "no installation dependencies". This is remarkable in the static site generator world because many (jekyll, hexo, mkdocs) are modules installed via the language's package manager (jekyll is installed via "gem", etc). So you have to get the package manager working, then get any external dependencies working, THEN you can get started.
- scienceman 9y agoI think it might be statically linked binary, so downloading and running the binary has no installation dependencies.
- Keats 9y agoThe output binary has no dependency. The dependencies listed and Rust are only necessary if you want to build from source.
- groovy2shoes 9y agoI figured that's what you meant :) I apologize if I came off as dismissive or disdainful; I was in a sort-of playful mood when I wrote that, but moods don't usually survive internet transmission! It's a neat project. I myself don't have much use for a site generator of any sort, but I am interested in Rust (though I haven't had much opportunity to use it in the last year or so). I wonder: how are you liking Rust as a language? as an ecosystem? For a project like this, what advantages has Rust afforded? what disadvantages?
- HugoBoss 9y agoA couple small feature requests: 1) Can you add a guide to deploying on GH Pages, Netlify, S3, etc.? 2) A search feature, along with a theme/example showing how to integrate it
- Keats 9y agoBoth are definitely on the TODO list, I created https://github.com/Keats/gutenberg/issues/139 https://github.com/Keats/gutenberg/issues/139 and https://github.com/Keats/gutenberg/issues/140 https://github.com/Keats/gutenberg/issues/140 to track them.
- Keats 9y agoI'll use the fact that people are watching this thread to ask for comments on how to handle i18n on the RFC (https://github.com/Keats/gutenberg/pull/111 https://github.com/Keats/gutenberg/pull/111) as this is the next big feature I want to add.
- corobo 9y agoI have a feeling the name will be drowned out with WordPress being in the same market and their new editor also being named Gutenberg
- krick 9y agoI don't see a point right now, but just in case: how much of a hassle would it be to migrate my Hugo-based projects to Gutenberg, if it proves to be more useful somehow?
- Keats 9y agoIf you're using a TOML frontmatter it should be pretty painless for the content otherwise a bit annoying. Migrating the theme/template should be fast though.
- caio1982 9y agoHey, just took a moment to tell you it takes courage to post a Show HN about whatever it is that you built. I understand the tone of most of the comments about Gutenberg in here, but... stick to your plan and just ignore them, congrats for pushing something out of the door :-)
- cdevs 9y agoDo any of these static generators keep configs and themes with wherever you happen to upload your static content "example: github"? Just curious if moving from one machine to another if it's easy to download something like Gutenberg , clone your git and start working?
- shadedtriangle 9y agoShameless self promotion but my static site tool Static-Fire is based off Git. Everything from the config to the python source to the articles you write is all in the same repo. https://github.com/cusiman7/Static-Fire https://github.com/cusiman7/Static-Fire
- eberkund 9y agoYes, they all work pretty similarly and the Git repo is fairly self contained. You (mostly) just point the generator software at the repo which includes your content, config and theme and it compiles it into HTML files.
- kaushalmodi 9y agoOnce you get confident with your static site generator, you don't even have to download it or run it locally (not kidding). I have my Hugo-based blog on Gitlab (content, themes, config, etc). I just need to commit changes to my plain text content (Org/Markdown) -> Netlify sees the commit -> Runs hugo to generate the site -> Site gets published.
- farhang 9y agoI do not honestly understand the negative comments, including the "Hugo did that already" since the dev points to important differences such as SASS. I very much look forward to testing the binary (not knowing Rust I see no reason to try to play with the code). Just one preliminary feedback: gutenberg --help does not indicate any options. But if I could make a suggestion that might help set this apart a bit from other markdown-site-generators, it would be to have real support for footnotes. Most seem to use the GitHub flavor which is sorely lacking in that regard and it's unfortunate that most generators do not address this vital need for many of us. Thank you for your work and for sharing this project.
- Keats 9y agoFootnotes are supported, an example in Phil blog: https://os.phil-opp.com/multiboot-kernel/ https://os.phil-opp.com/multiboot-kernel/ Search for small hack and you can see one
- johnsoct 9y agoThis name is already an amazing typography library... http://matejlatin.github.io/Gutenberg/ http://matejlatin.github.io/Gutenberg/
- quickthrower2 9y agoI now prefer knocking stuff up in my pet chosen MVC web framework. I can be more more productive when I need to tweak thing that way. With output caching performance should be on par with static. Or can use one of those programs that downloads a website to convert into static files if required.
- HaoZeke 9y agoPlease tell me there's some love for pandoc... I'm very confused though... There's no mention of the markdown parser being used... Pandoc is essential for cross-platform content (md --> doc, epub, pdf, html) and for MATH!! Sadly, only Jekyll and Hackyll have support for it... (many other smaller projects also might) Hugo with npm scripts does exactly thins...