8 ms·
All I want is a static site generator that sits in an executable file in my project's directory and doesn't require any dependencies so that I can run `./ssg bu
by bacondude3 6y ago
All I want is a static site generator that sits in an executable file in my project's directory and doesn't require any dependencies so that I can run `./ssg build` and have all of my Markdown files interpolated into my template files and put in their own directory. I don't want to have to install all of the dependencies for Ruby or Hugo or Blades, cool as this project looks. Are there any SSGs that fill that niche?
(A Python executable would be fine since pretty much every Linux computer has Python, but I don't want to have to deal with pip).
- thrwwayanswerq 6y agoHugo or any go program should fit that bill since that is one of the major selling points of go Hugo has a ton of prebuilt executables that you just have to extract and its in a single file https://github.com/gohugoio/hugo/releases https://github.com/gohugoio/hugo/releases
- bacondude3 6y agoThanks. I had looked at Hugo before, but somehow didn't see the precompiled binary as an installation option. I'll try it out.
- coldtea 6y agoYou don't need to use their precompiled binary either. It's available in brew (OS X), some Windows package manager (don't remember the name), distro packages, etc.
- bacondude3 6y agoYeah, but package managers are exactly what I want to avoid here :)
- lalaithion 6y agoThey say "If you would like to have it included in your favourite package repository, submit an issue."
- bacondude3 6y agoI don't know much about Rust. Can it be compiled into a standalone binary? C programs typically rely on header files and are not standalone, and Rust is (basically) C but with safeguards around memory, right?
- scns 6y agoYes it can when you use musl instead of glibc
- bacondude3 6y agoThanks! Where can I read more about that? I looked at musl's website, but didn't see any mention of standalone binaries on the page comparing it to glibc. [0] [0]: https://wiki.musl-libc.org/functional-differences-from-glibc.html https://wiki.musl-libc.org/functional-differences-from-glibc...
- saagarjha 6y agoThis page mentions it: https://www.musl-libc.org/intro.html https://www.musl-libc.org/intro.html
- cyphar 6y agoThis is more of a Rust quirk[1] than a glibc/musl thing. Glibc can be used statically (though it's not really recommended -- hence why Rust doesn't support it and requires you to use musl instead). [1]: https://doc.rust-lang.org/edition-guide/rust-2018/platform-and-target-support/musl-support-for-fully-static-binaries.html https://doc.rust-lang.org/edition-guide/rust-2018/platform-a...
- jjnoakes 6y agoI'm not sure why Ruby (dependencies at run time) and Go and Rust (dependencies at compile time) are both lumped together as examples of what you aren't looking for. Doesn't go or rust give you a static executable?
- bacondude3 6y agoIt looks like Hugo does provide a static executable. I'm aware that Go is known for providing standalone binaries, but last time I checked Hugo's website I didn't notice the binary installation method [0], which is why I mentioned it as equivalent with Jekyll. I'll give it another look. Regarding Ruby, Gems on Linux is a mess that I don't want to have to deal with for anything, but especially not for a static site generator. Rust probably could provide a precompiled binary, but the recommended installation method for Blades involves `cargo` which is why I asked the question. https://gohugo.io/getting-started/installing/#binary-cross-platform https://gohugo.io/getting-started/installing/#binary-cross-p...
- cyphar 6y ago> Rust probably could provide a precompiled binary, but the recommended installation method for Blades involves `cargo` which is why I asked the question. Cargo is the Rust compiler (or rather the Rust build system). After you run it, it'll spit out a binary which you can use elsewhere. If I'm reading your question correctly, this would be analogous to seeing a reference to CMake in a C++ project's README and then asking whether C++ supports precompiled binaries.
- cyphar 6y agoBoth Go and Rust do not produce static binaries by default -- they both link to glibc and a few other libraries -- but you can coerce them both to do so (though with Rust it's slightly more painful because you need to install a compiler toolchain that uses musl, but rustup makes it pretty painless).
- jjnoakes 6y agoBy static I meant go and rust dependencies bundled into the executable. Dynamically linking to libc is ok with me, any system I run on has a usable libc.
- chillfox 6y agoThat's pretty much what hugo[1] is. Download the .tar.gz and put the executable wherever you want. [1] https://github.com/gohugoio/hugo https://github.com/gohugoio/hugo
- bacondude3 6y agoThanks. I had looked at Hugo before, but I guess I just didn't see the binary install option. (https://gohugo.io/getting-started/installing/#binary-cross-platform https://gohugo.io/getting-started/installing/#binary-cross-p...)
- mikro2nd 6y agoDo save yourself some head-scratching and time, and download the hugo_extended package.
- CameronNemo 6y agoThis is a really weird requirement from my perspective...
- bacondude3 6y agoDeal with a Jekyll site that sat unattended for two years and was built using the default Ubuntu ruby packages and you'll understand.
- CameronNemo 6y agoYeah I don't use Jekyll (I use Hugo, although have been looking for a rust option that has a smaller binary), and I rebuild my static site often enough. But a Python venv and a requirements lockfile can alleviate a lot of the issues you seemed to have. Seems like placing the generator directly in the repo is a little bit of an overreaction. Maybe it is all you have time/patience for, but I would not consider it a clean practice. (E.g. it would break when you switch CPU architectures, which I have done since I started my site).
- bacondude3 6y agoI hadn't thought of CPU architecture problems since all of my computers in the past decade or so have used the same architecture, but that's a good point. I understand sticking the generator in the repo isn't a good practice, but I really just want a simple setup that won't have dependency problems. Probably an executable shell or Python file that doesn't draw in any dependencies would be ideal for me since those can run on pretty much any Linux computer in my experience. Based off the recommendations here, I'll likely migrate my Jekyll site to Hugo or this one which was recommended by another commenter in the thread: https://rgz.ee/ssg.html https://rgz.ee/ssg.html Right now, do you just keep Hugo in your `$PATH`? If you do that, do you need to note in your site's README which version of Hugo it should be built with, or are Hugo versions pretty backwards-compatible with each other?
- CameronNemo 6y ago
- smlckz 6y agowhat about this?: https://rgz.ee/bin/ssg5 https://rgz.ee/bin/ssg5 modify it a little bit and run!
- bacondude3 6y agoThat still has an external dependency for Markdown, but yeah, that's basically exactly what I'm looking for. I might just stick Markdown.pl in the git directory with the shell file so that dependencies aren't a problem. Thanks! Documentation here: https://rgz.ee/ssg.html https://rgz.ee/ssg.html
- smlckz 6y agoif you like extreme minimalism : https://dataswamp.org/~solene/2019-08-26-minimal-markdown.html https://dataswamp.org/~solene/2019-08-26-minimal-markdown.ht... unfortunately i don't see any license for that awk script, but still, just look at it!
- rudedogg 6y agoCheck out https://www.getzola.org https://www.getzola.org. It's a single executable. It even does syntax highlighting (without using client-side javascript). I moved to it from Jekyll/Hugo, because I hate dealing with Ruby and dependencies like you!
- bacondude3 6y agoThanks for the suggestion! Some of the other commenters have pointed out that Hugo also has standalone binaries, I just didn't notice them last time I looked. What made you choose Zola over Hugo?
- rudedogg 6y agoI think the main reason was the built in syntax highlighting, and simplicity. I've decided to move away from themes, and just code simple CSS by hand - so Zola kind of fits that mindset. Hugo definitely has more features. If you think you'll want to do some complex hierarchies in your blog/site, or want a lot of themes to pick from I'd go with Hugo. Hopefully that helps! Edit: I think Hugo used to require Pygments (a pip package), but it looks like that's no longer the case. If it did that probably nudged me towards Zola too.
- maybevain 6y agoI really enjoyed Zola as well. It's sufficiently simple that the learning curve is really gentle but has just enough features to cover all my needs for a static site. Coupling it with Tailwind for styling meant that developing the theme was really smooth (slowest part of changing a template was waiting for the browser to refresh, i.e. < 1s).
- b0rsuk 6y agoThere seems to be apathy in Rust community towards using client-side js for syntax highlighting. Rust documentation and The Rust Book uses it for no good reason. Code in examples doesn't change, and the way they are highlighted doesn't change. In my opinion it clashes with the philosophy of the language - that as much as possible should be done before the code is run. Aside from my pedantry, it causes computers to make more unnecessary computations and our civilization emits more carbon. It also affects me because I currently have an old CPU and it takes a few seconds for syntax highlighting to kick in. Every time I press "Back" in my browser, syntax highlighting needs to be recalculated as well. Oh well, on the bright side I have an itch to scratch :-).
- marosgrego 6y agoYou can do exactly this with Blades. The binary has no dependencies.
- smusamashah 6y agoWhere do you download the binary from?
- marosgrego 6y agoYou could download it from AUR: https://aur.archlinux.org/packages/blades-bin/ https://aur.archlinux.org/packages/blades-bin/ Or simply from GitHub releases: https://github.com/grego/blades/releases https://github.com/grego/blades/releases
- Shared404 6y agoIf a dependency on Markdown/sh is acceptable, you might find this[0] to be helpful. I wrote it because I was in much the same boat. [0] https://git.sr.ht/~evan-hoose/SSSSS https://git.sr.ht/~evan-hoose/SSSSS [1] http://a-shared-404.com/blog/stupid-simple-sites/ http://a-shared-404.com/blog/stupid-simple-sites/
- bacondude3 6y agoThat looks a tad more basic than what I'd like, but I'll give it a try. Thanks for the links!
- Shared404 6y agoIt is indeed quite basic. You should be able to replace 'markdown' with whatever renderer you want, so theoretically any sort of plaintext -> html tool should work. Alternately, if there's a more full featured markdown renderer you prefer that should work ootb.