Pelican static site generator 4.5
blog.getpelican.com
blog.getpelican.com
“What Pelican does is take a list of files and process them into some sort of output. Usually, the input files are reStructuredText and Markdown files, and the output is a blog, but both input and output can be anything you want.”
[1] https://docs.getpelican.com/en/stable/internals.html#overall...
We put a lot of thought and work into Pelican, with the intention of making web publishing as easy and fun as we can make it. We welcome your participation as well, so please don't hesitate to help out and contribute! https://docs.getpelican.com/en/latest/contribute.html
However, its documentation is unfortunately weak for someone coming into it fresh. It jumps into writing content without first walking you through concepts, terminology, and how inputs ultimately get turned into outputs. This is too bad, since it seems like a really nice piece of software, and the kind of issue that might drive away new users.
Even the example link provided to the Internals section is at the wrong level of abstraction for a new user uninterested in the internals to understand the set of concepts they need to grasp to generate a whole site.
not sure how well maintained it is though
MdBook is another good one, as hip as it goes, written in Rust nonetheless :-)
sudo xbps-install pelican
I've used rbenv before and found it to be a PITA.http://stephenbalaban.com/static-site-generation-in-50-lines...
Most of the work is just creating the index.
When it comes to my personal websites, I use org mode, because publishing is actually an exception in my day to day life. I use emacs for org mode only, but I use it all day long to keep notes, track todos, document projects, write prose and messages. Sometimes, I think something is worth publishing, so I mark it with the appropriate tags, run the publish command and let syncthing update the websites.
I have used hugo for a dozen significant project and I like it. I have chosen hugo over the alternatives because I prefer go to javascript, ruby and python in almost all possible regards. I even teach classes to journalism students with hugo and gitlab.
Static site generators are great for "projects" but as a individual willing to share some mildly interesting content as a side effect of his daily activities, I still consider them too much work and maintenance.
Also that blog is made with pelican and hosted with GitHub pages so you can see some of pelican's features. I'm using it for more than 7 years and am really happy with it (the fact that I am familiar with python and can debug some problems myself definitely helps)
edit: It seems one might be able to write a custom reader for that according to https://docs.getpelican.com/en/stable/internals.html#how-to-...
[1] https://docs.getpelican.com/en/stable/internals.html#overall...
The cloudflare CDN is there because your theme includes "auto-render.min.js" and "katex.min.js" from cdnjs.cloudflare.com. They are in script tags in your homepage HTML. You can verify this with: > curl -L ahelwer.ca | grep 'auto-render.min.js'
You can check my domain if you want an example of a CNAME record: > dig CNAME www.jeremypoole.ca
I am also using Hugo, I modified a theme called "coder".
As far as avoiding trackers, it would depend on what you mean by tracker. In your case, the external requests are for fonts and a couple of JavaScript dependencies. You could easily host those yourself instead of using the CDN, and then there would be no third-party HTTP requests.
As a fellow .ca HNer, I would gladly help you out. Feel free to hit me up.
On the free tier of Cloudflare a site is deployed to 194 locations. That can knock a couple of hundred ms off of a page load time. It might be worthwhile if you need something to be especially fast.
That said, Cloudflare is much more of a hassle to set up. Netlify is ludicrously easy. That's one of the many things I like about it.
I use Cloudflare in front of Netlify.
Step 2: add the domain on Cloudflare and let it grab the DNS entries Netlify made
My site doesn't load any files from a different domain since I removed the Twitter share button javascript[0], except for one page.
I moved the mailchimp signup to a separate page to isolate their JS code to just that page.
[0] https://tacosteemers.com/articles/2020-08-30-twitter-share-b...
If we depend on other people's hosting and themes then we just kind of have to accept what they offer.
But getting our own hosting doesn't have to be difficult. There are many cheap providers that give sftp access, for example. Pelican comes with a script for uploading to sftp.
Only if you have a licence for it — font licences are typically prohibitively expensive for individuals' use.
Open source doesn't necessarily mean free to use for whatever you want. Which licence a font on Google Fonts uses varies - common ones are Apache and Open Font Licence, but you should check the licence file in any font pack you download.
Personally, I avoid third-party requests. CDNs are so HTTP1.1.
You may be able to disable this in the theme config if you don't use it.
I guess the whole point of using cloudflare as the cdn is so that people can reuse this from cache.
Whereas dumb people like me hand code a site and keep small chunks of code or 'boot strap' type folders where we can re-use old assets quickly and with the knowledge of exactly what's in them.
I don't use Hugo, etc, but it seems odd to me that it's not abundantly clear how to nix CDN and Google asset references from the site generation code.
All static site generators do is take a bunch of inputs (markdown files, templates, config, images, etc.) and process them to output a directory of HTML and assets. It's usually trivial to do a search on the input side and identify the source of the problem code. Commenting it out and reprocessing results in it being removed.
You only run into complications when there is some odd dependency between the static site generator and the inputs. Generally, it'll delegate everything to the templates it uses (good separation of concerns), but sometimes there is a weird config option, or convention you are supposed to use.
Perhaps I need to look into these things a bit more!
I am not saying no one else needs it. However, the majority of sites I've seen that are generated via static site generators are using static site generators just because they can.
[0]. https://sergey.cool/
So an SSG is an attempt to put an abstraction on top of this, which may have some benefits but also introduces a lot of relatively uncalled for complexity and fragile dependency chains. And because the nature of the task is very heterogeneous, the API will either have to be very allowing (and less useful as an abstraction) or impose various assumptions and restrictions on how you do things. That’s very fertile ground for a lot of people to want to create their own take on it as they run into limitations of existing SSGs.
"Why are there so many static site generators?"
It is rather: "Why isn't there a static site generator generator?"I think this is it exactly. You could roll your own if you wanted and package it as a library without too much difficulty and I haven’t found compelling reasons why any one static generator is superior to another. It seems to come down to which generators are supported by default by your hosting service, or your language of preference if you’re building custom extensions.
I'd expect some screenshots and some points. All I learned from reading it is that it supports markdown but not really what kind of site it's for (e.g. blogs like wordpress etc).
I'm looking for a static generator to make a blog (static mainly for security and because I don't want to do anything complex anyway). But not sure if this will suffice.
The site itself is sort of the screenshot.
I don't think so, and will give a few examples why. I like Pelican because when working manually it is easy to mess up some HTML tags, forget to update an article listing, category listing, or RSS feed. Creating and adding PlantUML diagrams is more work manually than it is when integrated with Pelican. Pelican even tells me when I accidentally mess up an internal link.
It simplifies my publishing such that I actually have enough time and energy to do so, and in that sense it is not unneeded complexity.
Maybe they should be called static blog generators instead.
PS. I liked your post about the returned parrot.
When I tried Hugo the first time, I took me more than a day to have a website with the look and feel I wanted. The static generators are good for getting some initial website up and running, but they have so many hidden and poorly documented features that it takes enormous amount of time to customize them.
On the other hand when the site is up and running changes a very fast and easy - mostly because of the markup language support.
Pelican is way more customisable, you can write Python scripts to do whatever you want. The downsides: you need to have a virtualenv and that it is pretty slow (especially syntax highlighting). It is awesome overall though, my favourite after Zola ;)
I'm currently using Zola + python/js scripts to do things Zola can't and considering a move to something like Pelican.
In practice to use PostCSS, you need npm to install plugins, and maybe a `postcss.config.js`, so there are no advantages of having that PostCSS call in Zola's `config.toml` or as a script in `package.json`.
I don't really see how others SSG would handle that. Hugo just shells out a command to `postcss-cli` that needs to be installed (https://gohugo.io/hugo-pipes/postcss/), along with whatever plugins you are using. It's not really something "built-in".
Can anyone share how Pelican's rendering speed compares to Jekyll and Hugo?
For the record, I use Python daily and I’ve never written a line in Go. But with these static site generators, most people won’t ever need to look under the hood.
Edit: I see the main feature for Pelican 4.5 is namespace plugins, which should prevent some headaches.
Have you tried the --incremental flag after your initial creation of the page?
My site has 300 blog posts, over 150 drafts and dozens of other pages but when I'm actively writing a post there's about a 1 second delay between saving the file and seeing it reload in the browser with live reload using --incremental and about 20 seconds without it.
Another note on using Hugo. I have really enjoyed working with Hugo, both for the speed and for the overall experience. I ran into an issue where the table of contents was not rendering properly. I believe it's a known bug, perhaps just with some themes. Since I'm not familiar with Go yet, I came up with a quick fix by writing a quick Python script that converts all the incorrect TOC links to the correct links for my site. It's plenty fast for me, and I can always make it faster by using bash or sed, or learning a little Go and patching Hugo. At some point I'd like to do that just to contribute back to the project. So it's quite possible to use a static site generator in a language you're less familiar with, and create quick tooling scripts around it for any issues you run into that you don't want to deal with in the generator's native language.
I don't love the template language but aside from basic template features like if/then/else/not/forEach I don't really find I need to do much fancy when jumping between different static site generators or even WordPress. Hugo's speed wins out for me a lot of the time.
However, before migrating I suggest:
- using Jekyll's --incremental flag
- move your asset pipeline into a separate process (webpack --watch)
- reduce any Jekyll gems (each one adds considerable overhead)
If you want to leave Jekyll, I also recommend Eleventy. It's fast, require very little work to migrate from Jekyll, and can create pages from data.
I ended up using staticjinja instead. And after sticking with it for over a year now, I'd still recommend it if Pelican features like RSS feeds and code syntax highlighting seem like overkill for your project.