65 lines
1.8 KiB
Plaintext
65 lines
1.8 KiB
Plaintext
package web
|
|
|
|
// import "strings"
|
|
|
|
templ base(title, description, keywords, canonical, heading string, head templ.Component) {
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
if title != "" {
|
|
<title>{ title } - Arav's dwelling</title>
|
|
} else {
|
|
<title>Arav's dwelling</title>
|
|
}
|
|
<meta charset="utf-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
|
<meta name="theme-color" content="#cd2682"/>
|
|
<meta name="description" content={ description }/>
|
|
<meta name="keywords" content={ keywords }/>
|
|
<link rel="icon" href="/assets/img/favicon.svg" sizes="any" type="image/svg+xml"/>
|
|
<link rel="stylesheet" href="/assets/css/main.css"/>
|
|
<link rel="alternate" href="/rss.xml" type="application/rss+xml" title="Arav's dwelling"/>
|
|
if canonical != "" {
|
|
<link rel="canonical" href={ string(templ.URL(canonical)) }/>
|
|
}
|
|
if head != nil {
|
|
@head
|
|
}
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<svg id="logo" viewBox="0 -25 216 40">
|
|
<text class="logo">Arav's dwelling</text>
|
|
<text class="under" y="11">Welcome to my sacred place, wanderer</text>
|
|
</svg>
|
|
@navigation(heading)
|
|
</header>
|
|
{ children... }
|
|
<footer>
|
|
<a href="/rss.xml" title="Stay up to date on what's going on.">RSS feed</a>
|
|
<br/>
|
|
© 2017—2024 Alexander "Arav" Andreev <<a href="mailto:me@arav.su">me@arav.su</a>> <a href="/privacy">Privacy statements</a>
|
|
</footer>
|
|
</body>
|
|
</html>
|
|
}
|
|
|
|
var navElements = []string{"Stuff", "Mindflow", "About", "Guestbook"}
|
|
|
|
templ navigation(heading string) {
|
|
<nav>
|
|
if heading != "Home" {
|
|
<a href="/">Home</a>
|
|
}
|
|
<a href="/stuff">Stuff</a>
|
|
<a href="/mindflow">Mindflow</a>
|
|
<a href="/about">About</a>
|
|
<a href="/guestbook">Guestbook</a>
|
|
|
|
if heading != "" && heading != "Home" {
|
|
<h1>{ heading }</h1>
|
|
}
|
|
</nav>
|
|
}
|