Skip to content

Commit 3adc18f

Browse files
committed
Another example site.
1 parent b7ce0f4 commit 3adc18f

File tree

8 files changed

+90
-0
lines changed

8 files changed

+90
-0
lines changed

examples/apache/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/logs/
2+
/output/
3+
/temp/

examples/apache/Build.cmd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@ECHO OFF
2+
CD /D "%~dp0"
3+
..\..\webgen.exe build

examples/apache/README.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Information
2+
Apache Example
3+
4+
This example utilizes page redirections and Apache-related functionality.

examples/apache/config.lua

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
return {
2+
title = "Apache Example",
3+
baseUrl = "http://apache.example/",
4+
languageCode = "en",
5+
6+
redirections = {
7+
["/flowers/"] = "/plants/",
8+
["/view.php?page=flowers"] = "/plants/",
9+
},
10+
11+
htaccess = {
12+
www = true, -- Modify "www." to match baseUrl.
13+
redirect = true, -- Add directives for redirecting page aliases and the redirections above.
14+
noIndexes = true, -- Disable automatic index pages that list files.
15+
16+
errors = {
17+
[404] = "/404/index.html",
18+
},
19+
},
20+
}

examples/apache/content/404.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{{
2+
page.title = "Error 404: Not Found"
3+
}}
4+
5+
# {{ page.title }}
6+
7+
Looks like you've taken a wrong turn somewhere!
8+
9+
[Go back to the front page](/)

examples/apache/content/index.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# {{ site.title }}
2+
3+
## Cool Links
4+
5+
{{ fori {
6+
"/plants/", -- Current URL.
7+
"/plantz/", -- Page alias.
8+
"/flowers/", -- Old link.
9+
"/view.php?page=flowers", -- Old link.
10+
"/bad-link/", -- 404 error.
11+
} *}}
12+
- [{{ prettyUrl(it) }}]({{ it }})
13+
{{ end }}

examples/apache/content/plants.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{{
2+
page.title = "Flowers and Other Plants"
3+
page.date = "2018-02-22T13:43:28-04:00"
4+
page.aliases = {"/plantz/"}
5+
}}
6+
7+
# {{ page.title }}
8+
9+
Imagine some nice plants here.
10+
11+
<pre style="color: #092;">
12+
\|/
13+
--O--
14+
/|\
15+
_ /
16+
,,,\|/|,,,,,
17+
</pre>
18+
19+
[Go back to the front page](/)

examples/apache/layouts/page.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!DOCTYPE html>
2+
<html lang="{{ site.languageCode }}">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
{{ generatorMeta() }}
7+
8+
<title>
9+
{{ echo(page.title ~= "" and page.title.." - " or "") *}}
10+
{{ echo(site.title) }}
11+
</title>
12+
13+
<link rel="canonical" href="{{ url(page.permalink) }}">
14+
</head>
15+
16+
<body>
17+
{{ page.content }}
18+
</body>
19+
</html>

0 commit comments

Comments
 (0)