kopia lustrzana https://github.com/cblgh/lieu
Merge fa3d260edc
into bcddc10517
commit
b7e1f426c0
|
@ -59,7 +59,7 @@ h1 {
|
|||
line-height: 1;
|
||||
}
|
||||
|
||||
h2 {
|
||||
h2, .tagline {
|
||||
font-family: "Noto Serif";
|
||||
font-weight: 400;
|
||||
font-size: 2.4rem;
|
||||
|
@ -196,7 +196,7 @@ nav li {
|
|||
|
||||
/* UTILITY CLASSES */
|
||||
|
||||
.italic-text {
|
||||
.italic-text, .tagline {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,31 +1,12 @@
|
|||
{{ template "head" . }}
|
||||
<header class="header-home">
|
||||
<a class="header-home_link" href="https://github.com/cblgh/lieu">Lieu</a>
|
||||
<nav>
|
||||
<ul class="header-home_navigation" role='list'>
|
||||
<li><a href="/webring">Webring</a></li>
|
||||
<li><a href="/about">About</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
{{ template "nav" . }}
|
||||
<main class="grid-items-center">
|
||||
<article class="translateY-75">
|
||||
<div class="flow">
|
||||
<h1>
|
||||
{{ .SiteName }}
|
||||
</h1>
|
||||
<h2 class="italic-text">
|
||||
{{ .Data.Tagline }}
|
||||
</h2>
|
||||
<form class="search">
|
||||
<label class="visually-hidden" for="search">Search {{ .SiteName }}</label>
|
||||
<span class="search__input">
|
||||
<input type="search" required minlength="1" name="q" placeholder="{{ .Data.Placeholder }}" class="flex-grow" id="search" maxlength="6000" >
|
||||
<button type="submit" class="search__button" aria-label="Search" title="Search">
|
||||
<svg viewBox="0 0 420 300" xmlns="http://www.w3.org/2000/svg" baseProfile="full" style="background:var(--secondary)" width="42" height="30" fill="none"><path d="M90 135q60-60 120-60 0 0 0 0 60 0 120 60m-120 60a60 60 0 01-60-60 60 60 0 0160-60 60 60 0 0160 60 60 60 0 01-60 60m45-15h0l30 30m-75-15h0v45m-45-60h0l-30 30" stroke-width="81" stroke-linecap="square" stroke-linejoin="round" stroke="var(--primary)"/></svg>
|
||||
</button>
|
||||
</span>
|
||||
</form>
|
||||
<h1>{{ .SiteName }}</h1>
|
||||
<p class="tagline">{{ .Data.Tagline }}</p>
|
||||
<!-- The search form currently is in nav.html -->
|
||||
{{ template "search-form" . }}
|
||||
</div>
|
||||
</article>
|
||||
</main>
|
||||
|
|
|
@ -1,11 +1,29 @@
|
|||
{{ define "nav" }}
|
||||
<header class="header-home">
|
||||
<a class="header-home_link" href="/">{{ .SiteName }}</a>
|
||||
<nav>
|
||||
<ul class="header-home_navigation" role='list'>
|
||||
<li><a href="/webring">Webring</a></li>
|
||||
<li><a href="/about">About</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
{{ if eq .View "index" }}
|
||||
<a class="header-home_link" href="https://github.com/cblgh/lieu">Lieu</a>
|
||||
{{else}}
|
||||
<a class="header-home_link" href="/">{{ .SiteName }}</a>
|
||||
{{ end }}
|
||||
<nav>
|
||||
<ul class="header-home_navigation">
|
||||
<li><a href="/webring" title="Webring (external link)">Webring<span aria-hidden="true"> ↗</span></a></li>
|
||||
<li><a href="/about" {{if eq .View "about"}}aria-current="page"{{end}}>About</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
{{ end }}
|
||||
|
||||
{{ define "search-form" }}
|
||||
<form method="GET" class="search">
|
||||
<span class="search__input">
|
||||
<input type="search" minlength="1" required name="q" aria-label="Search {{ .SiteName }}" placeholder="Search {{ .SiteName }}" {{ if (eq .View "search") }}value="{{ .Data.Query }}"{{ end }} class="search-box" id="search" maxlength="6000">
|
||||
{{ if and (eq .View "search") (ne .Data.Site "") }}
|
||||
<input type="hidden" value="{{ .Data.Site }}" name="site">
|
||||
{{ end }}
|
||||
<button type="submit" class="search__button" aria-label="Search" title="Search">
|
||||
<svg aria-hidden="true" viewBox="0 0 420 300" xmlns="http://www.w3.org/2000/svg" baseProfile="full" width="42" height="30" fill="none"><path d="M90 135q60-60 120-60 0 0 0 0 60 0 120 60m-120 60a60 60 0 01-60-60 60 60 0 0160-60 60 60 0 0160 60 60 60 0 01-60 60m45-15h0l30 30m-75-15h0v45m-45-60h0l-30 30" stroke-width="81" stroke-linecap="square" stroke-linejoin="round" stroke="var(--primary)"/></svg>
|
||||
</button>
|
||||
</span>
|
||||
</form>
|
||||
{{ end }}
|
||||
|
|
|
@ -3,18 +3,8 @@
|
|||
<main id="results" class="flow2">
|
||||
<h1>{{ .Data.Title }} {{ if ne .Data.Site "" }} for {{ .Data.Site }} {{ end }}</h1>
|
||||
|
||||
<form method="GET" class="search">
|
||||
<label for="search">Search {{ .SiteName }} </label>
|
||||
<span class="search__input">
|
||||
<input type="search" minlength="1" required name="q" placeholder="Search" value="{{ .Data.Query }}" class="search-box" id="search" maxlength="6000">
|
||||
{{ if ne .Data.Site "" }}
|
||||
<input type="hidden" value="{{ .Data.Site }}" name="site">
|
||||
{{ end }}
|
||||
<button type="submit" class="search__button" aria-label="Search" title="Search">
|
||||
<svg viewBox="0 0 420 300" xmlns="http://www.w3.org/2000/svg" baseProfile="full" style="background:var(--secondary)" width="42" height="30" fill="none"><path d="M90 135q60-60 120-60 0 0 0 0 60 0 120 60m-120 60a60 60 0 01-60-60 60 60 0 0160-60 60 60 0 0160 60 60 60 0 01-60 60m45-15h0l30 30m-75-15h0v45m-45-60h0l-30 30" stroke-width="81" stroke-linecap="square" stroke-linejoin="round" stroke="var(--primary)"/></svg>
|
||||
</button>
|
||||
</span>
|
||||
</form>
|
||||
<!-- The search form currently is in nav.html -->
|
||||
{{ template "search-form" . }}
|
||||
{{ if ne .Data.Site "" }}
|
||||
<!-- add a button to clear the search results if a site:<domain> param has been used -->
|
||||
<form method="GET" class="search">
|
||||
|
|
|
@ -23,6 +23,7 @@ type RequestHandler struct {
|
|||
|
||||
type TemplateView struct {
|
||||
SiteName string
|
||||
View string
|
||||
Data interface{}
|
||||
}
|
||||
|
||||
|
@ -221,6 +222,7 @@ func (h RequestHandler) webringRoute(res http.ResponseWriter, req *http.Request)
|
|||
|
||||
func (h RequestHandler) renderView(res http.ResponseWriter, tmpl string, view *TemplateView) {
|
||||
view.SiteName = h.config.General.Name
|
||||
view.View = tmpl
|
||||
var errTemp error
|
||||
if _, exists := os.LookupEnv("LIEU_DEV"); exists {
|
||||
var templates = template.Must(template.ParseFiles(
|
||||
|
|
Ładowanie…
Reference in New Issue