- Notifications
You must be signed in to change notification settings - Fork0
Building static sites with Neovim
License
NotificationsYou must be signed in to change notification settings
deparr/jolt.nvim
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
(ab)using nvim for static site generation
- I want a simple, static site with code highlighting
- djot has a lua implementation
- nvim has
:TOhtml
and treesitter - -> why shouldn't I use my editor to build my site?
Caution
This is janky software I made for myself. There might be hardcodingand assumptions. Commands might not even be wired up to anything.There are no tests. Read before use and use carefully.
run something like:
nvim --headless"+Jolt build"
and boom! a static site is now available atbuild/
loosely ordered by priority
- headless ux should be equivalent to interactive
- code block highlighting based on neovim colorscheme
- works, but relying on
:TOhtml
is pretty janky (would need to beproperly parsed). look intogenerating the html myself with treesitter.- can you just throw a []u8 at treesitter and get a parse treeback ???
- this would also make the html a little cleaner
- support highlight nested captures
- eg bash
var="$VAR"
- eg bash
- support multi-line captures
- rust doc comments don't work because the rust parser is trash
- support language specific treesitter capture groups
- eg
function.builtin.zig
different fromfunction.builtin
- eg
- works, but relying on
- feature-full user commands
- command line parsing is a little jank, should revisit
- templates: current templates are hardcoded
- should be able to nest templates
- templates should be able to be scanned in any order
- components ???
- watch mode
- use libuv to watch the uses content dir for changes
- should be granular if possible, only rebuild what changed
- support live template changes
- should be able to serve at the same time
- serve mode
- run a user supplied system command to serve the build directorylocally
- headless: pass-through cmd output to terminal
- interactive: display cmd output in a split or tab
- vim docs
- allow sub-dirs to have an index. i.e.
/blog/blog.dj
and/or/blog/index.dj
becomes/blog/index.html
- config options
- tree-walk build mode: starting from root pages, build thereachable link tree
- which "url mode": i.e. whether
/blog/some-post.dj
shouldbecome/blog/some-post.html
or/blog/some-post/index.html
The Djot lua module (all files inlua/djot
) is licensed underlua/djot/LICENSE
About
Building static sites with Neovim
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.