Skip to content

Aadv1k/kevlar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kevlar v2

An utterly simple and fast Static Site Generator built using C

  • [✅] Simple and fast
  • [✅] HTML-first approach
  • [✅] Crossplatform (Tested on Windows 11 v21H2 and Debian GNU/Linux 11 x86_64)
  • [❌] JS-first SPA experience
  • [❌] Frameworks and external build tools
  • [❌] Plugins and lifecycle hooks

Install

To get kevlar, you can either get a binary from releases or build from scratch; instructions for which are given here.

To get start with kevlar, you need GCC and make which are the primary build tools used by kevlar

unix-like

build

git clone https://github.com/aadv1k/kevlar
cd kevlar && make all
./bin/kevlar help

windows

You may need something like mingw32-make, and gcc for windows for this to work

git clone https://github.com/aadv1k/kevlar
cd kevlar && make kevlar_win32
"bin/kevlar.exe" help

Recipes

Kevlar has it's own markdown loader if you would like to build it as it's own executable you can run make md2html You can build the loader kevlar uses to parse .md files as their own executables by running.

You will get the respective CLI

CLI

$ kevlar
kevlar <cmd> <opt>
  help       -- print this help message
  new        -- create a new site skeleton
  new-post   -- create a new post with defaults
  build      -- build if in a kevlar project

kevlar new <NAME>

Sets up a basic skeleton for a site and a basic config.ini

theme=listing-kevlar-theme
  • theme=: looks for the given theme within the ./templates/ dir.

kevlar new-post <TITLE>

Generates a .md file in the current folder with the following archetype

Title=This is a title
Date=2023-01-24 17:44:10
Order=1
  • Title: the name of the link that will show up with --TITLE--
  • Date: current date, put AS-IS with --DATE--
  • Order: the order in which the post will show up in --LISTING--

Config

the only required config is the theme option in the config.ini files.

Templating

*.html

Tags Description
--HEADER-- Reads and parses header.html in your theme
--FOOTER-- Reads and parses footer.html in your theme
--SCRIPT ./script.js-- Finds the provided file within yout theme and inserts an inline script
--STYLE ./style.css-- Finds the provided file within yout theme and inserts an inline style
--CUSTOM_TAG-- will look up the tag (lowercase) in config.ini, where you can provide the option for this tag

post.html

Defines the layout of a post

Tags Description
--CONTENT-- The parsed markdown content

entry.html

Defines to how a singular list item within --LISTING-- will look like

Tags Description
--DATE-- The Date= option in the post file
--PATH-- Html link of the parsed post
--CONTENT-- parsed html content

index.html

Tags Description
--LISTING-- provides a list of all posts based on entry.html

About

A crossplatform, batteries-included zero-dependency static site generator built using pure C

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published