ferron

Ferron is a fast and simple static website generator made with Lua.
Log | Files | Refs | Submodules | README | LICENSE

commit 9e0ae21b2a6e16db220d4549ba9110827f58d687
parent f9551fba168122701f8a8e664f4f96c0e2c10597
Author: Hugo Soucy <hugo.soucy@savoirfairelinux.com>
Date:   Fri,  1 Dec 2017 15:52:51 -0500

Merge branch 'master' of github.com:hs0ucy/ferron-ssg into dev

Diffstat:
MREADME.md | 36+++++++++++++-----------------------
Msites/ferron-ssg.tld/archetypes/.gitignore | 1+
Asites/ferron-ssg.tld/archetypes/doc.json | 9+++++++++
Asites/ferron-ssg.tld/archetypes/doc.md | 2++
Msites/ferron-ssg.tld/content/index.json | 8+++-----
5 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/README.md b/README.md @@ -37,39 +37,29 @@ After that with your favorite texteditor or IDE edit the emacs site.config.lua ``` -* To simply build a web site: - * `lua ferron.lua` -* To build a site in development mode: - * `lua ferron.lua --dev` +### Architecture of a ferron website -## Architecture of `ferron-ssg` directory - -* `config.lua` -* `rhino` -* `ferron.lua` -* **`functions`** - * `create-archetype-content.lua` - * `exec.lua` - * `file-utils.lua` - * `get-archetypes.lua` - * `get-sites.lua` - * `make-atom-feed.lua` - * `make-lists-of-pages.lua` - * `make-pages.lua` - * `move-to-publichtml.lua` - * `set-site.lua` - * `string-utils.lua` - * `table-utils.lua` - * `template-utils.lua` * **`sites`** + * .gitignore * **`ferron-ssg.tld`** * **`archetypes`** + * `.gitignore` + * `doc.json` + * `doc.md` * **`content`** + * `index.json` + * `index.md` * **`public_html`** + * `.gitignore` * `site.config.lua` * **`static`** * **`templates`** +* To simply build a web site: + * `lua ferron.lua` +* To build a site in development mode: + * `lua ferron.lua --dev` + ## Content All the content of your site should be markdown (`*.md`) file and diff --git a/sites/ferron-ssg.tld/archetypes/.gitignore b/sites/ferron-ssg.tld/archetypes/.gitignore @@ -2,3 +2,4 @@ * # Except those files !.gitignore +!doc.* diff --git a/sites/ferron-ssg.tld/archetypes/doc.json b/sites/ferron-ssg.tld/archetypes/doc.json @@ -0,0 +1,9 @@ +{ + "title": "{{ title }}", + "date": "{{ date }}", + "datetime": "{{ datetime }}", + "template": "{{ template }}", + "bridgy": "false", + "keywords": "", + "description": "" +} diff --git a/sites/ferron-ssg.tld/archetypes/doc.md b/sites/ferron-ssg.tld/archetypes/doc.md @@ -0,0 +1,2 @@ + +# {{ title }} diff --git a/sites/ferron-ssg.tld/content/index.json b/sites/ferron-ssg.tld/content/index.json @@ -1,10 +1,8 @@ { + "date":"0000-00-00", + "datetime":"00:00:00", "id":"tag:ferron-ssg.tld,0000-00-00:0000/00/index", "template":"default", "title":"Welcome to Ferron SSG", - "permalink":"http://ferron-ssg.tld", - "updated":"2017-11-22T08:59:26", - "datetime":"00:00:00", - "date":"0000-00-00", - "content":"\n<h1>Ferron SSG</h1>\n\n<p>Ferron is a static website generator crafted\nwith <a href=\"https://www.lua.org/\">Lua >= 5.3</a>.</p>\n\n<p><em>This documentation is a WIP</em>.</p>\n\n<h2>Installation</h2>\n\n<ol>\n <li>Make sure Lua 5.3 or up is installed on your machine.</li>\n <li>Then `git clone git@github.com:hs0ucy/ferron-ssg.git &amp;&amp; cd\n ferron-ssg`</li>\n <li>After that install all the dependencies above. For me, the best way\n to do that it's via <a href=\"https://luarocks.org/\">LuaRocks</a>.</li>\n</ol>\n\n<h3>Dependencies</h3>\n\n<ul>\n <li><a href=\"https://luarocks.org/modules/dhkolf/dkjson\">dkjson</a></li>\n <li><a href=\"https://luarocks.org/modules/moteus/lua-path\">lua-path</a></li>\n <li><a href=\"https://luarocks.org/modules/hisham/luafilesystem\">LuaFileSysem</a></li>\n <li><a href=\"https://luarocks.org/modules/olivine-labs/lustache\">lustache</a></li>\n <li><a href=\"https://luarocks.org/modules/mpeterv/markdown\">Markdown</a></li>\n</ul>\n\n<h2>Get Started</h2>\n\n<p>First you need to copy the default site and give it the name of the\nwebsite you want to create:</p>\n\n<p>```\ncd sites/ &amp;&amp; cp -R ferron-ssg.tld mynewwebsite.net &amp;&amp; ls\n```</p>\n\n<p>After that with your favorite texteditor or IDE edit the\n<code>site.config.lua</code> to meet the needs of your web site:</p>\n\n<p>```\nemacs site.config.lua\n```</p>\n\n\n<ul>\n <li>To simply build a web site:</li>\n <li><code>lua ferron.lua</code></li>\n <li>To build a site in development mode:</li>\n <li><code>lua ferron.lua --dev</code></li>\n</ul>\n\n<h2>Architecture of <code>ferron-ssg</code> directory</h2>\n\n<ul>\n <li><code>config.lua</code></li>\n <li><code>rhino</code></li>\n <li><code>ferron.lua</code></li>\n <li><strong><code>functions</code></strong></li>\n <li><code>create-archetype-content.lua</code></li>\n <li><code>exec.lua</code></li>\n <li><code>file-utils.lua</code></li>\n <li><code>get-archetypes.lua</code></li>\n <li><code>get-sites.lua</code></li>\n <li><code>make-atom-feed.lua</code></li>\n <li><code>make-lists-of-pages.lua</code></li>\n <li><code>make-pages.lua</code></li>\n <li><code>move-to-publichtml.lua</code></li>\n <li><code>set-site.lua</code></li>\n <li><code>string-utils.lua</code></li>\n <li><code>table-utils.lua</code></li>\n <li><code>template-utils.lua</code></li>\n <li><strong><code>sites</code></strong>\n <ul>\n <li><strong><code>ferron-ssg.tld</code></strong></li>\n <li><strong><code>archetypes</code></strong></li>\n <li><strong><code>content</code></strong></li>\n <li><strong><code>public_html</code></strong></li>\n <li><code>site.config.lua</code></li>\n <li><strong><code>static</code></strong></li>\n <li><strong><code>templates</code></strong></li>\n </ul></li>\n</ul>\n\n<h2>Content</h2>\n\n<p>All the content of your site should be markdown (<code>*.md</code>) file and\nbelongs in the <code>content/</code> repository. That folder must contains at\nleast an <code>index.md</code> file and an <code>index.json</code>.</p>\n\n<h2>Archetypes</h2>\n\n<p>Archetypes are presets files for writing content faster. When you\ncreate a content through an archetype, the basic metadatas of your\nmarkdown file are prefilled and it is put in the right place of the content\ntree.</p>\n\n<h3>Create a content from an archetype</h3>\n\n<ol>\n <li><p>The first argument is the name (whithout the <code>*.md</code> extension) of an existing archetype.</p></li>\n <li><p>The second (and the last) argument is the title you want to give to your content.</p></li>\n <li><p><code>lua ferron.lua nameofthearchetype \"The title you want for your content\"</code></p></li>\n</ol>\n\n<p>So if i'm using the <code>sample.md</code> archetype to create a new content it\nwill look like this :</p>\n\n<ul>\n <li><code>lua ferron.lua sample \"This is my first content made from an archetype\"</code></li>\n</ul>\n\n<p>If it is a success Ferron will output something like this :</p>\n\n<ul>\n <li><code>- The file '/home/hs0ucy/Documents/fakestache-ssg/content/sample/2017/03/this-is-my-first-content-made-from-an-archetype.md' hab been created.</code></li>\n</ul>\n\n<p>Now you can open the file you have created and start to write right\naway whithout the need of filling the metadatas.</p>\n\n<h2>Templates</h2>\n\n<p>Ferron uses\nthe <a href=\"http://mustache.github.io/\">mustache template engine</a>\n(<a href=\"https://github.com/Olivine-Labs/lustache\">for lua</a>) to give more\nflexibility to build your theme.</p>\n\n" + "updated":"2017-11-22T08:59:26" } \ No newline at end of file