This directory contains everything needed to generate Story theme site using Bagatto.
Look here for a description. HTML5UP and caressofsteel made superb work!
To build the site:
- install or build Janet and Bagatto
- download this repo or clone it
cd
into this directory (the one containingindex.janet
),- and then run
bag index.janet
You should see Bagatto output its progress as it creates the site, but get ready: It's quick!
The generated HTML will now be available in site/
and you can open site/index.html
in your web browser.
It's the index.html
file in this repo. See it here.
I chose to create the dynamic content as .md
files, the rest is hard-coded in the templates.
For example, the gallery header will probably not change much, but the individual
pictures will. Same with the spotlights and items. I added a bit of markdown styles
to the dynamic content Lorem ipsum...
, just for a show..
All dynamic content resides in the content/
directory. Just makes sense.
Have a look at the way hugo, zola and other mainstream big names SSGs work. They are clearly not made to handle single-page sites, they are geared towards multi-page sites and this logic is built into them. You have to bend their rules a bit to handle single page sites. Look at the hugo-story theme source code in order to see it:
- The site content resides in
data/
folder instead ofcontent/
folder. - All the text is pure html, since hugo by design processes markdown files
only in
content/
. - All the text is in few big
.yaml
files, instead of small markdown files for each piece of content. - The
index.html
template calls the partial templates with the relevant.yaml
files hard-coded for context, and there is no way (that I know of) to use context created in thecontent/
folder.
I checked other single-page themes for hugo. They are all trying hard to find ways around the limitations. All this makes generating your preferred single-page site a bit inconvenient..
After seeing the problems with the usual SSG suspects, I looked for something that will work better for single-page sites. I limited myself to compiled SSGs because I wanted simple setup. The least probable choice was Bagatto of-coarse, since I have to learn Janet now and enter the lisp world. And who have heard of it anyhow?!
Well, how lucky!
Janet is an amazing language (I still don't understand much of it..), and the
runtime is unbelievable. The compiled bag
binary (as per my requirement), is
just bytecode running on top of VM, all in a single app. So you have the
full Janet VM at your disposal.
Further, there are no rigid rules here. You have your data, and you have functions operating on it and transforming it the way you like. So simple.
Have a look at index.janet
it's the file that describes how to make the site.
Go take a look at Bagatto own site and the demo sites shipped with it. Read
all the index.janet
files you can find and the Bagatto source (it's short).
It will make you smarter, I promise.
- Calvin Rose, for Janet
- Zach Smith, for Bagatto
- HTML5UP, for the initial Story theme
- caressofsteel, for hugo-story port
This Bagatto theme is licensed under the Creative Commons Attribution 3.0 License.