diff options
Diffstat (limited to 'example-site')
| -rw-r--r-- | example-site/404.md | 10 | ||||
| -rw-r--r-- | example-site/blog/first-post.md | 19 | ||||
| -rw-r--r-- | example-site/blog/second-post.md | 14 | ||||
| -rw-r--r-- | example-site/conf.yml | 20 | ||||
| -rw-r--r-- | example-site/inc/base.html | 53 | ||||
| -rw-r--r-- | example-site/index.md | 47 | ||||
| -rw-r--r-- | example-site/multi-tag-page.md | 19 | ||||
| -rw-r--r-- | example-site/reIndex.md | 22 | ||||
| -rw-r--r-- | example-site/static/style.css | 91 | ||||
| -rw-r--r-- | example-site/untagged-page.md | 13 |
10 files changed, 308 insertions, 0 deletions
diff --git a/example-site/404.md b/example-site/404.md new file mode 100644 index 0000000..162233c --- /dev/null +++ b/example-site/404.md @@ -0,0 +1,10 @@ +--- +title: 404 Not found | Example Website +description: 404 Not found +|--- + +# 404 Not fonud! + +Whatever it is you were looking for, we have no idea what it was. + +Perhaps you'd like to go back [home](/)? diff --git a/example-site/blog/first-post.md b/example-site/blog/first-post.md new file mode 100644 index 0000000..42ef931 --- /dev/null +++ b/example-site/blog/first-post.md @@ -0,0 +1,19 @@ +--- +title: 'Blog Post #1' +# head: "This is optional" +description: My example description + +date: 07.02.2021 15:00:00 EDT + +tags: + Blog: + +|--- + +`{{.Date.Time.Format "Monday January 2 2006"}}` + +# {{.Title}} + +This is an example first blog post. + +Not much here. diff --git a/example-site/blog/second-post.md b/example-site/blog/second-post.md new file mode 100644 index 0000000..f8abef2 --- /dev/null +++ b/example-site/blog/second-post.md @@ -0,0 +1,14 @@ +--- +title: 'Blog Post #2' +description: My example description for blog post #2 +date: 07.14.2021 15:00:00 EDT +tags: + Blog: +|--- + +`{{.Date.Time.Format "Monday January 2 2006"}}` + +# {{.Title}} + +This is an example second blog post. + diff --git a/example-site/conf.yml b/example-site/conf.yml new file mode 100644 index 0000000..b6f0202 --- /dev/null +++ b/example-site/conf.yml @@ -0,0 +1,20 @@ +# All these can be unset +reindexpath: /reIndex +staticdirectory: static +basetemplate: inc/base.html +documentsplit: "|---\n" +suffix: ".md" + +# Used by the feeds handler +title: "My Example Website!" +description: > + An example website powered by markdown, yaml and some clever templating +author: + name: "Example Author" + # uri: "https://example.com" # Not required + # email: "author@example.com" # Not required +# Change this to your actual website URI, e.g. https://example.com +siteurl: "http://localhost:8080" +feedid: "changeme" +updated: 07.13.2021 19:51:00 EDT +feedprefix: .feeds diff --git a/example-site/inc/base.html b/example-site/inc/base.html new file mode 100644 index 0000000..959c7d6 --- /dev/null +++ b/example-site/inc/base.html @@ -0,0 +1,53 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + + <link id="maincss" rel="stylesheet" href="/static/style.css" defer> + + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta name="author" content="{{.Global.App.Author.Name}}"> + <meta name="description" content="{{.Global.App.Description}}"> + + <!-- + <link rel="apple-touch-icon" sizes="180x180" href="/static/apple-touch-icon.png"> + <link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png"> + <link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png"> + <link rel="manifest" href="/static/site.webmanifest"> + --> + +{{if .Title}} + <title>{{.Title}}</title> +{{else}} + <title>Please change me!</title> +{{end}} + +{{if .Description}} + <meta name="description" content="{{.Description}}"> +{{else}} + <meta name="description" content="Draft and or Preview page. Default Description."> +{{end}} + +</head> + +<body> + +{{if .Description}}{{else}} + <h1> + <span style="color: red;"> + This is a draft, preview or otherwise unfinished page. + </span> + </h1> +{{end}} + +<nav> + <a href="/">Home</a> + + <div style="display: block; float: right;"> + <a href="#">Git</a> + </div> +</nav> + +{{.RenderBody}} + +</body> diff --git a/example-site/index.md b/example-site/index.md new file mode 100644 index 0000000..6d292b5 --- /dev/null +++ b/example-site/index.md @@ -0,0 +1,47 @@ +--- +title: Example website home page +description: My example description + +|--- + +# {{.Title}} + +Example paragraph. This website utilizes Go's templates, a Blackfriday markdown +renderer and some yaml at the top of each file to provide some information about +it. + +`code style text` + +[reIndex page]({{.Global.App.ReIndexPath}}) + +## Recent Blog Entries: + +[Atom Feed](/{{.Global.App.FeedPrefix}}/Blog?limit=5&content) + +{{range $val := .Index.Blog.SortDate}} + * [{{$val.Date.Time.Format "2006-01-02"}} {{$val.Title}}]({{$val.Path}}){{end}} + +## Some internals + + +#### Global vars: + +``` +{{.Global}} + +"App" under Global vars: +{{.Global.App}} +``` + +#### Page Index + +{{range $key, $val := .Index}} +``` +### {{$key}}: + +{{range $v2 := $val}} +{{$v2.StringDetail}}{{end}} +``` + + +{{end}} diff --git a/example-site/multi-tag-page.md b/example-site/multi-tag-page.md new file mode 100644 index 0000000..a1a61d2 --- /dev/null +++ b/example-site/multi-tag-page.md @@ -0,0 +1,19 @@ +--- +title: Multi tag page +description: A page with several tags added to it +date: 07.02.2021 15:00:00 EDT +authorname: Someone Else +# authoremail: someoneelse@example.com +tags: + Blog: + Automotive: + MoarTags: +|--- + +`{{.Date.Time.Format "Monday January 2 2006"}}` + +# {{.Title}} + + +Just a sample page with several tags + diff --git a/example-site/reIndex.md b/example-site/reIndex.md new file mode 100644 index 0000000..4519dc5 --- /dev/null +++ b/example-site/reIndex.md @@ -0,0 +1,22 @@ +--- +title: reIndex page +description: > + This page is rendered after reindexing, with any encountered errors! +|--- + +# {{.Title}} + +this is the reindex page + +{{if .Vars.IndexError}} +<span style="color: red;"> +# Indexing Error: {{.Vars.IndexError}} +</span> +{{end}} + + +``` +This handler adds some information to the page vars: +{{.Vars}} +``` + diff --git a/example-site/static/style.css b/example-site/static/style.css new file mode 100644 index 0000000..158444b --- /dev/null +++ b/example-site/static/style.css @@ -0,0 +1,91 @@ +nav { + border-bottom: 3px solid #000; + padding-bottom: 10px; +} +a { + text-decoration: none; +} +a:hover { + text-decoration: underline; +} + +code { + background-color: #afafaf; + padding: 2px; + font-size: .8em; + font-family: "Roboto Mono", "Monaco", "Lucida Console", "DejaVu Sans Mono", "monospace"; +} + +pre code { + color: #000; + background-color: #fafafa; + display: block; + padding: 10px; + border: 1px solid; + line-height: 1.1; + overflow: auto; +} + + +blockquote { + border-left: 4px solid #aaa; + padding-left: 1em; +} + +/* + * The following was shamelessly ripped from: + * http://bettermotherfuckingwebsite.com/ + * And subsequently modified to suit my needs + */ + +body { + margin: 40px auto; + max-width: 80%; + line-height: 1.6; + font-size: 1em; + color: #444; + padding: 0 10px; + /* Added because some browsers don't default to white */ + background-color: #fff; +} + +img { + width: 100%; + height: auto; +} + +h1,h2,h3 { + line-height: 1.2 +} + +@media screen and (min-width: 960px) { + body { + max-width: 768px; + } +} + +@media print { + a, a:visited { + color: #000; + } + nav { + display: none; + } + body { + background-color: transparent; + line-height: 1; + font-size: 10pt; + /* margin: 5px auto; */ + margin: 5px 5px 5px 5px; + max-width: 100%; + } + + pre code { + color: #000; + background-color: inherit; + display: block; + padding: 10px; + border: none; + } + +} diff --git a/example-site/untagged-page.md b/example-site/untagged-page.md new file mode 100644 index 0000000..aa8400f --- /dev/null +++ b/example-site/untagged-page.md @@ -0,0 +1,13 @@ +--- +title: Untagged page +description: A page with no tags added to it +date: 07.02.2021 15:00:00 EDT +tags: +|--- + +`{{.Date.Time.Format "Monday January 2 2006"}}` + +# {{.Title}} + + +Just a sample page with no tags |
