Added an example website based on http://tuomov.iki.fi/

Tue, 16 Jan 2018 17:13:40 +0000

author
Tuomo Valkonen <tuomov@iki.fi>
date
Tue, 16 Jan 2018 17:13:40 +0000
changeset 10
118ab361da29
parent 9
751216807683
child 11
d2c95c18f88f

Added an example website based on http://tuomov.iki.fi/

example/build.sh file | annotate | diff | comparison | revisions
example/src/index.html.lg file | annotate | diff | comparison | revisions
example/src/style/default.css file | annotate | diff | comparison | revisions
example/src/subpage/index.html.lg file | annotate | diff | comparison | revisions
example/tmpl/atom.template file | annotate | diff | comparison | revisions
example/tmpl/inline.template file | annotate | diff | comparison | revisions
example/tmpl/inline_atom.template file | annotate | diff | comparison | revisions
example/tmpl/inline_list.template file | annotate | diff | comparison | revisions
example/tmpl/page.template file | annotate | diff | comparison | revisions
example/tmpl/plain_inline.template file | annotate | diff | comparison | revisions
--- /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
--- /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/).
+
--- /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;
+}
+
--- /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
--- /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 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<%
+require('plugin.inline') 
+require('time')
+%>
+<feed xmlns="http://www.w3.org/2005/Atom">
+  <title type="html"><%= page.meta.title %></title>
+  <subtitle type="html"><%= page.meta.description %></subtitle>
+  <author>
+    <name><%= page.meta.author %></name>
+    <uri><%= page.meta.author_url %></uri>
+  </author>
+
+  <% local feedurl = page.meta.site_url..page.destination %>
+  <link href="<%= page.meta.site_url %>" rel="alternate" type="text/xhtml" />
+  <link href="<%= feedurl %>" rel="self" type="application/atom+xml" />
+  <updated><%= time.now_iso() %></updated>
+  <id><%= page.meta.site_url %></id>
+
+  <%= plugin.inline.inline(env, {
+        pattern=page.meta.dependencies,
+        count=page.meta.count, 
+        template='inline_atom.template',
+        absolute=page.meta.site_url,
+     })
+  %>
+</feed>
--- /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 %>
+<div class="inlinepage">
+  <div class="posted-header">
+  <%= inlinepage.meta.created_at %>
+  </div>
+  <h2><a href="<%= inlinepage.location %>"><%= inlinepage.meta.title %></a></h2>
+  <%= inlinepage.content %>
+</div>
+<% end %>
--- /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 %>
+  <entry>
+    <title type="html"><%= inlinepage.meta.title %></title>
+    <% if inlinepage.meta.author then %>
+    <author>
+      <name><%= inlinepage.meta.author %></name>
+      <uri><%= inlinepage.meta.author_url %></uri>
+    </author>
+    <% end %>
+    <link href="<%= inlinepage.location %>" rel="alternate" />
+    <id><%= inlinepage.location %></id>
+    <% if inlinepage.meta.modified_at then %>
+    <updated><%= inlinepage.meta.modified_at %></updated>
+    <% end %>
+    <% if inlinepage.meta.created_at then %>
+    <published><%= inlinepage.meta.created_at %></published>
+    <% end %>
+    <content type="xhtml">
+    <div xmlns="http://www.w3.org/1999/xhtml"><%= inlinepage.content %></div>
+    </content>
+  </entry>
+<% end %>
+
--- /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 %>
+<p class="archivedpage">
+  <span class="posted">
+  <%= inlinepage.meta.created_at %>
+  </span>
+  <a href="<%= inlinepage.location %>"><%= inlinepage.meta.title %></a>
+</p>
+<% end %>
--- /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 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+  <head>
+    <meta http-equiv="content-type" content="text/xhtml; charset=utf-8" />
+    <meta name="author" content="lgen" />
+    <meta name="viewport" content="initial-scale=1" />
+    <link rel="stylesheet" type="text/css" href="<%= base_url %>style/default.css" />
+    <link rel="apple-touch-icon-precomposed" href="<%= base_url %>style/icon144.png" type="144x144"/>
+    <link rel="shortcut icon" href="<%= base_url %>style/icon16.png" type="image/png" />
+    <!--
+    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<%= base_url %>feed.rss}" />
+    <link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="<%= base_url %>feed.atom" /> 
+    -->
+    <title>lgen test page – <%= page.meta.title %></title>
+  </head>
+
+  <%
+    --require('plugin.breadcrumb')
+    local main_url = (base_url=="" and "./" or base_url)
+  %>
+  <body>
+    <div class="header">
+    <!-- <span> <a href="<%= main_url %>">main</a> </span> -->
+    <!-- <span> < %= plugin.breadcrumb.trail(env) % > </span> -->
+    </div>
+
+    <div id="sidebar">
+        <div class="sidetitle">
+            lgen
+        </div>
+        <div class="side">
+            <a href="<%= base_url %>subpage/">sub-page</a><br/>
+        </div>
+    </div>
+
+
+    <div id="content">
+       <% if page.meta.blogpost then %>
+         <div class="posted-header">
+         <%= page.meta.created_at %>
+         <!-- strftime("%Y-%m-%d %H:%M UTC") -->
+         </div>
+       <% end %>
+
+       <% if page.meta.h1_title then %>
+          <h1><%= page.meta.h1_title %></h1>
+       <% else %>
+          <h1><%= page.meta.title %></h1>
+       <% end %>
+       <%= content %>
+    </div>
+
+    <div id="footer">
+    </div>
+  </body>
+</html>
--- /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 %>

mercurial