Package: kilvin
kilvinKilvin is a simple static site generator. It takes markdown text and turns it
into a static webpage using layouts. Changes can be made to the page's content,
URLs, and the way the site looks.Minimal templating languageMinimal config with support for custom variablesAutomatic table of contents generationGetting StartedPrerequisitesKilvin requires the following:Python version 3.9 or higherpip : package installerInstructionsInstall all prerequisites.Install thekilvin.$pipinstallkilvinCreate a siteCreate a new kilvin site at./my_project$kilvininitmy_projectChange into your new directory.$cdmy_projectBuild the site.$kilvinbuildMake it available on local server.$kilvinserverCommand LineKilvin has several commands:Usage: kilvin [OPTIONS] COMMAND [ARGS]...

  Kilvin is a simple static site generator. It takes markdown text and turns
  it into a static webpage using layouts.

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Commands:
  build   Build the current project
  init    Create directory structure for the project
  new     Create a new markdow post in ./content dir
  server  Serve the current projectHere are some of the most common command:kilvin init PATH:Create a new kilvin site with requisite directory structure.kilvin new PATH:Help create new markdown pages for the project.All the new pages are stored in content directory.Example:Forcontent/about.md$kilvinnewabout.mdForcontent/blog/today.md$kilvinnewblog/today.mdkilvin build:Build the site from./contentfiles using template in./layoutand save them./publicdirectory.All the non-markdown files in./contentare copied directly without any changes../staticis also directly copied to./public.kilvin server:Serves the site locally.ConfigEditconfig.tomlfor changing the configuration for the project.Default ConfigurationBasic configuration required for building the site.title = 'My Blog'
url = "https://myblog.xyb"
description = 'My corner of the internet.'

[author]
name = "Kilvin"
email = "kilvin@myblog.xyb"Custom ConfigurationCustom variables can also be defined inconfig.toml.var1 = 123

[name1]
var2 = "abcxyz"
var3 = 123All the variables inconfig.tomlcan be accessed in HTML templates withsitevariable.
Example:{{ site.title }}{{ site.author.name }}{{ site.name1.var2 }}Pages & Layoutskilvin organize the rendered site in the same structure that is used to organize the
source conent.└── content
    └── about.md
    ├── posts
    |   └── _index.md
    |   ├── firstpost.md
    |   └── secondpost.md
    └── quote
        └── _index.md
        ├── first.md
        └── second.md└── public
    └── about
    |   └── index.html
    ├── posts
    |   └── index.html
    |   ├── firstpost
    |   |   └── index.html
    |   └── secondpost
    |   |   └── index.html
    └── quote
        └── index.html
        ├── first
            └── index.html
        └── second
            └── index.htmlPagesAll markdown files are referred as a Pages.Creating a PageTo create a page, add a markdown file to./contentdirectory.Pages can also be organized in sub directories, and all sub directories should have a_index.mdpage.All pages must have a front matter, enclosed in---which is used to specify the template or other meta data, along with custom data.Example:---
template: single.html
title: Why does it have to end?
subtile: A survivor dies.date: 2022-28-09---[TOC]


markdown heretemplate,tilte,subtitleanddateare mandatory.Iftemplatefield is empty, then default templates are used.All the variables can be accessed usingmetavariable in template.Example{{ meta.title }}{{ meta.subtitle }}{{ meta.date }}Index PageAll the directories should have_index.mdpage.Index Page is special as it has access to variablepages.Layoutkilvin uses Jinja2 for templating../layoutcontains the templates for the Pages../layoutshould havelist.htmlandsingle.htmlas the default templates.VariablesAll the templates have access to a bunch of variables.site: date inconfig.tomlmeta: data from front matter of the pagebody: rendered markdown from the pagepages: (only available to index template) list of all the page in directoryTemplate Usage<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>{{ site.title }}</title>
    <link rel="stylesheet" href="/static/style.css">
  </head>
  <body>
    <nav>
      <a href="/">Home</a>
      <a href="/blog/">Blog</a>
    </nav>
    <h1>{{ meta.title }}</h1>
    <section>
      {{ body }}
    </section>
  </body>
</html>