# HG changeset patch # User Tuomo Valkonen # Date 1516122820 0 # Node ID 118ab361da29ab7494228f8d1e34fa0e2a2318e0 # Parent 751216807683da0481e074aa48831baca5077086 Added an example website based on http://tuomov.iki.fi/ diff -r 751216807683 -r 118ab361da29 example/build.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/build.sh Tue Jan 16 17:13:40 2018 +0000 @@ -0,0 +1,3 @@ +#!/bin/sh +mkdir -p out +lua ../lgen.lua src tmpl out diff -r 751216807683 -r 118ab361da29 example/src/index.html.lg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/src/index.html.lg Tue Jan 16 17:13:40 2018 +0000 @@ -0,0 +1,10 @@ +--- +title: This is an lgen test page +--- + +## A header + +Need to add more content. + +Here is a [sub-page](subpage/). + diff -r 751216807683 -r 118ab361da29 example/src/style/default.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/src/style/default.css Tue Jan 16 17:13:40 2018 +0000 @@ -0,0 +1,354 @@ + +body { + font-family: Optima, Linux Biolinum, Candara, sans-serif; + #font-weight: 300; + background: #ffffff; + color: #000000; + margin: 10px 40px 40px 40px; + max-width: 80ex; + text-align: left; + } + + +a { color: #3399ee; text-decoration: none; } +a:link { color: #3399ee; } +a:visited { color: #2288dd; } +a:active { color: #2288dd; } +a:hover { color: #2288dd; } + +h1 a, h2 a, h3 a, h4 a, h5 a, h6 a, .header a + { text-decoration: none; } + + +h1 { + margin: 1em 0em; + /*color: #45a9b0;*/ + border-bottom: 1px solid #000000; + font-weight: bolder; + color: #000000; + font-size: xx-large; + /*font-variant: small-caps;*/ + text-align: left; + } + +h2, .inlinepage h1 { + /*color: #84c7c0;*/ + color: #3399ee; + margin-bottom: 1em; + margin-top: 1.5em; + padding: 0; + /*text-transform: uppercase;*/ + font-size: large; + font-variant: normal; + font-weight: bolder; + } + +h3, h4, h5, h6 { + margin-top: 1em; + margin-bottom: 0.05em; + font-size: medium; + color: #ffffff; + } + +blockquote { + /*font-style: italic;*/ + padding: 0 1ex; + border-left: 1px solid #3399ee; + } + +blockquote p { + margin: 0.9ex 0; + } + +blockquote em { + font-style: normal; + } + +pre { + /*background-color: #a0a0a0;*/ + padding: 0 1ex; + border-left: 2px dashed #3399ee; + } + +/*p.note { + font-size: small; + }*/ + +hr { + border: none 0; + border-top: 2px dashed #84c7c0; + height: 1px; + width: 10ex; + margin: 1ex auto 1ex 0; +} + +table { + /*border: none 0;*/ + border-collapse: collapse; + padding: 0.5ex; +} + +thead { + border-bottom: 2px dashed #84c7c0; +} + +tr, td { + border: 0px solid #aaaac0; + padding: 0ex 1ex; +} + +table[border="1"] tr, table[border="1"] tr td { + border: 1px solid #aaaac0; +} + +/*.note { + font-size: small; +}*/ + + +key { + font-family: monospace; +} + +code { + font-family: monospace; + font-size: medium; +} + +li { + margin-top: 1em; +} + +.illustr-left { + float: left; + padding-right: 1ex; + padding-bottom: 1ex; + padding-top: 1ex; +} + +.illustr-right { + float: right; + padding-left: 1ex; + padding-bottom: 1ex; + padding-top: 1ex; +} + +b{ + font-weight: bolder; +} + +.bibtex2html td { + padding-bottom: 5px ; +} + +.bibtex2html .bibtexitem .me { + font-style: normal; +} + +.bibtex2html .bibtexitem .author { + font-style: normal; + font-variant: small-caps; +} + +img.copy-cc { + height: 1em; + margin: 1pt; + padding-right: 1pt; + margin-top: 4pt; + padding-top: 2pt; +} + +/* main */ + +body { + margin: 0; + padding: 0; + max-width: none; + background-image: url('banner2x.jpg'); + background-repeat: no-repeat; + background-size: 100%; + } + +body> .header { + margin: 0px; + margin-left: 60px; + padding: 120px 0px 20px 0px; + font-size: large; + font-weight: bolder; + line-height: 1em; + display: block; + /*height: 130px;*/ + } + +body> .header a, +body> .header a:link, +body> .header a:visited, +body> .header a:active, +body> .header a:hover { + /*color: #3377ee;*/ + color: #000000; + text-decoration: none; + } + + +#content { + margin: 0; /*1em 40px 10px 40px;*/ + padding: 0; + margin-left: 36ex; + max-width: 80ex; + text-align: left; + display: block; +} + +#sidebar { + line-height: 3ex; + float: left; + margin: 0; + padding: 4ex 0px; + margin-left: 11ex; + padding-top: 2ex; + line-height: 150%; +} + +.sidetitle { + color: #000000; + margin-top: 3ex; + font-weight: bolder; + /*margin-left: -1.5ex;*/ + } + +.extra { + color: #ffffff !important; + display: inline; +} + +.extra a { + color: #ffffff !important; +} + +#sidebar a { + text-decoration: none; + font-weight: bolder; + color: #3388ee; +} + +#sidebar ul { + list-style-type: none; +} + +#sidebar LI { + display: block; +} + +.side { + padding-left: 1.5ex; + text-align: left; + font-size: medium; /* feed to compliant browsers */ + } + + +@media only screen and (max-device-width: 480px) { + + body> .header { + padding: 0px; + } + + .sidetitle { + font-size: x-large; + } + + .side { + padding-left: 1.5ex; + padding-top: 2ex; + text-align: left; + font-size: x-large; /* feed to compliant browsers */ + line-height: 300%; + } + + #sidebar { + margin: 1ex 2ex; + padding: 0ex 2ex; + float: none; + } + + #content { + margin: 1ex 2ex; + padding: 0ex 2ex; + max-width: none; + display: block; + } +} + + +.inlinepage { + padding: 0px 0px; + border: none; + /*border-top: 1px solid #aaaac0;*/ + padding-top: 2ex; + margin-top: 2ex; + margin-bottom: 4ex; +} + +.inlinepage .header { + color: red; + font-size: large; + font-weight: bolder; + text-transform: uppercase; + } + +.posted-header { + color: #000; + margin-bottom: 10x; + text-align: left; + line-height: 1.7em; + font-weight: bolder; + /*font-size: small;*/ /* for compliant browsers */ + border-bottom: 1px solid #000000; + } + +.posted { +} + +body> #footer .tags { + margin: 1em 0ex; +} + +body> #footer #backlinks { + margin: 1em 0ex; +} + +body> #footer .pageinfo { + margin: 1em 0ex; +} + +body> #footer { + padding: 4ex 0ex; + margin: 1em 0ex; + clear: both; +} + +.pageinfo { + clear: both; + font-style: italic; + display: block; +} + +/* Orange feed button. */ +.feedbutton { + background: #ff6600; + color: white !important; + border-left: 1px solid #cc9966; + border-top: 1px solid #ccaa99; + border-right: 1px solid #993300; + border-bottom: 1px solid #331100; + padding: 0px 0.5em 0px 0.5em; + font-weight: bolder; + /*font-size: small;*/ + text-decoration: none; + margin-top: 1em; +} +.feedbutton:hover { + color: white !important; + background: #ff9900; +} + diff -r 751216807683 -r 118ab361da29 example/src/subpage/index.html.lg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/src/subpage/index.html.lg Tue Jan 16 17:13:40 2018 +0000 @@ -0,0 +1,5 @@ +--- +title: This is a sub-page of an lgen test page +--- + +There is no content diff -r 751216807683 -r 118ab361da29 example/tmpl/atom.template --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/tmpl/atom.template Tue Jan 16 17:13:40 2018 +0000 @@ -0,0 +1,27 @@ + +<% +require('plugin.inline') +require('time') +%> + + <%= page.meta.title %> + <%= page.meta.description %> + + <%= page.meta.author %> + <%= page.meta.author_url %> + + + <% local feedurl = page.meta.site_url..page.destination %> + + + <%= time.now_iso() %> + <%= page.meta.site_url %> + + <%= plugin.inline.inline(env, { + pattern=page.meta.dependencies, + count=page.meta.count, + template='inline_atom.template', + absolute=page.meta.site_url, + }) + %> + diff -r 751216807683 -r 118ab361da29 example/tmpl/inline.template --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/tmpl/inline.template Tue Jan 16 17:13:40 2018 +0000 @@ -0,0 +1,9 @@ +<% for _, inlinepage in ipairs(inlinepages) do %> +
+
+ <%= inlinepage.meta.created_at %> +
+

