diff options
| author | Mitchell Riedstra <mitch@riedstra.dev> | 2022-09-17 11:41:20 -0400 |
|---|---|---|
| committer | Mitchell Riedstra <mitch@riedstra.dev> | 2022-09-17 11:41:20 -0400 |
| commit | ccc26c3a0bb65ae2613e222c3ead7f6db377b483 (patch) | |
| tree | 6124ae75f557fffe863134b967ee7c6bfcc87d3d /example-site/tpl/base.md | |
| parent | bf7d9c79cae53f64fcd04527248987bd4e7ca3c4 (diff) | |
| download | go-website-0.0.18.tar.gz go-website-0.0.18.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.md | 77 |
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> + |
