2024-06-13 04:49:55 +04:00
|
|
|
package web
|
|
|
|
|
2024-06-19 03:08:50 +04:00
|
|
|
import "strings"
|
2024-06-13 04:49:55 +04:00
|
|
|
|
2024-06-19 03:08:50 +04:00
|
|
|
templ base(title, description, keywords, canonical string, head templ.Component) {
|
2024-06-19 01:08:05 +04:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
2024-06-19 03:08:50 +04:00
|
|
|
if title != "" && title != "Home" {
|
2024-06-19 01:08:05 +04:00
|
|
|
<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>
|
2024-06-19 03:08:50 +04:00
|
|
|
<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>
|
2024-06-19 01:08:05 +04:00
|
|
|
</svg>
|
2024-06-19 03:08:50 +04:00
|
|
|
@navigation(title)
|
2024-06-19 01:08:05 +04:00
|
|
|
</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>
|
2024-06-13 04:49:55 +04:00
|
|
|
}
|
|
|
|
|
2024-06-21 00:52:06 +04:00
|
|
|
templ navigation(title string) {
|
|
|
|
{{ sections := []string{"Stuff", "Mindflow", "About", "Guestbook"} }}
|
2024-06-19 01:08:05 +04:00
|
|
|
<nav>
|
2024-06-19 03:08:50 +04:00
|
|
|
<div>
|
2024-06-21 00:52:06 +04:00
|
|
|
if title != "Home" {
|
2024-06-19 03:08:50 +04:00
|
|
|
<a href="/">Home</a>
|
|
|
|
}
|
2024-06-21 00:52:06 +04:00
|
|
|
for _, s := range sections {
|
|
|
|
if strings.HasSuffix(title, s) {
|
2024-06-21 00:30:02 +04:00
|
|
|
{{ continue }}
|
|
|
|
}
|
2024-06-21 00:52:06 +04:00
|
|
|
<a href={ templ.URL("/"+strings.ToLower(s)) }>{ s }</a>
|
2024-06-21 00:30:02 +04:00
|
|
|
}
|
2024-06-19 03:08:50 +04:00
|
|
|
</div>
|
2024-06-21 00:52:06 +04:00
|
|
|
if title != "" && title != "Home" {
|
|
|
|
<h1>
|
|
|
|
if strings.HasSuffix(title, "- Stuff") {
|
|
|
|
Stuff
|
|
|
|
} else {
|
|
|
|
{ title }
|
|
|
|
}
|
|
|
|
</h1>
|
2024-06-19 01:08:05 +04:00
|
|
|
}
|
|
|
|
</nav>
|
|
|
|
}
|