Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Building static sites with Neovim

License

NotificationsYou must be signed in to change notification settings

deparr/jolt.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

(ab)using nvim for static site generation

why

  • 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.

workflow

run something like:

nvim --headless"+Jolt build"

and boom! a static site is now available atbuild/

todo / planned / ideas

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 bashvar="$VAR"
      • support multi-line captures
        • rust doc comments don't work because the rust parser is trash
      • support language specific treesitter capture groups
        • egfunction.builtin.zig different fromfunction.builtin
  • 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

License

The Djot lua module (all files inlua/djot) is licensed underlua/djot/LICENSE

About

Building static sites with Neovim

Topics

Resources

License

Stars

Watchers

Forks

Languages


[8]ページ先頭

©2009-2025 Movatter.jp