<%= inlinepage.meta.title %>

+ <%= inlinepage.content %> +
+<% end %> diff -r 751216807683 -r 118ab361da29 example/tmpl/inline_atom.template --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/tmpl/inline_atom.template Tue Jan 16 17:13:40 2018 +0000 @@ -0,0 +1,23 @@ +<% for _, inlinepage in ipairs(inlinepages) do %> + + <%= inlinepage.meta.title %> + <% if inlinepage.meta.author then %> + + <%= inlinepage.meta.author %> + <%= inlinepage.meta.author_url %> + + <% end %> + + <%= inlinepage.location %> + <% if inlinepage.meta.modified_at then %> + <%= inlinepage.meta.modified_at %> + <% end %> + <% if inlinepage.meta.created_at then %> + <%= inlinepage.meta.created_at %> + <% end %> + +
<%= inlinepage.content %>
+
+
+<% end %> + diff -r 751216807683 -r 118ab361da29 example/tmpl/inline_list.template --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/tmpl/inline_list.template Tue Jan 16 17:13:40 2018 +0000 @@ -0,0 +1,8 @@ +<% for _, inlinepage in ipairs(inlinepages) do %> +

+ + <%= inlinepage.meta.created_at %> + + <%= inlinepage.meta.title %> +

+<% end %> diff -r 751216807683 -r 118ab361da29 example/tmpl/page.template --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/tmpl/page.template Tue Jan 16 17:13:40 2018 +0000 @@ -0,0 +1,56 @@ + + + + + + + + + + + lgen test page – <%= page.meta.title %> + + + <% + --require('plugin.breadcrumb') + local main_url = (base_url=="" and "./" or base_url) + %> + +
+ + +
+ + + + +
+ <% if page.meta.blogpost then %> +
+ <%= page.meta.created_at %> + +
+ <% end %> + + <% if page.meta.h1_title then %> +

<%= page.meta.h1_title %>

+ <% else %> +

<%= page.meta.title %>

+ <% end %> + <%= content %> +
+ + + + diff -r 751216807683 -r 118ab361da29 example/tmpl/plain_inline.template --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/tmpl/plain_inline.template Tue Jan 16 17:13:40 2018 +0000 @@ -0,0 +1,6 @@ + +<% for _, inlinepage in ipairs(inlinepages) do %> + + <%= inlinepage.content %> + +<% end %>