1
0

Removed a heading argument, now a title is used for h1.

This commit is contained in:
Alexander Andreev 2024-06-19 03:08:50 +04:00
parent c16cb79307
commit 83a6111660
Signed by: Arav
GPG Key ID: 25969B23DCB5CA34
11 changed files with 32 additions and 29 deletions

View File

@ -3,7 +3,7 @@ package web
import "git.arav.su/Arav/dwelling-home/pkg/servicestat"
templ About(filesSrvc string, services servicestat.ServiceList) {
@base("About", "About me and my home servers.", "about, me, servcies", "/about", "About", aboutHead())
@base("About", "About me and my home servers.", "about, me, servcies", "/about", aboutHead())
}
templ aboutHead() {

View File

@ -6,7 +6,7 @@ import "net/http"
import "git.arav.su/Arav/dwelling-home/pkg/util"
templ Article(title, description, body, urlName string, date time.Time, r *http.Request) {
@base(title + " - Articles", description, "", "/stuff/article/"+urlName, "Articles", articleHead()) {
@base(title + " - Article", description, "", "/stuff/article/"+urlName, articleHead()) {
<article>
<header>
<h2>{ title }</h2>

View File

@ -1,12 +1,12 @@
package web
// import "strings"
import "strings"
templ base(title, description, keywords, canonical, heading string, head templ.Component) {
templ base(title, description, keywords, canonical string, head templ.Component) {
<!DOCTYPE html>
<html>
<head>
if title != "" {
if title != "" && title != "Home" {
<title>{ title } - Arav's dwelling</title>
} else {
<title>Arav's dwelling</title>
@ -28,12 +28,12 @@ templ base(title, description, keywords, canonical, heading string, head templ.C
}
</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>
<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>
@navigation(heading)
@navigation(title)
</header>
{ children... }
<footer>
@ -49,16 +49,21 @@ 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>
<div>
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>
</div>
if heading != "" && heading != "Home" {
<h1>{ heading }</h1>
if strings.HasSuffix(heading, "Article") {
<h1>Article</h1>
} else {
<h1>{ heading }</h1>
}
}
</nav>
}

View File

@ -5,7 +5,7 @@ import "net/http"
templ ErrorXXX(errCode int, reason, message, referer string) {
{{ errText := http.StatusText(errCode) }}
@base(errText, errText, "", "", errText, errorXXXHead()) {
@base(errText, errText, "", "", errorXXXHead()) {
<section id="error">
<h1>{ fmt.Sprint(errCode) }</h1>
{ errText }

View File

@ -10,7 +10,7 @@ import "git.arav.su/Arav/justguestbook"
import "git.arav.su/Arav/dwelling-home/pkg/util"
templ Guestbook(captchaID, owner string, entries []*justguestbook.Entry, pageCount int64, r *http.Request) {
@base("Guestbook", "This is my guestbook. Welcome.", "guestbook, personal", "/guestbook", "Guestbook", guestbookHead()) {
@base("Guestbook", "This is my guestbook. Welcome.", "guestbook, personal", "/guestbook", guestbookHead()) {
<form id="new-post" action="/api/guestbook" method="POST">
<input type="text" name="name" maxlength="80" placeholder="Name (Anonymous if left blank)"/>
<input type="text" name="website" maxlength="255" placeholder="Website (optional)"/>

View File

@ -5,5 +5,5 @@ import "net/http"
import "git.arav.su/Arav/justguestbook"
templ GuestbookAdmin(owner string, entries []*justguestbook.Entry, r *http.Request) {
@base("Guestbook Administration", "", "", "/guestbook/admin", "Guestbook Administration", nil)
@base("Guestbook Administration", "", "", "/guestbook/admin", nil)
}

View File

@ -1,9 +1,7 @@
package web
templ Index() {
@base("",
"A homepage of a russian guy Alexander aka Arav. Not just homepage, but something more...", "/",
"homepage, personal, blog, services, self-hosting", "Home", indexHead()) {
@base("Home", "A homepage of a russian guy Alexander aka Arav. Not just homepage, but something more...", "/", "homepage, personal, blog, services, self-hosting", indexHead()) {
<section id="services">
<span>
<a href="https://arav.su">arav.su</a>.<a href="http://moq7aejnf4xk5k2bkaltli3ftkhusy2mbrd3pj23nrca343ku2mgk4yd.onion">onion</a>.<a href="http://[300:a98d:d6d0:8a08::f]">ygg</a>.<a href="http://arav.i2p">i2p</a><sup><a href="http://arav.i2p/?i2paddresshelper=5Kl-DiWbbk6wf7m0v6zBSNHYq3sXlnrWLIWVeGdpPbPyc9CBS~zrzDYpP43rv1fRiIkbVCD5hTEpY6joQGlk-dFkWWD6201qa6ecsDVQMaE3Q7UTYICd0VEBRoqDUSrvsM-P2y5oG4Z-77RmoGKpbcRgNuMVbQ7AGJNqVSGej-lSyscDWTIZT5dCT505lfRwprdD~emZqkwnn22X16Wpj-X4A4ifph4idrThGioz4UW6PrCpa-oebMCo217s0Zyl9VKaU-o9cx5eFUEwnshoUjqwh7VE-S45NDz854J08xldCATM3wwTRVXhc2NUypsJLKFKiV0z3EXN-ApCdxsV60C-eiXUTX5vYcHHH~imA79v8WKFybjnsyUBst5BBEPQIUifTceLUrTmQ9TUpaMV90EsD5SCshmCfOs8R5y2dK6EfQu8iyYAB5VFSH4M1CLiBZUsDTEFiOomn2JGMDnbPho8lMB8ss4SMuwZShb2LlGqLxJ38kRHlvC68VmJO7InBQAEAAcAAA==" title="Address helper">ah</a></sup>

View File

@ -8,7 +8,7 @@ import "git.arav.su/Arav/dwelling-home/pkg/mindflow"
import "git.arav.su/Arav/dwelling-home/pkg/util"
templ Mindflow(posts []mindflow.Post, categories []mindflow.Category, r *http.Request) {
@base("Mindflow", "Updates on my infrastructure, my very important opinions and thoughts.", "updates, thoughts, opinions, blog, diary", "/mindflow", "Mindflow", mindflowHead()) {
@base("Mindflow", "Updates on my infrastructure, my very important opinions and thoughts.", "updates, thoughts, opinions, blog, diary", "/mindflow", mindflowHead()) {
<p class="center">Here I post updates on websites and infrastructure, my very important opinions and thoughts no one asked for. If you'd like to subscribe to this bullshittery then <a href="/rss.xml">RSS feed</a> at your service. :)</p>
<section id="filter" class="hidden">
<p class="center">

View File

@ -5,5 +5,5 @@ import "net/http"
import "git.arav.su/Arav/dwelling-home/pkg/mindflow"
templ MindflowAdmin(posts []mindflow.Post, categories []mindflow.Category, r *http.Request) {
@base("Mindflow Administration", "", "", "/mindflow/admin", "Mindflow Administration", nil)
@base("Mindflow Administration", "", "", "/mindflow/admin", nil)
}

View File

@ -5,7 +5,7 @@ import "net/http"
import "git.arav.su/Arav/dwelling-home/pkg/util"
templ Privacy(r *http.Request) {
@base("Privacy", "Privacy statements for all of my services.", "privacy statements", "/privacy", "Privacy", nil) {
@base("Privacy", "Privacy statements for all of my services.", "privacy statements", "/privacy", nil) {
<section id="privacy">
<h2>Privacy statements</h2>
<h3>General data</h3>

View File

@ -7,7 +7,7 @@ import "git.arav.su/Arav/dwelling-home/pkg/util"
templ Stuff(r *http.Request) {
{{ gitSite := util.GetServiceByHost(r.Host, util.ServiceGit) }}
@base("Stuff", "Here I share my programs, scripts, articles, may be other stuff.", "articles, programs, personal projects, own music", "/stuff", "Stuff", nil) {
@base("Stuff", "Here I share my programs, scripts, articles, may be other stuff.", "articles, programs, personal projects, own music", "/stuff", nil) {
<p class="center">Here lies everything I've made that I'm willing to share.</p>
<section id="articles">
<h2>Articles</h2>