| 
1 |  | -<h1 align="center"><img src="logo.png" width="200" height="200" alt="LuaWebGen" title="LuaWebGen"></h1>  | 
 | 1 | +<h1 align="center"><img src="gfx/logo.png" width="200" height="200" alt="LuaWebGen" title="LuaWebGen"></h1>  | 
2 | 2 | 
 
  | 
3 |  | -<p align="center"><img src="https://img.shields.io/badge/version-0.19-green.svg" alt="version 0.19"></p>  | 
 | 3 | +<p align="center">  | 
 | 4 | +	<a href="https://github.com/ReFreezed/LuaWebGen/releases/latest">  | 
 | 5 | +		<img src="https://img.shields.io/github/release/ReFreezed/LuaWebGen.svg" alt="">  | 
 | 6 | +	</a>  | 
 | 7 | +	<a href="https://github.com/ReFreezed/LuaWebGen/blob/master/LICENSE">  | 
 | 8 | +		<img src="https://img.shields.io/github/license/ReFreezed/LuaWebGen.svg" alt="">  | 
 | 9 | +	</a>  | 
 | 10 | +</p>  | 
4 | 11 | 
 
  | 
5 | 12 | **LuaWebGen** - static website generator, powered by Lua. Somewhat inspired by [Hugo](https://gohugo.io/).  | 
6 | 13 | 
 
  | 
7 | 14 | Webpages are generated using HTML and markdown *templates* with embedded Lua code. CSS files can also include code.  | 
8 | 15 | 
 
  | 
 | 16 | +Download: [latest release](https://github.com/ReFreezed/LuaWebGen/releases/latest)  | 
 | 17 | + | 
9 | 18 | - [Why?](#why)  | 
10 | 19 | - [Example](#example)  | 
11 | 20 | - [Installation / Usage](#installation--usage)  | 
@@ -70,42 +79,81 @@ Page template, `page.html`:  | 
70 | 79 | 
 
  | 
71 | 80 | 
 
  | 
72 | 81 | ## Installation / Usage  | 
 | 82 | +There are two versions of LuaWebGen: Windows and universal.  | 
 | 83 | +Begin by [downloading](https://github.com/ReFreezed/LuaWebGen/releases/latest) and unzipping the program somewhere.  | 
 | 84 | + | 
 | 85 | + | 
 | 86 | +### Windows  | 
 | 87 | +Just run `webgen.exe`, like this:  | 
 | 88 | + | 
 | 89 | +```batch  | 
 | 90 | +cd path/to/siteroot  | 
 | 91 | +path/to/webgen.exe command [options]  | 
 | 92 | +```  | 
 | 93 | + | 
 | 94 | +If you add the program folder to your [PATH](https://www.computerhope.com/issues/ch000549.htm)  | 
 | 95 | +it's a bit nicer:  | 
 | 96 | + | 
 | 97 | +```batch  | 
 | 98 | +cd path/to/siteroot  | 
 | 99 | +webgen command [options]  | 
 | 100 | +```  | 
73 | 101 | 
 
  | 
74 |  | -LuaWebGen requires Lua 5.1 and these libraries:  | 
 | 102 | +> **Note:** The documentation uses this format.  | 
75 | 103 | 
  | 
76 |  | -- [Lua-GD](https://ittner.github.io/lua-gd/) for image manipulation.  | 
77 |  | -- [LuaFileSystem](https://keplerproject.github.io/luafilesystem/) for file system access.  | 
78 |  | -- [LuaSocket](http://w3.impa.br/~diego/software/luasocket/home.html) for URL handling.  | 
79 | 104 | 
 
  | 
80 |  | -If you're on Windows you can simply install [Lua for Windows](https://github.com/rjpcomputing/luaforwindows).  | 
 | 105 | +### Universal  | 
 | 106 | +This version requires these things to be installed:  | 
81 | 107 | 
 
  | 
82 |  | -> **Note:** LuaWebGen has only been tested on Windows.  | 
 | 108 | +- [Lua 5.1](https://www.lua.org/)  | 
 | 109 | +- [LuaFileSystem](https://keplerproject.github.io/luafilesystem/) - required for file system access.  | 
83 | 110 | 
 
  | 
 | 111 | +Some functionality also require these things:  | 
 | 112 | + | 
 | 113 | +- [Lua-GD](https://ittner.github.io/lua-gd/) - required for image manipulation.  | 
 | 114 | +- [LuaSocket](http://w3.impa.br/~diego/software/luasocket/home.html) - optional, for more CPU-friendly auto-builds.  | 
 | 115 | + | 
 | 116 | +> **Hint:** On Windows you can simply install [Lua for Windows](https://github.com/rjpcomputing/luaforwindows)  | 
 | 117 | +> which includes everything that's needed in a neat package.  | 
 | 118 | +
  | 
 | 119 | +Run the program like this:  | 
 | 120 | + | 
 | 121 | +```batch  | 
 | 122 | +cd path/to/siteroot  | 
 | 123 | +lua path/to/webgen.lua command [options]  | 
 | 124 | +```  | 
 | 125 | + | 
 | 126 | +> **Note:** LuaWebGen has only been tested on Windows so far.  | 
 | 127 | +
  | 
 | 128 | + | 
 | 129 | +### Build Website  | 
84 | 130 | To generate a website, run this from the [command line](https://github.com/ReFreezed/LuaWebGen/wiki/Command-Line):  | 
85 | 131 | 
 
  | 
86 | 132 | ```batch  | 
87 |  | -cd path/to/site/root  | 
88 |  | -lua path/to/LuaWebGen/main.lua build  | 
 | 133 | +cd path/to/siteroot  | 
 | 134 | +webgen build  | 
89 | 135 | ```  | 
90 | 136 | 
 
  | 
91 | 137 | LuaWebGen expects this folder hierarchy:  | 
92 | 138 | 
 
  | 
93 | 139 | ```  | 
94 | 140 | site-root/  | 
95 |  | -    content/           -- All website content, including pages, images, CSS and JavaScript files.  | 
96 |  | -        index.html|md  -- Homepage/root index page.  | 
97 |  | -    data/              -- Optional data folder. Can contain Lua, TOML and XML files.  | 
98 |  | -    layouts/           -- All HTML layout templates.  | 
99 |  | -        page.html      -- Default page template.  | 
100 |  | -    logs/              -- Automatically created log file folder.  | 
101 |  | -    output/            -- Automatically created output folder.  | 
102 |  | -    scripts/           -- Optional Lua script folder. The scripts must return a function.  | 
103 |  | -    config.lua         -- Site-wide configurations.  | 
 | 141 | +    content/            -- All website content, including pages, images, CSS and JavaScript files.  | 
 | 142 | +        index.(html|md) -- Homepage/root index page.  | 
 | 143 | +    data/               -- Optional data folder. Can contain Lua, TOML and XML files.  | 
 | 144 | +    layouts/            -- All HTML layout templates.  | 
 | 145 | +        page.html       -- Default page template.  | 
 | 146 | +    logs/               -- Automatically created log file folder.  | 
 | 147 | +    output/             -- Automatically created output folder.  | 
 | 148 | +    scripts/            -- Optional Lua script folder. Scripts must return a function.  | 
 | 149 | +    config.lua          -- Site-wide configurations.  | 
104 | 150 | ```  | 
105 | 151 | 
 
  | 
106 | 152 | Everything in the *content* folder will be processed and end up in the *output* folder.  | 
107 | 153 | 
 
  | 
108 | 154 | > **Note:** The *output* folder is automatically cleaned from files and folders that do not exist in the *content* folder,  | 
109 | 155 | > so it's not a good idea to save files in the *output* folder.  | 
110 | 156 | 
  | 
 | 157 | +See the [wiki](https://github.com/ReFreezed/LuaWebGen/wiki) for the full documentation.  | 
 | 158 | + | 
111 | 159 | 
 
  | 
0 commit comments