Files
old-ibcetvorke/cethttp/template.go
2023-11-27 21:02:16 +01:00

102 lines
1.6 KiB
Go

package cethttp
import (
"html/template"
"strings"
)
const html5Template = `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>IslamBosna</title>
<style>
html, body {
background-color: #171714;
color: #f9f5c3;
font-family: sans-serif;
justify-content: center;
}
header {
width: 100%;
padding-top: 0.5em;
padding-bottom: 0.5em;
font-family: sans-serif;
font-size: 3em;
background-color: #0f1115;
justify-content: center;
}
header div, content div {
max-width: 800px;
margin: auto;
}
a:link, a:visited {
color: #f9f5c3;
}
header a:link {
color: #f9f5c3;
text-decoration: none;
}
header a:visited {
color: #f9f5c3;
text-decoration: none;
}
h1 {
color: #e6fbfb;
}
.hidden_link {
color: #f9f5c3;
text-decoration: none;
}
</style>
</head>
<body>
<header>
<div>
<a href="/">☙ IslamBosna</a>
</div>
</header>
<content>
<div>
{{.}}
</div>
<div>
<br><br>
<h2>Ostalo</h2>
<p>
<a href="/a/">Arhiva</a>
</p>
<p>
<a href="gemini://gemini.islambosna.ba/">Gemini stranica</a>
</p>
<p>
<a class="hidden_link" href="/editor/n/">&#127769;</a>
</p>
</div>
</content>
<footer>
&nbsp;
</footer>
</body>
</html>
`
func html5Page(html string) string {
t1 := template.New("html5Template")
t1, _ = t1.Parse(html5Template)
result := new(strings.Builder)
// execute template with html as data into result string io writer stream
t1.Execute(result, template.HTML(html))
return result.String()
}