add example site

This commit is contained in:
subnixr 2018-07-21 02:39:08 +02:00
parent c59961093b
commit e78f3e80c4
9 changed files with 61 additions and 38 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
*.egg-info
*.pyc
test_site/
example/target/

13
example/markdown/page1.md Normal file
View File

@ -0,0 +1,13 @@
Template: default
Title: Page one
Description: Test page one
When: today
# Header
Some text
- one
- two

11
example/markdown/page2.md Normal file
View File

@ -0,0 +1,11 @@
Template: default
Title: Page two
When: tomorrow
# Header
- three
- four
Bottom text

View File

@ -1,8 +0,0 @@
Title: Home Page
Author: anon
# Site
Some text

View File

@ -1,8 +0,0 @@
Title: Other Test Page
Template: other_template
# Title
Some other text

View File

@ -1,10 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>{{ title }}</title>
</head>
<body>
<head>
<title>{{ title }}</title>
</head>
<body>
<div class="content">
{{ content }}
</body>
</html>
</div>
</body>
</html>

View File

@ -6,11 +6,15 @@
</head>
<body>
<ul>
{% for page in pages %}
<li>{{page['title']}}</li>
{% endfor %}
</ul>
{% for pname, page in pages.items() %}
<div>
<p>
<a href="{{page.link}}">{{page.title}}</a>
</p>
<p>{{page.description}}</p>
<p>{{page.when}}</p>
</div>
{% endfor %}
</body>
</html>

View File

@ -1,11 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>{{ title }}</title>
</head>
<body>
<h1>Other Template</h1>
{{ content }}
</body>
</html>

17
example/templates/rss.xml Normal file
View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title>Unit</title>
<link>https://unit.macaomilano.org</link>
<description>unit</description>
{% for pname, page in pages.items() %}
<item>
<title>{{ page.title }}</title>
<link>{{ page.link }}</link>
<description>{{ page.description }}</description>
</item>
{% endfor %}
</channel>
</rss>