This static site generator provides a Makefile for building websites with multiple languages and sites. New: markdown support, sitemap generation
Most of the time I have 3 directories:
frags
contains static content likeheader.inc
,footer.inc
, ...sites
contains the content files likeindex.de.inc
,index.en.inc
, ... (notice the language IDs) New:index.en.md
conf
contains setting files (aka sed scripts) for changing data in the static content files (index.de.sed
,index.en.sed
, ...)
Use the shell script initialize.sh
to create a basic web page with almost no
content.
The language tag of header
and footer
is optional. Every (LANG)
in the
BEFORE
and AFTER
variable (config.mk
) is replaced by the correct
language tag.
frags/header.de.inc
<!doctype html>
<html lang="@lang@">
<head>
<title>@page_title@</title>
<meta charset="utf-8">
</head>
<body>
<p>Deutscher Anfang</p>
frags/header.en.inc
<!doctype html>
<html lang="@lang@">
<head>
<title>@page_title@</title>
<meta charset="utf-8">
</head>
<body>
<p>English Beginning</p>
frags/footer.inc
</body>
</html>
sites/index.de.inc
<h1>Deutscher Content</h1>
sites/index.en.md
English Content
===============
conf/de.sed
s/@lang@/de/g
conf/en.sed
s/@lang@/en/g
conf/index.de.sed
s/@page_title@/Deutscher Titel/g
conf/index.en.sed
s/@page_title@/English Title/g
With this version the Makefile provides markdown support. Just use filenames
like index.en.md
instead of index.en.inc
inside your sites
directory and
use make
.
You want to use another markdown parser? No problem: Adjust the config.mk
.
RewriteEngine On
RewriteRule ^initialize.sh$ - [NC,F]
RewriteRule ^config.mk$ - [NC,F]
RewriteRule ^Makefile$ - [NC,F]
RewriteRule ^Readme.md$ - [NC,F]
RewriteRule ^*.inc$ - [NC,F]
RewriteRule ^*.md$ - [NC,F]