2024-02-27 19:29:54 +00:00
|
|
|
package web
|
|
|
|
|
|
|
|
templ (w *Web) Header(title string) {
|
|
|
|
<head>
|
2024-02-28 14:39:38 +00:00
|
|
|
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/foundation-sites@6.8.1/dist/css/foundation.min.css" />
|
2024-02-27 19:29:54 +00:00
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
|
|
<meta charset="UTF-8" />
|
|
|
|
if title != "" {
|
|
|
|
<title>catbase - { title }</title>
|
|
|
|
} else {
|
|
|
|
<title>catbase</title>
|
|
|
|
}
|
|
|
|
</head>
|
|
|
|
}
|
|
|
|
|
|
|
|
templ (w *Web) Footer() {
|
|
|
|
<script src="//unpkg.com/htmx.org@1.9.10" integrity="sha384-D1Kt99CQMDuVetoL1lrYwg5t+9QdHe7NLX/SoJYkXDFfX37iInKRy5xLSi8nO7UC" crossorigin="anonymous"></script>
|
2024-02-28 14:39:38 +00:00
|
|
|
<script src="//cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js"></script>
|
|
|
|
<script src="//cdn.jsdelivr.net/npm/foundation-sites@6.8.1/dist/js/foundation.min.js"></script>
|
2024-02-27 19:29:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
templ (w *Web) Index(title string, contents templ.Component) {
|
2024-02-28 14:39:38 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en" class="no-js">
|
2024-02-27 19:29:54 +00:00
|
|
|
@w.Header(title)
|
|
|
|
<body>
|
|
|
|
|
|
|
|
@w.Nav(title)
|
|
|
|
|
|
|
|
if contents != nil {
|
|
|
|
@contents
|
|
|
|
}
|
|
|
|
|
|
|
|
@w.Footer()
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
}
|
|
|
|
|
|
|
|
templ (w *Web) Nav(currentPage string) {
|
2024-02-28 14:39:38 +00:00
|
|
|
|
|
|
|
<div class="top-bar">
|
|
|
|
<div class="top-bar-left">
|
|
|
|
<ul class="menu">
|
|
|
|
<li class="menu-text">{ w.botName() }</li>
|
|
|
|
for _, item := range w.GetWebNavigation() {
|
|
|
|
<li>
|
|
|
|
if currentPage == item.Name {
|
|
|
|
<a class="is-active" aria-current="page" href={ templ.URL(item.URL) }>{ item.Name }</a>
|
|
|
|
} else {
|
|
|
|
<a href={ templ.URL(item.URL) }>{ item.Name }</a>
|
|
|
|
}
|
|
|
|
</li>
|
|
|
|
}
|
|
|
|
</ul>
|
2024-02-27 19:29:54 +00:00
|
|
|
</div>
|
2024-02-28 14:39:38 +00:00
|
|
|
</div>
|
2024-02-27 19:29:54 +00:00
|
|
|
}
|