1
0
dwelling-home/web/base.templ

71 lines
2.2 KiB
Plaintext
Raw Permalink Normal View History

package web
import "strings"
templ base(title, description, keywords, canonical string, head templ.Component) {
<!DOCTYPE html>
<html>
<head>
if title != "" && title != "Home" {
<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 class="main">
<svg viewBox="0 -36 360 66">
<text y="7" textLength="360" lengthAdjust="spacingAndGlyphs">Arav's dwelling</text>
<text y="25" textLength="360" lengthAdjust="spacingAndGlyphs">Welcome to my sacred place, wanderer</text>
</svg>
{{ mainNavSections := []string{"Stuff", "Mindflow", "About", "Guestbook"} }}
{{ mainNavLinks := []templ.SafeURL{"/stuff", "/mindflow", "/about", "/guestbook"} }}
<nav>
<ul>
if title != "" {
<li><a href="/">Home</a></li>
}
for i, s := range mainNavSections {
if strings.HasSuffix(title, s) {
{{ continue }}
}
<li><a href={ mainNavLinks[i] }>{ s }</a></li>
}
</ul>
if title != "" {
<h1>
if strings.HasSuffix(title, "- Stuff") {
Stuff
} else {
{ title }
}
</h1>
}
</nav>
</header>
<main>
{ children... }
</main>
<footer>
<a href="/rss.xml" title="Stay up to date on what's going on.">RSS feed</a>
<br/>
&copy; 2017&mdash;2024 Alexander &quot;Arav&quot; Andreev &lt;<a href="mailto:me@arav.su">me@arav.su</a>&gt; <a href="/privacy">Privacy statements</a>
</footer>
</body>
</html>
}