Removed a heading argument, now a title is used for h1.
This commit is contained in:
parent
c16cb79307
commit
83a6111660
@ -3,7 +3,7 @@ package web
|
|||||||
import "git.arav.su/Arav/dwelling-home/pkg/servicestat"
|
import "git.arav.su/Arav/dwelling-home/pkg/servicestat"
|
||||||
|
|
||||||
templ About(filesSrvc string, services servicestat.ServiceList) {
|
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() {
|
templ aboutHead() {
|
||||||
|
@ -6,7 +6,7 @@ import "net/http"
|
|||||||
import "git.arav.su/Arav/dwelling-home/pkg/util"
|
import "git.arav.su/Arav/dwelling-home/pkg/util"
|
||||||
|
|
||||||
templ Article(title, description, body, urlName string, date time.Time, r *http.Request) {
|
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>
|
<article>
|
||||||
<header>
|
<header>
|
||||||
<h2>{ title }</h2>
|
<h2>{ title }</h2>
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
package web
|
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>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
if title != "" {
|
if title != "" && title != "Home" {
|
||||||
<title>{ title } - Arav's dwelling</title>
|
<title>{ title } - Arav's dwelling</title>
|
||||||
} else {
|
} else {
|
||||||
<title>Arav's dwelling</title>
|
<title>Arav's dwelling</title>
|
||||||
@ -28,12 +28,12 @@ templ base(title, description, keywords, canonical, heading string, head templ.C
|
|||||||
}
|
}
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header class="main">
|
||||||
<svg id="logo" viewBox="0 -25 216 40">
|
<svg viewBox="0 -36 360 66">
|
||||||
<text class="logo">Arav's dwelling</text>
|
<text y="7" textLength="360" lengthAdjust="spacingAndGlyphs">Arav's dwelling</text>
|
||||||
<text class="under" y="11">Welcome to my sacred place, wanderer</text>
|
<text y="25" textLength="360" lengthAdjust="spacingAndGlyphs">Welcome to my sacred place, wanderer</text>
|
||||||
</svg>
|
</svg>
|
||||||
@navigation(heading)
|
@navigation(title)
|
||||||
</header>
|
</header>
|
||||||
{ children... }
|
{ children... }
|
||||||
<footer>
|
<footer>
|
||||||
@ -49,16 +49,21 @@ var navElements = []string{"Stuff", "Mindflow", "About", "Guestbook"}
|
|||||||
|
|
||||||
templ navigation(heading string) {
|
templ navigation(heading string) {
|
||||||
<nav>
|
<nav>
|
||||||
if heading != "Home" {
|
<div>
|
||||||
<a href="/">Home</a>
|
if heading != "Home" {
|
||||||
}
|
<a href="/">Home</a>
|
||||||
<a href="/stuff">Stuff</a>
|
}
|
||||||
<a href="/mindflow">Mindflow</a>
|
<a href="/stuff">Stuff</a>
|
||||||
<a href="/about">About</a>
|
<a href="/mindflow">Mindflow</a>
|
||||||
<a href="/guestbook">Guestbook</a>
|
<a href="/about">About</a>
|
||||||
|
<a href="/guestbook">Guestbook</a>
|
||||||
|
</div>
|
||||||
if heading != "" && heading != "Home" {
|
if heading != "" && heading != "Home" {
|
||||||
<h1>{ heading }</h1>
|
if strings.HasSuffix(heading, "Article") {
|
||||||
|
<h1>Article</h1>
|
||||||
|
} else {
|
||||||
|
<h1>{ heading }</h1>
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</nav>
|
</nav>
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ import "net/http"
|
|||||||
|
|
||||||
templ ErrorXXX(errCode int, reason, message, referer string) {
|
templ ErrorXXX(errCode int, reason, message, referer string) {
|
||||||
{{ errText := http.StatusText(errCode) }}
|
{{ errText := http.StatusText(errCode) }}
|
||||||
@base(errText, errText, "", "", errText, errorXXXHead()) {
|
@base(errText, errText, "", "", errorXXXHead()) {
|
||||||
<section id="error">
|
<section id="error">
|
||||||
<h1>{ fmt.Sprint(errCode) }</h1>
|
<h1>{ fmt.Sprint(errCode) }</h1>
|
||||||
{ errText }
|
{ errText }
|
||||||
|
@ -10,7 +10,7 @@ import "git.arav.su/Arav/justguestbook"
|
|||||||
import "git.arav.su/Arav/dwelling-home/pkg/util"
|
import "git.arav.su/Arav/dwelling-home/pkg/util"
|
||||||
|
|
||||||
templ Guestbook(captchaID, owner string, entries []*justguestbook.Entry, pageCount int64, r *http.Request) {
|
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">
|
<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="name" maxlength="80" placeholder="Name (Anonymous if left blank)"/>
|
||||||
<input type="text" name="website" maxlength="255" placeholder="Website (optional)"/>
|
<input type="text" name="website" maxlength="255" placeholder="Website (optional)"/>
|
||||||
|
@ -5,5 +5,5 @@ import "net/http"
|
|||||||
import "git.arav.su/Arav/justguestbook"
|
import "git.arav.su/Arav/justguestbook"
|
||||||
|
|
||||||
templ GuestbookAdmin(owner string, entries []*justguestbook.Entry, r *http.Request) {
|
templ GuestbookAdmin(owner string, entries []*justguestbook.Entry, r *http.Request) {
|
||||||
@base("Guestbook Administration", "", "", "/guestbook/admin", "Guestbook Administration", nil)
|
@base("Guestbook Administration", "", "", "/guestbook/admin", nil)
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
package web
|
package web
|
||||||
|
|
||||||
templ Index() {
|
templ Index() {
|
||||||
@base("",
|
@base("Home", "A homepage of a russian guy Alexander aka Arav. Not just homepage, but something more...", "/", "homepage, personal, blog, services, self-hosting", indexHead()) {
|
||||||
"A homepage of a russian guy Alexander aka Arav. Not just homepage, but something more...", "/",
|
|
||||||
"homepage, personal, blog, services, self-hosting", "Home", indexHead()) {
|
|
||||||
<section id="services">
|
<section id="services">
|
||||||
<span>
|
<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>
|
<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>
|
||||||
|
@ -8,7 +8,7 @@ import "git.arav.su/Arav/dwelling-home/pkg/mindflow"
|
|||||||
import "git.arav.su/Arav/dwelling-home/pkg/util"
|
import "git.arav.su/Arav/dwelling-home/pkg/util"
|
||||||
|
|
||||||
templ Mindflow(posts []mindflow.Post, categories []mindflow.Category, r *http.Request) {
|
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>
|
<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">
|
<section id="filter" class="hidden">
|
||||||
<p class="center">
|
<p class="center">
|
||||||
|
@ -5,5 +5,5 @@ import "net/http"
|
|||||||
import "git.arav.su/Arav/dwelling-home/pkg/mindflow"
|
import "git.arav.su/Arav/dwelling-home/pkg/mindflow"
|
||||||
|
|
||||||
templ MindflowAdmin(posts []mindflow.Post, categories []mindflow.Category, r *http.Request) {
|
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)
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ import "net/http"
|
|||||||
import "git.arav.su/Arav/dwelling-home/pkg/util"
|
import "git.arav.su/Arav/dwelling-home/pkg/util"
|
||||||
|
|
||||||
templ Privacy(r *http.Request) {
|
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">
|
<section id="privacy">
|
||||||
<h2>Privacy statements</h2>
|
<h2>Privacy statements</h2>
|
||||||
<h3>General data</h3>
|
<h3>General data</h3>
|
||||||
|
@ -7,7 +7,7 @@ import "git.arav.su/Arav/dwelling-home/pkg/util"
|
|||||||
templ Stuff(r *http.Request) {
|
templ Stuff(r *http.Request) {
|
||||||
{{ gitSite := util.GetServiceByHost(r.Host, util.ServiceGit) }}
|
{{ 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>
|
<p class="center">Here lies everything I've made that I'm willing to share.</p>
|
||||||
<section id="articles">
|
<section id="articles">
|
||||||
<h2>Articles</h2>
|
<h2>Articles</h2>
|
||||||
|
Loading…
Reference in New Issue
Block a user