aboutsummaryrefslogtreecommitdiff
path: root/example-site/tpl/base.md
diff options
context:
space:
mode:
authorMitchell Riedstra <mitch@riedstra.dev>2022-09-17 11:41:20 -0400
committerMitchell Riedstra <mitch@riedstra.dev>2022-09-17 11:41:20 -0400
commitccc26c3a0bb65ae2613e222c3ead7f6db377b483 (patch)
tree6124ae75f557fffe863134b967ee7c6bfcc87d3d /example-site/tpl/base.md
parentbf7d9c79cae53f64fcd04527248987bd4e7ca3c4 (diff)
downloadgo-website-ccc26c3a0bb65ae2613e222c3ead7f6db377b483.tar.gz
go-website-ccc26c3a0bb65ae2613e222c3ead7f6db377b483.tar.xz
More work on the editor and update the example site to utilize it.v0.0.18
Diffstat (limited to 'example-site/tpl/base.md')
-rw-r--r--example-site/tpl/base.md77
1 files changed, 77 insertions, 0 deletions
diff --git a/example-site/tpl/base.md b/example-site/tpl/base.md
new file mode 100644
index 0000000..97842c1
--- /dev/null
+++ b/example-site/tpl/base.md
@@ -0,0 +1,77 @@
+<!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">
+
+ {{if .AuthorName }}
+ <meta name="author" content="{{.AuthorName}}">
+ {{else if .Global.App.Author.Name }}
+ <meta name="author" content="{{.Global.App.Author.Name}}">
+ {{else}}
+ {{end}}
+
+{{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}}
+
+{{block "nav" .}}
+<nav>
+ | <a href="/">Home</a> |
+ <div style="display: block; float: right;">
+ | <a href="#">Git</a>
+ {{if .Vars.LoggedIn}}
+<span id="edit">| <a href="#" onClick="editThisPage()">Edit</a></span>
+ | <a href="/dashboard">Dashboard</a>
+ | <a href="/logout">Logout</a> |
+ {{else}}
+ | <a href="/login">Login</a>
+ {{end}}
+ </div>
+</nav>
+{{end}}
+
+{{.RenderBody}}
+
+
+{{if .Vars.LoggedIn}}
+<script>
+function editThisPage()
+{
+ if(window.location.pathname == "/") {
+ window.location = "/edit/index";
+ return;
+ }
+ if(window.location.pathname == "/dashboard") {
+ window.location = "/edit/tpl/dashboard";
+ return;
+ }
+ window.location = "/edit/" + window.location.pathname;
+}
+</script>
+{{end}}
+</body>
+