- Scheme 97.7%
- Makefile 2.3%
| builds | brought back markdown, to make this a more of a general-use project | |
| src | brought back markdown, to make this a more of a general-use project | |
| .gitignore | progresss | |
| Makefile | brought back markdown, to make this a more of a general-use project | |
| README.md | brought back markdown, to make this a more of a general-use project | |
lol
a static website generator in chicken scheme.
page contents
features
- sleep deprived, rushed, no-time-to-write dad documentation
- not scalable
- badly programmed
- the programmer had a lot of fun writing it
- markdown for source files (john gruber's markdown, so indentation is used for codeblocks, instead of three backticks.)
- directory structure of the source directory is copied to the build directory
- supports copying static assets to the build directory
- optionally generate an rss feed
- optionally generate a list of posts
- optionally clean build directory before building
- built-in local web server for previewing your work
- templates for html pages, a page containing a list of posts, and the rss feed
- config file where you can customize built-in variables or create new ones
caveats
- lots
disclaimer
i wish i could make this documentation a little more detailed, but right now i don't have the time or energy to, and want to spend that time and energy programming, because it makes me happy. maybe i'll try to add to this when i'm in the mood, but i can't guarantee anything.
requirements
- a unix-like operating system
- chicken scheme 5
- utf8 egg
- lowdown egg
- spiffy egg
if you use an x86_64 linux system, there is a binary that you can use in the
builds directory.
compilation
by default, the Makefile compiles a static binary in the builds directory of
this Git repository.
to compile lol from source, following the steps below:
- run
make dependenciesas root. - run
make.
installation
~/.local/bin is the default installation directory. you'll need this directory
in your $PATH, so you can run the lol command from any directory.
to install lol, run make install.
usage
run lol <command>, where <command> is one of the commands below:
help: display the help message.init: create the files and directories that are required for generating a website.build: generate a website.preview: preview your website on a local http server.
configuration
this section describes which templates that built-in variables populate by default, conditional settings, and the purposes of the default directories, files, and templates.
default variables
you can change the value of the variables described in this section by editing the config.scm file.
author: populates a placeholder in thetemplates/page.htmltemplate.description: populates a placeholder in thetemplates/page.htmltemplate.keywords: populates a placeholder in thetemplates/page.htmltemplate.domain: populates placeholders in thetemplates/page.htmlandtemplates/channel.xmltemplates.rss-file: populates placeholders in thetemplates/page.htmlandtemplates/channel.xmltemplates.
run-time variables
you can't change the value of the variables described in this section, but you can move these variables around the template files, or remove these variables from templates.
page-title: populates placeholders in thetemplates/page.htmlandtemplates/item.xmltemplates. the first line of each file in theposts-directorypopulates each instance ofpage-titlein the templates that it occurs.page-url: populates a placeholder in thetemplates/item.xmltemplate. local pathnames to source files are converted topage-urls.page-date: populates a placeholder in thetemplates/item.xmltemplate. the third line of each file in theposts-directorypopulates each instance ofpage-datein the templates that it occurs.css: refer to the information about thecss-filein the files section.page-contents: populates thetemplates/page.htmltemplate with html that's generated from markup files in thesourcedirectory.links: populates thetemplates/posts.txttemplate with a list of links.rss-items: populates thetemplates/channel.xmltemplate with a list of rss<item>s. these<items>are customizable using thetemplates/item.xmltemplate.
conditionals
you can change the value of the variables described in this section by editing the config.scm file.
clean-build-directory?: if"yes", then thebuild-directoryis deleted and recreated before building.generate-posts-page?: if"yes", then a list of posts is generated at<build-directory>/<posts-directory>/index.htmlby recursively searching theposts-directoryfor markup files..- the first line of each file should have a markup h1 title.
- the third line of each file should have a date in the format of
yyyy-mm-dd hh:mm.
generate-rss-feed?: if"yes", then an rss feed is generated at<build-directory>/<rss-file>by recursively searching theposts-directoryfor markup files.- the first line of each file should have a markup h1 title.
- the third line of each file should have a date in the format of
yyyy-mm-dd hh:mm.
directories
you can change the value of the variables described in this section by editing the config.scm file.
build-directory: the directory where your website is generated.source-directory: the directory that contains your markup files and directories. the structure of this directory is copied to the build directory. for example, if you have a markup file atsource/friends/list-of-friends.md, then abuild/friends/list-of-friends.htmlfile is created.assets-directory: the directory containing items that you want copied over to thebuild-directory.templates-directory: the directory that contains the templates for html and rss generation.posts-directory: the directory that's recursively searched for markup files ifgenerate-posts-page?is"yes". the first line of each markup file should contain a markup h1 title, which is used as the link title for each post on the posts page. the path of the file is parsed and converted into a link for each post on the posts page.
files
you can change the value of the variables described in this section by editing the config.scm file.
css-file: the contents of this file replaces the{{css-file}}placeholder in thehtml-page-template.rss-file: the filename of the rss feed file.
templates
you can move the {{placeholders}} around the template files described in this section.
html-page-template: a file with placeholder values that are replaced with values in theconfig.scmfile. all markup pages use this template.posts-page-template: a file with placeholder values that are replaced with values in theconfig.scmfile. if a{{links}}placeholder exists in theposts-page-template, then a list of links replaces the{{links}}placeholder. the list of links is generated from markup files in theposts-directorydirectory. the posts page is generated at<build-directory>/<posts-directory>/index.html.rss-channel-template: a file with placeholder values that are replaced with values in theconfig.scmfile.rss-item-template: a file with placeholder values that are replaced with values in theconfig.scmfile, and values that are generated from the first and third lines of each file in theposts-directory. refer togenerate-rss-feed?for more information about the first and third lines of each file in theposts-directory.