Browse Source

add example site

master
subnixr 4 years ago
parent
commit
e78f3e80c4
  1. 1
      .gitignore
  2. 13
      example/markdown/page1.md
  3. 11
      example/markdown/page2.md
  4. 8
      example/markdown/test.md
  5. 8
      example/markdown/test_other_template.md
  6. 16
      example/templates/default.html
  7. 14
      example/templates/index.html
  8. 11
      example/templates/other_template.html
  9. 17
      example/templates/rss.xml

1
.gitignore

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

13
example/markdown/page1.md

@ -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

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

8
example/markdown/test.md

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

8
example/markdown/test_other_template.md

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

16
example/templates/default.html

@ -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>

14
example/templates/index.html

@ -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>

11
example/templates/other_template.html

@ -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

@ -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>
Loading…
Cancel
Save