Shell & Pandoc simple Static Site Generator.
Can be used alone, but Awesome with sh:erpa CLI Assistant, along with notes management, todos, bookmarks, web search from the console, etc.
Clone the repo somewhere
git clone https://github.com/AndiKod/calepin.git
Make sure pandoc , sass, purgeCSS & entr are installed. On something like Ubuntu 22 (full or inside WSL), Debien, & those based upon them you can just go:
npm i -g sass purgecss
sudo apt-get install pandoc
sudo apt-get install entr
If you are rolling something like Gentoo or Arch, I bet you know how to get those packages.
- Edit the path to your root folder inside `bin/conf'. That's all. For next times, clonning the Calepin and edit the path will be enough.
Available commands from inside the bin/
folder:
Build sass, compile templates & md, copy assets and palce everything in the dist
folder, so that we could serve it from there. Unused css are removed. Run again when files are changed inside src/
folder.
Launch npx http-server
or install it on the first run. Your Calepin from dist/
is availble at http://localhost:8080
Compile everyting to dist/
like watch
but with css in compressed mode.
Run Vercel once from dist/ to establish the link, then just deploy
the next times.
- frontmatter data
- layouts
- partial-layouts
- conditionals & loops in layouts
- code highlight out of the box
- math formulas
- styled divs generated from markdown
- attributes & class/id applied from within markdown
- auto en-dash and em-dash, md to visual checkbox todo, ...
Check the docs about the Templates and Pandoc's Markdown on pandoc.org, and obviously get the latest version.
For now src/index.md
will compile to dist/index.html
, and src/somepage.md
will compile to dist/somepage/index.html
to have clean urls like https://mysite.com and https://mysite.com/somepage.
Integrate with sh:erpa to get Git commands, edit md files, todos, search the web...
s toGit
:save/push to the remote, with default or custom msgs fromGit
:pull in the most recent versions sync
:either push changes, or pull (just in case)s --help
for docs and commands lists, in english or français
TODO: Looking into 'content collections' like posts or whatever.
As an alternative, If you have something like that still installed, clone the repo in the specific root, or download and drop it there.
# Just open it in a browser
firefox http://localhost/calepin/dist
For the record, but one of the other methods should be enough.
python -m SimpleHTTPSertver 8080
You eventually need to Ctr+F5 to refresh the page. StackOverflow. There are other options around Python (if you run v2 or v3), this one worked for me when testing.
To be continued ;)
Calepin & Sh:erpa are tools under active developpement, stick around to see where it goes. A YouTube #devLog serie is planned to talk about the journey.
Andrei