spelled as Loua Oueb
It's for generating web sites, in less than 100 lines of Lua.
More exactly, generating web pages with pattern replacing.
It's useful if you have a static website, in several languages.
You must have Lua installed.
It should work with all flavors of Lua if > 5.1 .
Prepare a directory templates containing your sources files and the patterns files.
A source file has a .tpl extension.
Pattern files have the same basename than source file, with language as extension.
filename | contains |
---|---|
templates/foo.tpl | template file (classical html, with patterns to insert) |
templates/foo.en | patterns file (english) |
templates/foo.fr | patterns file (french) |
A template file will contain a list of patterns name, followed by text to insert.
[pattern 1]
This text will replace the above pattern in the associated template file.
[foobar]
Same for this one, and so on.
Links in template file must be written with a .tpl suffix.
That is : <a href="foo.tpl">foo</a>
will become after generation foo.en.html and foo.fr.html , depending of generated file.
See the templates directory for a full sample.
When templates directory is ready, launch ./luaweb
and here you go.
Generated files will be found in final subdirectories.
If final doesn't exist, it is created.