# Need suggestion for static site gen



## TjPhysicist (Nov 12, 2015)

Hi guys,
so for a few years now I've been running a site of sorts, just some small stuff with WordPress. I have become increasingly sick of WordPress, how big it is, etc. So I need a suggestion for static site generator...here are my requirements:

Markdown; i.e I should just be able to write a "blog-post-1.mkd" and copy it somewhere, run some command and have said post added neatly to my posts. (Same with pages).
The top/nav menu MUST be able to have submenus.
e.g. All blogs are under one menu entry, and a drop down submenu from "Blog" to show a bunch of categories and sub-categories.

Currently I have tried a few of the popular ones like pelican, cactus and Nikola, none of them have the above two requirements without jumping through a LOT of hoops

Note: If getting the proper navigation menu requires me to actually start programming some python and css I might as well roll my own site generator.


----------



## Cthulhux (Nov 12, 2015)

All of them support Markdown. Not all of them support subcategories (if I remember correctly, only Pelican does with a plug-in). Your primary problem might be that you'll have to do the front-end work (creating your menu structure) yourself, but that can be done entirely in HTML. However, I'm pretty sure that Pelican already has a theme with submenus...

That said, I've been playing with SSGs for a while now. The most interesting one seems to be Grav, written in PHP and providing a complete web backend (like WordPress); it's rather a flat-file CMS than a real static one though. If you prefer a classic one (requiring you to write your stuff in a real editor), my favorites are Pelican (you can do everything with plug-ins here), Coleslaw (because it's in Lisp), Frog (because its author is very responsive) and Statocles (because it has a very nice feature set out of the box, although the default theme sucks). Note that you might have to use tags instead of subcategories in most of them.


----------



## Carpetsmoker (Nov 12, 2015)

I use Jekyll, which works fairly well.

Automatically generating submenus looks easy enough. For example, I do this to get a list of all posts:


```
{% for post in site.posts %}
        <div class="weblog-brief">
            <h1><a href="{{ post.url }}">{{ post.title }}</a></h1>
            <em>Created on {{ post.date | date_to_string }}</em>
            {{ post.excerpt }}
        </div>
    {% endfor %}
```

Looking at the docs, you also have a "categories" and "tags" properties, so you can use that to generate a submenu. I think it's also trivial to add a new property, either by just adding it to the post, or through a very small Ruby extension.



> Note: If getting the proper navigation menu requires me to actually start programming some python and css I might as well roll my own site generator.



Nothing will behave and appear as you would like by only by flicking a single switch. You will require some basic programming for pretty much all non-trivial tasks (such as this). With Jekyll, this is pretty easy. If you're "rolling your own", it will be a lot harder...


----------



## freethread (Nov 12, 2015)

The screenshot is the result of the my post in another thread. The only requirements is writing you own theme and tools configurations. In my case, pages are not written directly into the built-in editor for the content of the pages, the pages, instead, are AsciiDoc text files maintained in a directory tree (on another machine and updated using Subversion), they are 'compiled' in HTML files with the same name and .php extension.

If you want to go on with this, write me a PM or what is used here.


----------



## Deleted member 9563 (Nov 12, 2015)

You might like fBlog. Written in Fortran and I can report that it compiles and runs perfectly on FreeBSD 10.1. I've been using it lately and it's about as utilitarian as it gets.


----------



## Cthulhux (Nov 12, 2015)

Fortran? Sweet. Is there also a blog in COBOL? 

Jekyll is well-known but probably not the wisest choice here as it is more like a framework and the OP prefers easy setups.


----------



## ANOKNUSA (Nov 12, 2015)

I would start here. In response to your specific requirements:


You'd be hard-pressed to find a static site generator that doesn't support Markdown. What _flavor_ of Markdown they support is pretty much the only markup language difference you'll find.
This relies on your code, not the generator. Making a nested menu with HTML and CSS is pretty basic and easy to do. I don't know of any generator that does this automatically, but then, a good static site generator won't actually generate essential elements for you, as that basically defeats the purpose.



TjPhysicist said:


> Note: If getting the proper navigation menu requires me to actually start programming some python and css I might as well roll my own site generator.



I'll be frank: if you're going to use a static site generator, _you will be writing code_. What you're hoping for is that someone, somewhere has the exact same needs you do and has already created something with the exact features that you want, that will generate a website comprising exactly the elements you want that function in exactly the manner you want so you won't have to do anything extra. To say that's unlikely is an understatement, and even if such a project exists it's probably not going to be something you can rely on long-term. On top of that, easy fire-and-forget solutions don't typically come in small, efficient packages. WordPress is big precisely because it includes all those things that make using it so easy and convenient. Any site at all can have a nested menu, regardless of how it's made; if you know HTML and CSS, it's fifteen minutes of work. If you don't know HTML and CSS, and have no intention of learning, well, that's why projects like WordPress and Squarespace exist. Really, SSGs are geared toward people who already know how to make websites, and exist to cut out the tedious parts, not create ready-made sites. They allow users to create a template from scratch and feed content into that template so they don't have to repeat all the code and tag every paragraph and header and such as they write. Some come with nice extra features, like categories and tags to manage lists and such, but automatically generated elements that the user didn't code themselves aren't very common.

I guess I'd say start with Octopress and Ruhoh, since they're geared toward out-of-the-box blogging. I don't believe you _need_ to write any CSS or HTML for them, but there's little sense in using a static site generator if you're not going to take advantage of it. I use Hugo, myself. It's insanely fast, makes it easy to manage content and organize a site (the site organization mirrors that of your working directory), and its preview server automatically reloads the web page every time you make a change. The documentation is garbage. though.


----------



## Carpetsmoker (Nov 12, 2015)

Cthulhux said:


> Jekyll is well-known but probably not the wisest choice here as it is more like a framework and the OP prefers easy setups.



Jekyll is dead easy:


```
jekyll new mysite
cd mysite
jekyll build
```

Congratulations. You now have a site in mysite/_site/ All you need to do now is add Markdown-formatted posts in mysite/_posts and run jekyll build again.

As I explained above, adding the expanding menu will require some minor templating and a few lines of CSS, which will be true for *any* standard software.


----------



## Cthulhux (Nov 12, 2015)

ANOKNUSA said:


> I would start here.



Here's a more complete list.



ANOKNUSA said:


> I guess I'd say start with Octopress and Ruhoh, since they're geared toward out-of-the-box blogging.



Actually, Ruhoh is more like a _site generator_ than a _blog generator_. That said, the four generators I mentioned above are also primarily used for blogs.



ANOKNUSA said:


> I don't believe you _need_ to write any CSS or HTML for them, but there's little sense in using a static site generator if you're not going to take advantage of it.



It depends. Just like WordPress, you _could_ be creative, but you _could_ also use one of the gazillions free themes available. Pelican has an overwhelming choice (mostly with screenshots), others like Coleslaw could be improved by you.



ANOKNUSA said:


> I use Hugo, myself. It's insanely fast, makes it easy to manage content and organize a site (the site organization mirrors that of your working directory), and its preview server automatically reloads the web page every time you make a change. The documentation is garbage. though.



Also, there is not a single good-looking theme for it. (YMMV)


----------



## drhowarddrfine (Nov 12, 2015)

Looking over the suggestions makes me think of Linux distros. It also reminds me: give me C, nginx and FreeBSD and I'm good to go (ignoring variations of the first two). But I don't do static sites.


----------



## Cthulhux (Nov 12, 2015)

LOL, kudos for the names alone.


----------



## aw256 (Mar 17, 2021)

Wondering if there are any new opinions on this old thread? 
Javascript people assembling their list of SSGs: https://jamstack.org/generators/
The simplest, most unix SSG ever: https://www.romanzolotarev.com/ssg.html (ssg5)

ssg5 might be too basic for me; I want something that generates menus and submenus automatically, and works well with bootstrap.

I should try out SSGs from the jamstack list but I am trepidatious because they seem like bloat will sneak in. I hate Javascript and don't want to write it or have it load as part of my site. 

Just need to set aside some time for tests to find the one that hits the sweet spot.


----------



## tingo (Mar 17, 2021)

I thought that having Python as a  (the only) requirement was as low impact as you could get, so first I checked out Pelican. After having used for a while, I found out that it broke easily. Next up, I tried out Ivy - quite low key, right? Well, it turns out that author has decided (for some reason) to get on Python's upgrade now bandwagon; Ivy now requires Python 3.8 (and has done so for quite a few versions). Unfortunately, the machine on which I use Ivy is a shared host and Python 3.8 isn't available, which made me jump through quite a few "rounds" before figuring out how to install an old enough version that it would work with Python 3.7.

TL;DR no matter what you choose you will end up fixing it or switching to something else after some time.


----------



## Cthulhux (Mar 17, 2021)

Actually, TL;DR: Avoid Python-based tools because they’ll break with the next major Python update.

I have found Zola to be a relatively good SSG (like Hugo, but in Rust and with a better template engine) and I am trying to finally replace my aging WordPress with it. But converting the comments is the tricky part yet.



aw16 said:


> The simplest, most unix SSG ever: https://www.romanzolotarev.com/ssg.html (ssg5)


blogc is also quite good:





						blogc - A blog compiler.
					

A blog compiler.



					blogc.rgm.io


----------



## drhowarddrfine (Mar 17, 2021)

Just write HTML and CSS. Unless you need to dynamically load and change content all the time, and all you have is a few pages, it solves all issues, loads the fastest, works everywhere without third party anything. And if you want to use JavaScript later you won't have to install anything or make any changes.


----------



## Cthulhux (Mar 17, 2021)

drhowarddrfine said:


> Just write HTML and CSS.



Which means that you’ll have to maintain multiple files for each new article/post (RSS, index and so on).


----------



## aw256 (Mar 18, 2021)

drhowarddrfine said:


> Just write HTML and CSS. Unless you need to dynamically load and change content all the time, and all you have is a few pages, it solves all issues, loads the fastest, works everywhere without third party anything. And if you want to use JavaScript later you won't have to install anything or make any changes.


Yea that's what I currently do. But it gets error prone to have to go through every page and and make a change whenever I just want to change the header or menu bar, for example. So I'm thinking that if my site gets much bigger I should use a tool to streamline things without adding bloat.


----------



## aw256 (Mar 18, 2021)

Cthulhux said:


> Actually, TL;DR: Avoid Python-based tools because they’ll break with the next major Python update.
> 
> I have found Zola to be a relatively good SSG (like Hugo, but in Rust and with a better template engine) and I am trying to finally replace my aging WordPress with it. But converting the comments is the tricky part yet.
> 
> ...


Zola looks like its worth a try. I was also going to try Hugo because its Go. Thanks!


----------



## drhowarddrfine (Mar 18, 2021)

If you're concerned about your site getting bigger then even SSGs will fall apart at some point. You may hate Javascript but all the good and popular frameworks, the simpler ones, use it as their programming language. Svelte for example which is what I was going to suggest. Others use PHP. 

It's all a crap shoot. I would just pick one and go with it until you find you don't like it. Then you'll know what to look for on your next search. But they're all someone else's idea of how things should be done. That's why we never use them.

(Avoid WordPress like the plague!)


----------



## drhowarddrfine (Mar 18, 2021)

aw16 said:


> Zola looks like its worth a try. I was also going to try Hugo because its Go.


Good choice for that reason.


----------



## obsigna (Mar 18, 2021)

I utilize the ContentTools, this is a WYSIWYG on site editor written in JS. I set the link to the demo already. Click on the purple pencil and start editing. Normal editing happens completely on the client's side. And therefore, you need a backend which is involved when storing the results and for uploading images, etc.

I use this together with my ContentCGI backend written in C and some Objective-C for all my sites. Others use Python based backends. My backend takes also care for searching the site utilizing the ultrafast local search engine Zettair, which is open source written in C.

My BLog does not have menus, but my company’s site (Cyclaero, a lot of content is still missing) does.

Anyway, here the combination of ContentTools+ContenCGI produces static web pages, which do not need to contain any JavaScript. In the course of editing on site, JavaScript is used of course, otherwise you won’t be able to edit directly your web page and see instantly — there might be a time gap of perhaps a few microseconds — what you did.

aw16, depending on the degree of your aversion against JavaScript, this might be acceptable for you or even not.  Again, JavaScript is utilized solely in the course of site editing, and is loaded only into the browser of the website author.  Website visitors won’t see a single ';' of JS, other than has been purposefully added by the author (i.e. you). Website authors do not program the editor's JavaScript code, they use it, exactly like you don't program the code of vi(1) while you're editing text with it, you use is. That means no knowledge of JS is necessary in order to use the ContentTools. However, if your index finger suffers burns already, while clicking the mouse pointing on a website's button which is operated by JavaScript, then of course the ContentTools are not for you.


----------



## kpedersen (Mar 18, 2021)

aw16 said:


> The simplest, most unix SSG ever: https://www.romanzolotarev.com/ssg.html (ssg5)


I do actually quite like this. Though I can't quite understand the point of markdown / lowdown in this mix. For example:

```
**Header**
```

Isn't much easier than:


```
<h1>Header</h1>
```

And for the complex things that HTML makes fairly horrible, markdown can't do anyway (or falls back to HTML).

I am not much of a web developer so my advice is probably not ideal but I personally use m4 and the rest of the UNIX stack. You can check out my sites Makefile here:



			https://github.com/osen/expose/blob/master/expose/Makefile
		


You can also see I have made some m4 "functions" for awkward things like hyperlinks and inline code:


			https://github.com/osen/expose/blob/master/expose/src/html/header.html
		


The key feature that m4 provides is "include" so that you can separate out the site. Up until semi-recently I actually used the clang CPP preprocessor just to do this (with #include) but it was awkward for unbalanced ' quotes "

It looks OK: http://thamessoftware.co.uk/
Possibly a little indie (which is fine for personal projects). Admittedly we are looking to get a rewrite by a proper designer in the coming months with one of our next releases. They will probably drag in 12 different scripting languages and half of the CPAN / PIP. Probably chuck some Rust and crates.io in there for good measure


----------



## aw256 (Mar 20, 2021)

Well, I spent a day converting from hand-made HTML/Bootstrap CSS to Zola. It took 2 or 3 attempts for me to understand the templating language concept, but I have to say one I got it, the transition was way smooth! Zola let me combine HTML and markdown in the markdown files, which is not super clean, I guess, but made it easy to port. Now I met my basic goal, which is to stop having to duplicate header and footer code on every page.


----------



## Deleted member 30996 (Mar 20, 2021)

I took my static site down but every page was hand typed valid XHTML and CSS.

I used CSS buttons for nav but I do remember making a dropdown menu when we were trying to fix the code on the freebsd.org index page..

All I've ever used was a text editor and Gimp, and that's all I needed. I learned to write XHTML at w3schools.com when it first came out. I never used any scripting on my sites and valid code is an absolute must, or it isn't considered to be XHTML, and every page had a button to check it.


----------



## Alain De Vos (Mar 20, 2021)

Sidequestion. What do you use to freely publish/host your static site. Could github be used ?


----------



## Cthulhux (Mar 20, 2021)

It could, but you shouldn’t rely on “free” offers from US companies.


----------



## Deleted member 30996 (Mar 20, 2021)

If I have a free site it will be through Awardspace.com because "free is free" is to them as it is to me. They don't use your free site as an ad display ploy, don't inject code that invalidates my XHTML and no ads are displayed on the site you don't put there yourself.


----------



## Hakaba (Mar 20, 2021)

I use some 'suckless' tool.
Saait :





						README - saait - the most boring static page generator
					






					git.codemadness.org
				



SMU to convert markdown and sxiv with script to push images into a directory (you can chose multiple pictures and press cmd-x + [any] to launch a script for you.
It probably can be better, but as I use npm, node, JavaScript, react and 'design system' at work, i really like the suckless approach at home !


----------



## Hakaba (Mar 20, 2021)

drhowarddrfine said:


> Svelte for example which is what I was going to suggest.


I try to evangelize Svelte at work. But they decide to add kubernetes and PUG in front of the over engineered stacks to build and publish a website


----------



## Cthulhux (Mar 20, 2021)

If your workflow requires Kubernetes, you need a better workflow.


----------



## aw256 (Mar 20, 2021)

Alain De Vos said:


> Sidequestion. What do you use to freely publish/host your static site. Could github be used ?


Yes, you can use github to host. Amazon S3 works too.


----------



## Jose (Mar 20, 2021)

kpedersen said:


> I do actually quite like this. Though I can't quite understand the point of markdown / lowdown in this mix. For example:
> And for the complex things that HTML makes fairly horrible, markdown can't do anyway (or falls back to HTML).


So true. Markdown is only useful for quick-and-dirty things like READMEs and maybe as wiki markup. It's woefully inadequate as a general markup language.


kpedersen said:


> I am not much of a web developer so my advice is probably not ideal but I personally use m4 and the rest of the UNIX stack. You can check out my sites Makefile here:
> 
> 
> 
> https://github.com/osen/expose/blob/master/expose/Makefile


Much as I despise m4, it might be the best tool for this job (yes, I looked.) Your link 404s, unfortunately.


kpedersen said:


> Admittedly we are looking to get a rewrite by a proper designer in the coming months with one of our next releases. They will probably drag in 12 different scripting languages and half of the CPAN / PIP. Probably chuck some Rust and crates.io in there for good measure


Get ready to wait 5-10 minutes for npm to "initialize". I dunno or care what it's doing that takes so long. Probably downloading crucial dependencies like left-pad, for example.


----------



## Jose (Mar 20, 2021)

Hakaba said:


> I try to evangelize Svelte at work. But they decide to add kubernetes and PUG in front of the over engineered stacks to build and publish a website


Gotta love that resume-driven development.


----------



## unitrunker (Mar 20, 2021)

It doesn't meet the OPs requirements but also doesn't require PHP. 






						FreshPorts -- www/nift: Cross-platform open source website generator
					

Nift (aka nsm) is a cross-platform open-source framework for managing and generating websites. It's lightning-fast, developed from the ground up in C++.




					www.freshports.org


----------



## Hakaba (Mar 20, 2021)

m4 and markdown did not have the same scope.
For me markdown is here to ensure that the content of my page is simple
So my "main content" is limited with markdown + script (to inject images as an example).

m4 is a better tool to include subparts as an example.
But for that, I use .shtml (render instead build).

m4 is a good tool as a replacement for the two features.


----------



## kpedersen (Mar 20, 2021)

Jose said:


> Your link 404s, unfortunately.


Yeah, Microsoft has been dicking about with GitHub accounts trying to enforce their broken authentication schemes and 2FA so I am in the process of moving things about.

It wasn't that impressive so nothing has really been missed 

I disliked m4 for a long while because I saw how utterly broken it was in GNU autotools. However if you use it from scratch as a tiny trivial preprocessor (without all the terrible crap), it is very workable.


----------



## a6h (Mar 21, 2021)

Today I found _blogit: _pedantic.software/git/blogit/about


----------



## Cthulhux (Mar 21, 2021)

Don’t most SSGs support Git these days?


----------

