mirror of https://gitlab.com/octtspacc/sitoctt
Aggiunta ricerca (fork da https://github.com/nunocoracao/blowfish), bottoni ordinati, bottone torna in cima
This commit is contained in:
parent
13899491d9
commit
745267cf49
|
@ -1,36 +1,168 @@
|
|||
[[site]]
|
||||
[[10-site]]
|
||||
[10-site.title]
|
||||
en = "About this site"
|
||||
it = "Riguardo questo sito"
|
||||
|
||||
[[20-me]]
|
||||
[20-me.title]
|
||||
en = "Myself and my essence"
|
||||
it = "Io e la mia essenza"
|
||||
|
||||
[[30-thanks]]
|
||||
[30-thanks.title]
|
||||
en = "Made thanks to"
|
||||
it = "Fatto grazie a"
|
||||
|
||||
#[[40-spam]]
|
||||
#[40-spam.title]
|
||||
#en = "Interesting"
|
||||
#it = "D'interesse"
|
||||
|
||||
[[50-fun]]
|
||||
[50-fun.title]
|
||||
en = "Other things"
|
||||
it = "Altre cose"
|
||||
|
||||
#######################################
|
||||
|
||||
[[10-site]]
|
||||
alt = "CC BY-SA"
|
||||
file = "CC-BY-SA.svg"
|
||||
href = "https://creativecommons.org/licenses/by-sa/4.0/deed.it?ref=chooser-v1&title=%E2%9C%A8sitoctt%E2%9C%A8&href=https://sitoctt.octt.eu.org&creator=OctoSpacc"
|
||||
|
||||
[[site]]
|
||||
[[10-site]]
|
||||
alt = "✨sitoctt"
|
||||
file = "Sites/sitoctt-1.png"
|
||||
href = "/it/miscellanea/Raccolta-Siti-Internet/#il-mio"
|
||||
|
||||
[[site]]
|
||||
[[10-site]]
|
||||
alt = "Warning: Page contains JavaScript!"
|
||||
file = "Warning-Page-contains-JavaScript.png"
|
||||
|
||||
[[site]]
|
||||
[[10-site]]
|
||||
alt = "Best viewed with any browser"
|
||||
file = "BEST-viewed-with-ANY-BROWSER.gif"
|
||||
|
||||
[[site]]
|
||||
[[10-site]]
|
||||
alt = "Mobile-Friendly"
|
||||
file = "MOBILE-FRIENDLY.png"
|
||||
|
||||
[[site]]
|
||||
[[10-site]]
|
||||
alt = "This site is Miku-approved"
|
||||
file = "this-site-is-MIKU-APPROVED.gif"
|
||||
|
||||
[[site]]
|
||||
[[10-site]]
|
||||
alt = "Not secure (HTTP) version"
|
||||
file = "Not-secure-defcon1.gif"
|
||||
href = "http://http.sitoctt.octt.eu.org"
|
||||
|
||||
[[site]]
|
||||
[[10-site]]
|
||||
alt = "Download Offline Version"
|
||||
file = "OFF-LINE-VERSION.png"
|
||||
href = "https://github.com/octospacc/sitoctt/archive/refs/heads/gh-pages.zip"
|
||||
|
||||
#######################################
|
||||
|
||||
[[20-me]]
|
||||
alt = "Follow me on Mastodon"
|
||||
file = "Follow-me-on-mastodon.png"
|
||||
href = "https://mastodon.uno/@octo"
|
||||
rel = "me"
|
||||
|
||||
[[20-me]]
|
||||
alt = "Bandiera Octt"
|
||||
file = "Octt-Flag.png"
|
||||
|
||||
[[20-me]]
|
||||
alt = "Rainbow"
|
||||
file = "rainbow_bev.png"
|
||||
href = "https://en.wikipedia.org/wiki/Refraction"
|
||||
spam = true
|
||||
|
||||
# Source: https://astral.town | License: Unknown
|
||||
[[20-me]]
|
||||
alt = "Occhi blink blink"
|
||||
src = "@/Media/Blink-0.gif"
|
||||
|
||||
[[20-me]]
|
||||
alt = "I wear cute socks!"
|
||||
file = "I-wear-cute-socks.gif"
|
||||
|
||||
[[20-me]]
|
||||
alt = "nya~"
|
||||
file = "nya.png"
|
||||
|
||||
[[20-me]]
|
||||
alt = "Hello Kitty"
|
||||
file = "HELLO-Kitty.gif"
|
||||
href = "https://www.sanrio.com"
|
||||
spam = true
|
||||
|
||||
[[20-me]]
|
||||
alt = "Girl rot"
|
||||
file = "GRL-ROT.gif"
|
||||
|
||||
[[20-me]]
|
||||
alt = "Cyber rot"
|
||||
file = "CYBER-ROT.gif"
|
||||
|
||||
[[20-me]]
|
||||
alt = "Girls for Notepad"
|
||||
file = "girls-4-notepad.gif"
|
||||
|
||||
[[20-me]]
|
||||
alt = "Perfect Soldier"
|
||||
file = "Perfect-Soldier.gif"
|
||||
|
||||
[[20-me]]
|
||||
alt = "I like computer"
|
||||
file = "I-LIKE-COMPUTER.png"
|
||||
|
||||
#######################################
|
||||
|
||||
[[30-thanks]]
|
||||
alt = "Made with Hugo"
|
||||
file = "HUGO.webp"
|
||||
href = "https://gohugo.io"
|
||||
spam = true
|
||||
|
||||
[[30-thanks]]
|
||||
alt = "Made with CSS"
|
||||
file = "MADE-WITH-CASCADING-STYLE-SHEETS-cyan.png"
|
||||
href = "https://developer.mozilla.org/en-US/docs/Web/CSS"
|
||||
spam = true
|
||||
|
||||
[[30-thanks]]
|
||||
alt = "Made on GNU/Linux"
|
||||
file = "Made-on-GNU-Linux.png"
|
||||
href = "https://www.gnu.org/home.it"
|
||||
spam = true
|
||||
|
||||
[[30-thanks]]
|
||||
alt = "Made with Notepad++"
|
||||
file = "Made-with-Notepad++.png"
|
||||
href = "https://notepad-plus-plus.org"
|
||||
spam = true
|
||||
|
||||
[[30-thanks]]
|
||||
alt = "Made with Microsoft Notepad"
|
||||
file = "Powered-by-Microsoft-Notepad.gif"
|
||||
|
||||
[[30-thanks]]
|
||||
alt = "Graphics by GIMP"
|
||||
file = "Graphics-by-Gimp.png"
|
||||
href = "https://www.gimp.org"
|
||||
spam = true
|
||||
|
||||
[[30-thanks]]
|
||||
alt = "Fueled by Coffee"
|
||||
file = "Fueled-by-COFFEE.gif"
|
||||
|
||||
[[30-thanks]]
|
||||
alt = "Powered by THE VOID"
|
||||
file = "Powered-by-THE-VOID.png"
|
||||
|
||||
[[30-thanks]]
|
||||
alt = "Powered by Bob"
|
||||
file = "POWERED-BY-bob.gif"
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ _L'immagine è in formato PNG e già compressa il più possibile.[^Comandi di Co
|
|||
Come si può leggere dal nome del sito e dal dominio, è il sito di Arci (o anche Aurora). Lo ha messo in piedi oggi (2022-06-30), dopo che ha detto di non sapere cosa fare con tutto il tempo libero estivo, e io le ho detto "fai l'Arcisito".
|
||||
• Clearweb: [arci.me](https://arci.me) <!-- [auroraviola.eu.org](https://auroraviola.eu.org) -->
|
||||
|
||||
- **🇬🇧️ Gianmarco Gargiulo**
|
||||
- **🇬🇧️ 🇮🇹️ Gianmarco Gargiulo**
|
||||
![serimemo]({{< assetsRoot >}}/Media/Buttons/88x31/Sites/gianmarco.gg-gmgpin.gif)
|
||||
Sito con layout moderno, ma design decisamente creativo, con un lato artistico ben espresso nelle illustrazioni. La home page funge da lista dell'archivio dei contenuti, e i tipi diversi vengono illustrati con il formato più appropriato. Molto incentrato su Linux e il software libero, ma i disegni e le foto fanno una bella figura.
|
||||
• Clearweb: [gianmarco.gg](https://gianmarco.gg)
|
||||
|
|
12
hugo.toml
12
hugo.toml
|
@ -47,7 +47,17 @@ defaultContentLanguageInSubdir = true
|
|||
favicon = "/favicon.ico"
|
||||
author = "OctoSpacc"
|
||||
recent_posts_number = 5
|
||||
other_posts_number = 6
|
||||
other_posts_number = 5
|
||||
toc = true
|
||||
show_reading_time = true
|
||||
#custom_css = [ "Global.scss", "sitoctt.scss" ]
|
||||
|
||||
[outputFormats]
|
||||
[outputFormats.SearchIndex]
|
||||
mediaType = "text/javascript"
|
||||
baseName = "searchindex"
|
||||
isPlainText = true
|
||||
|
||||
[outputs]
|
||||
home = [ "HTML", "SearchIndex" ]
|
||||
|
||||
|
|
|
@ -3,3 +3,9 @@ other = "The content of this page has been entirely machine-translated into Engl
|
|||
|
||||
[notes-refs]
|
||||
other = "🏷️ Notes and References"
|
||||
|
||||
[search]
|
||||
other = "Search"
|
||||
|
||||
[searchNoJs]
|
||||
other = "No-JS Search"
|
||||
|
|
|
@ -3,3 +3,9 @@ other = "Il contenuto di questa pagina è stato interamente tradotto a macchina
|
|||
|
||||
[notes-refs]
|
||||
other = "🏷️ Note e Riferimenti"
|
||||
|
||||
[search]
|
||||
other = "Cerca"
|
||||
|
||||
[searchNoJs]
|
||||
other = "Ricerca No-JS"
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
{{- $index := slice -}}
|
||||
{{- $pages := .Site.Pages -}}
|
||||
{{- range $pages -}}
|
||||
{{- $section := .Site.GetPage "section" .Section -}}
|
||||
{{- if .Date -}}
|
||||
{{- $index = $index | append (dict
|
||||
"date" (.Date | time.Format (.Site.Language.Params.dateFormat | default ":date_long"))
|
||||
"title" (.Title | emojify | safeJS)
|
||||
"section" ($section.Title | emojify | safeJS)
|
||||
"summary" (.Summary | safeJS)
|
||||
"content" (.Plain | safeJS)
|
||||
"permalink" .RelPermalink
|
||||
"externalUrl" .Params.externalUrl
|
||||
"type" .Type
|
||||
) -}}
|
||||
{{- else -}}
|
||||
{{- $index = $index | append (dict
|
||||
"title" (.Title | emojify | safeJS)
|
||||
"section" ($section.Title | emojify | safeJS)
|
||||
"summary" (.Summary | safeJS)
|
||||
"content" (.Plain | safeJS)
|
||||
"permalink" .RelPermalink
|
||||
"externalUrl" .Params.externalUrl
|
||||
"type" .Type
|
||||
) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
window.SiteSearchIndex={{- $index | jsonify -}}
|
|
@ -1,15 +1,25 @@
|
|||
{{ $repo := "octospacc/sitoctt" }}
|
||||
{{ $repoId := "R_kgDOHbCR4A" }}
|
||||
{{ $category := "Comments" }}
|
||||
{{ $categoryId := "DIC_kwDOHbCR4M4CiAIZ" }}
|
||||
{{ $theme := "noborder_light" }}
|
||||
<iframe class="GiscusFallback"
|
||||
style="width: 100%; box-sizing: border-box; height: 100vh;"
|
||||
src="https://hlb0.octt.eu.org/OcttComments.php?baseUrl={{ .Site.BaseURL }}&pageSlug={{ .RelPermalink }}&theme={{ $theme }}&repo={{ $repo }}&repoId={{ $repoId }}&category={{ $category }}&categoryId={{ $categoryId }}"
|
||||
></iframe>
|
||||
<script src="https://giscus.app/client.js"
|
||||
data-repo="octospacc/sitoctt"
|
||||
data-repo-id="R_kgDOHbCR4A"
|
||||
data-category="Comments"
|
||||
data-category-id="DIC_kwDOHbCR4M4CiAIZ"
|
||||
data-repo="{{ $repo }}"
|
||||
data-repo-id="{{ $repoId }}"
|
||||
data-category="{{ $category }}"
|
||||
data-category-id="{{ $categoryId }}"
|
||||
data-mapping="pathname"
|
||||
data-strict="1"
|
||||
data-reactions-enabled="1"
|
||||
data-emit-metadata="0"
|
||||
data-input-position="top"
|
||||
data-theme="noborder_light"
|
||||
data-theme="{{ $theme }}"
|
||||
data-lang="{{ .Language }}"
|
||||
crossorigin="anonymous"
|
||||
async="async">
|
||||
</script>
|
||||
async="async"
|
||||
onload="document.querySelector('iframe.GiscusFallback').remove();"
|
||||
></script>
|
||||
|
|
|
@ -1,16 +1,26 @@
|
|||
{{- $language := (string .Language) -}}
|
||||
{{- with resources.Get "ButtonBadges.toml" -}}
|
||||
{{- with . | transform.Unmarshal -}}
|
||||
{{- range $group, $badges := . -}}
|
||||
<div data-group="{{ $group }}">
|
||||
{{- range $badges -}}
|
||||
{{- $newprops := (dict
|
||||
"srcRelative" .file
|
||||
"hrefLinkback" .linkback
|
||||
) -}}
|
||||
{{- if .spam -}}
|
||||
{{- $newprops = (merge $newprops (dict "rel" "nofollow")) -}}
|
||||
{{- $src := .src -}}
|
||||
{{- if (or .file .src) -}}
|
||||
{{- if $src -}}
|
||||
{{ $src = (partial "functions/ParseFileUrl.html" $src) }}
|
||||
{{- end -}}
|
||||
{{- $newprops := (dict
|
||||
"src" $src
|
||||
"srcRelative" .file
|
||||
"hrefLinkback" .linkback
|
||||
) -}}
|
||||
{{- if .spam -}}
|
||||
{{- $newprops = (merge $newprops (dict "rel" "nofollow noopener" "target" "_blank")) -}}
|
||||
{{- end -}}
|
||||
{{ partial "ImgButton.html" (merge . $newprops) }}
|
||||
{{- else -}}
|
||||
<h4>{{ partial "functions/FromLanguageObject.html" (dict "Object" .title "Language" $language) }}</h4>
|
||||
{{- end -}}
|
||||
{{ partial "ImgButton.html" (merge . $newprops) }}
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
@ -19,132 +29,6 @@
|
|||
|
||||
<div>
|
||||
|
||||
{{ partial "ImgButton.html" (dict
|
||||
"alt" "Follow me on Mastodon"
|
||||
"srcRelative" "Follow-me-on-mastodon.png"
|
||||
"href" "https://mastodon.uno/@octo"
|
||||
"rel" "me"
|
||||
) }}
|
||||
|
||||
{{ partial "ImgButton.html" (dict
|
||||
"alt" "Bandiera Octt"
|
||||
"srcRelative" "Octt-Flag.png"
|
||||
) }}
|
||||
|
||||
{{ partial "ImgButton.html" (dict
|
||||
"alt" "Rainbow"
|
||||
"srcRelative" "rainbow_bev.png"
|
||||
"href" "https://en.wikipedia.org/wiki/Refraction"
|
||||
"rel" "nofollow"
|
||||
) }}
|
||||
|
||||
<!-- Source: https://astral.town | License: Unknown -->
|
||||
{{ partial "ImgButton.html" (dict
|
||||
"alt" "Occhi blink blink"
|
||||
"src" (printf "%s/Media/Blink-0.gif" (partial "assetsRoot.html"))
|
||||
) }}
|
||||
|
||||
{{ partial "ImgButton.html" (dict
|
||||
"alt" "I wear cute socks!"
|
||||
"srcRelative" "I-wear-cute-socks.gif"
|
||||
) }}
|
||||
|
||||
{{ partial "ImgButton.html" (dict
|
||||
"alt" "nya"
|
||||
"srcRelative" "nya.png"
|
||||
) }}
|
||||
|
||||
{{ partial "ImgButton.html" (dict
|
||||
"alt" "Hello Kitty"
|
||||
"srcRelative" "HELLO-Kitty.gif"
|
||||
"href" "https://www.sanrio.com"
|
||||
"rel" "nofollow"
|
||||
) }}
|
||||
|
||||
{{ partial "ImgButton.html" (dict
|
||||
"alt" "Girl rot"
|
||||
"srcRelative" "GRL-ROT.gif"
|
||||
) }}
|
||||
|
||||
{{ partial "ImgButton.html" (dict
|
||||
"alt" "Cyber rot"
|
||||
"srcRelative" "CYBER-ROT.gif"
|
||||
) }}
|
||||
|
||||
{{ partial "ImgButton.html" (dict
|
||||
"alt" "Girls for Notepad"
|
||||
"srcRelative" "girls-4-notepad.gif"
|
||||
) }}
|
||||
|
||||
{{ partial "ImgButton.html" (dict
|
||||
"alt" "Perfect Soldier"
|
||||
"srcRelative" "Perfect-Soldier.gif"
|
||||
) }}
|
||||
|
||||
{{ partial "ImgButton.html" (dict
|
||||
"alt" "I like computer"
|
||||
"srcRelative" "I-LIKE-COMPUTER.png"
|
||||
) }}
|
||||
|
||||
</div><div>
|
||||
|
||||
{{ partial "ImgButton.html" (dict
|
||||
"alt" "Made with Hugo"
|
||||
"srcRelative" "HUGO.webp"
|
||||
"href" "https://gohugo.io"
|
||||
"rel" "nofollow"
|
||||
) }}
|
||||
|
||||
{{ partial "ImgButton.html" (dict
|
||||
"alt" "Made with CSS"
|
||||
"srcRelative" "MADE-WITH-CASCADING-STYLE-SHEETS-cyan.png"
|
||||
"href" "https://developer.mozilla.org/en-US/docs/Web/CSS"
|
||||
"rel" "nofollow"
|
||||
) }}
|
||||
|
||||
{{ partial "ImgButton.html" (dict
|
||||
"alt" "Made on GNU/Linux"
|
||||
"srcRelative" "Made-on-GNU-Linux.png"
|
||||
"href" "https://www.gnu.org/home.it"
|
||||
"rel" "nofollow"
|
||||
) }}
|
||||
|
||||
{{ partial "ImgButton.html" (dict
|
||||
"alt" "Made with Notepad++"
|
||||
"srcRelative" "Made-with-Notepad++.png"
|
||||
"href" "https://notepad-plus-plus.org"
|
||||
"rel" "nofollow"
|
||||
) }}
|
||||
|
||||
{{ partial "ImgButton.html" (dict
|
||||
"alt" "Made with Microsoft Notepad"
|
||||
"srcRelative" "Powered-by-Microsoft-Notepad.gif"
|
||||
) }}
|
||||
|
||||
{{ partial "ImgButton.html" (dict
|
||||
"alt" "Graphics by GIMP"
|
||||
"srcRelative" "Graphics-by-Gimp.png"
|
||||
"href" "https://www.gimp.org"
|
||||
"rel" "nofollow"
|
||||
) }}
|
||||
|
||||
{{ partial "ImgButton.html" (dict
|
||||
"alt" "Fueled by Coffee"
|
||||
"srcRelative" "Fueled-by-COFFEE.gif"
|
||||
) }}
|
||||
|
||||
{{ partial "ImgButton.html" (dict
|
||||
"alt" "Powered by THE VOID"
|
||||
"srcRelative" "Powered-by-THE-VOID.png"
|
||||
) }}
|
||||
|
||||
{{ partial "ImgButton.html" (dict
|
||||
"alt" "Powered by Bob"
|
||||
"srcRelative" "POWERED-BY-bob.gif"
|
||||
) }}
|
||||
|
||||
</div><div>
|
||||
|
||||
{{ partial "ImgButton.html" (dict
|
||||
"alt" "Internet Archive"
|
||||
"srcRelative" "Sites/Internet-Archive.png"
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
{{- return (or (index .Object .Language) (index .Object "en") (index .Object "it")) -}}
|
|
@ -0,0 +1,5 @@
|
|||
{{ $url := . }}
|
||||
{{ if hasPrefix . "@" }}
|
||||
{{ $url = (printf "%s/%s" (partial "assetsRoot") (trim . "@/")) }}
|
||||
{{ end }}
|
||||
{{ return $url }}
|
|
@ -0,0 +1,38 @@
|
|||
<div
|
||||
id="search-wrapper"
|
||||
class="fixed flex top-0 w-100 vh-100 inset-0 flex-col pa4 bg-neutral-500/50 p-4 dark:bg-neutral-900/50 sm:p-6 md:p-[10vh] lg:p-[12vh]"
|
||||
data-url="{{ "" | absLangURL }}"
|
||||
style="word-break:break-word; visibility:hidden; z-index:500; background-color:rgb(253, 244, 255, 0.9); backdrop-filter:blur(8px);"
|
||||
>
|
||||
<div
|
||||
id="search-modal"
|
||||
class="flex flex-column w-100 max-w-3xl min-h-0 mx-auto border rounded-md shadow-lg top-20 border-neutral-200 bg-neutral dark:border-neutral-700 dark:bg-neutral-800"
|
||||
>
|
||||
<header class="relative z-10 flex items-center justify-between flex-none px-2">
|
||||
<form class="flex items-center flex-auto min-w-0">
|
||||
<div class="flex items-center justify-center w-8 h-8 text-neutral-400">
|
||||
{{/* partial "icon.html" "search" */}}
|
||||
</div>
|
||||
<input
|
||||
type="search"
|
||||
id="search-query"
|
||||
class="flex flex-auto h2 mx-1 bg-transparent appearance-none focus:outline-dotted focus:outline-2 focus:outline-transparent"
|
||||
placeholder="{{ i18n "search" }}... 🔎️"
|
||||
tabindex="0"
|
||||
/>
|
||||
</form>
|
||||
<button
|
||||
id="close-search-button"
|
||||
class="flex items-center justify-center w2 h2 text-neutral-700 hover:text-primary-600 dark:text-neutral dark:hover:text-primary-400"
|
||||
title="{{ i18n "search.close_button_title" }}"
|
||||
> ❌️
|
||||
{{/* partial "icon.html" "xmark" */}}
|
||||
</button>
|
||||
</header>
|
||||
<section class="flex-auto px-2 overflow-auto" tabindex="-1">
|
||||
<ul id="search-results" class="pa0 ph2">
|
||||
</ul>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/site-search.js"></script>
|
|
@ -0,0 +1,56 @@
|
|||
(function(){
|
||||
// TODO investigate/fix strange screen flash when navigating back from an hash URL
|
||||
// TODO error handling, caching, loading indication, totally handle hash change
|
||||
|
||||
var oldUrl = null;
|
||||
var firstLoad = true;
|
||||
window.SiteInitOnLoad = [];
|
||||
|
||||
function initPage () {
|
||||
oldUrl = location.href;
|
||||
document.body.scrollIntoView();
|
||||
Array.from(document.querySelectorAll('a')).forEach(function(anchorEl){
|
||||
var isInternalLink = anchorEl.href.startsWith(location.protocol + '//' + location.host);
|
||||
var isPagewideLink = (anchorEl.href.split('#')[0] === location.href.split('#')[0]);
|
||||
if (isInternalLink && !isPagewideLink) {
|
||||
anchorEl.onclick = (function(clickEvent){
|
||||
clickEvent.preventDefault();
|
||||
loadContent(anchorEl.href, true);
|
||||
});
|
||||
}
|
||||
});
|
||||
if (!firstLoad) {
|
||||
SiteInitOnLoad.forEach(function(routine){ routine(); });
|
||||
}
|
||||
firstLoad = false;
|
||||
}
|
||||
|
||||
function loadContent (url, push) {
|
||||
var fallbackTimeout = setTimeout((function(){ location.href = url; }), 3e3);
|
||||
fetch(url)
|
||||
.then(function(request){ return request.text(); })
|
||||
.then(function(html){
|
||||
var domNew = (new DOMParser).parseFromString(html, 'text/html');
|
||||
if (push) {
|
||||
history.pushState(null, null, url);
|
||||
}
|
||||
document.head.innerHTML = domNew.head.innerHTML;
|
||||
document.body.innerHTML = domNew.body.innerHTML;
|
||||
initPage();
|
||||
clearTimeout(fallbackTimeout);
|
||||
}).catch(function(err){
|
||||
console.error(err);
|
||||
location.href = url;
|
||||
});
|
||||
}
|
||||
|
||||
window.addEventListener('load', initPage);
|
||||
|
||||
window.addEventListener('popstate', (stateEvent) => {
|
||||
if (location.href.split('#')[0] !== oldUrl.split('#')[0]) {
|
||||
loadContent(location.href, false);
|
||||
}
|
||||
oldUrl = location.href;
|
||||
});
|
||||
|
||||
})();
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,183 @@
|
|||
(function(){
|
||||
|
||||
function init () {
|
||||
|
||||
var fuse;
|
||||
var hideButton = document.getElementById("close-search-button");
|
||||
var wrapper = document.getElementById("search-wrapper");
|
||||
var modal = document.getElementById("search-modal");
|
||||
var input = document.getElementById("search-query");
|
||||
var output = document.getElementById("search-results");
|
||||
var first = output.firstChild;
|
||||
var last = output.lastChild;
|
||||
var searchVisible = false;
|
||||
var indexed = false;
|
||||
var hasResults = false;
|
||||
|
||||
hideButton.addEventListener("click", hideSearch);
|
||||
wrapper.addEventListener("click", hideSearch);
|
||||
modal.addEventListener("click", function (event) {
|
||||
event.stopPropagation();
|
||||
event.stopImmediatePropagation();
|
||||
return false;
|
||||
});
|
||||
document.addEventListener("keydown", function (event) {
|
||||
if (event.key == "/") {
|
||||
if (!searchVisible) {
|
||||
event.preventDefault();
|
||||
displaySearch();
|
||||
} else {
|
||||
input.focus();
|
||||
}
|
||||
}
|
||||
|
||||
if (event.key == "Escape") {
|
||||
hideSearch();
|
||||
}
|
||||
|
||||
if (event.key == "ArrowDown") {
|
||||
if (searchVisible && hasResults) {
|
||||
event.preventDefault();
|
||||
if (document.activeElement == input) {
|
||||
first.focus();
|
||||
} else if (document.activeElement == last) {
|
||||
last.focus();
|
||||
} else {
|
||||
document.activeElement.parentElement.nextSibling.firstElementChild.focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event.key == "ArrowUp") {
|
||||
if (searchVisible && hasResults) {
|
||||
event.preventDefault();
|
||||
if (document.activeElement == input) {
|
||||
input.focus();
|
||||
} else if (document.activeElement == first) {
|
||||
input.focus();
|
||||
} else {
|
||||
document.activeElement.parentElement.previousSibling.firstElementChild.focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Enter to get to results
|
||||
if (event.key == "Enter") {
|
||||
if (searchVisible && hasResults) {
|
||||
event.preventDefault();
|
||||
if (document.activeElement == input) {
|
||||
first.focus();
|
||||
} else {
|
||||
document.activeElement.click();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// Update search on each keypress
|
||||
input.onkeyup = function (event) {
|
||||
executeQuery(this.value);
|
||||
};
|
||||
|
||||
function displaySearch() {
|
||||
if (!indexed) {
|
||||
buildIndex();
|
||||
}
|
||||
if (!searchVisible) {
|
||||
document.body.style.overflow = "hidden";
|
||||
wrapper.style.visibility = "visible";
|
||||
input.focus();
|
||||
searchVisible = true;
|
||||
}
|
||||
input.value = document.querySelector('.SiteSearchForm > input').value;
|
||||
}
|
||||
|
||||
function hideSearch() {
|
||||
if (searchVisible) {
|
||||
document.body.style.overflow = "visible";
|
||||
wrapper.style.visibility = "hidden";
|
||||
input.value = "";
|
||||
document.querySelector('.SiteSearchForm > input').value = "";
|
||||
output.innerHTML = "";
|
||||
document.activeElement.blur();
|
||||
searchVisible = false;
|
||||
}
|
||||
}
|
||||
|
||||
function buildIndex() {
|
||||
var options = {
|
||||
shouldSort: true,
|
||||
ignoreLocation: true,
|
||||
threshold: 0.0,
|
||||
includeMatches: true,
|
||||
keys: [
|
||||
{ name: "title", weight: 0.8 },
|
||||
{ name: "section", weight: 0.2 },
|
||||
{ name: "summary", weight: 0.6 },
|
||||
{ name: "content", weight: 0.4 },
|
||||
],
|
||||
};
|
||||
fuse = new Fuse(SiteSearchIndex, options);
|
||||
indexed = true;
|
||||
}
|
||||
|
||||
function executeQuery(term) {
|
||||
let results = fuse.search(term);
|
||||
let resultsHTML = "";
|
||||
|
||||
if (results.length > 0) {
|
||||
results.forEach(function (value, key) {
|
||||
var title = value.item.externalUrl? value.item.title + '<span class="text-xs ml-2 align-center cursor-default text-neutral-400 dark:text-neutral-500">'+value.item.externalUrl+'</span>' : value.item.title;
|
||||
var linkconfig = value.item.externalUrl? 'target="_blank" rel="noopener" href="'+value.item.externalUrl+'"' : 'href="'+value.item.permalink+'"';
|
||||
resultsHTML =
|
||||
resultsHTML +
|
||||
`<li class="mb-2">
|
||||
<a class="flex items-center ma3 no-underline px-3 py-2 mid-gray rounded-md appearance-none bg-neutral-100 dark:bg-neutral-700 focus:bg-primary-100 hover:bg-primary-100 dark:hover:bg-primary-900 dark:focus:bg-primary-900 focus:outline-dotted focus:outline-transparent focus:outline-2"
|
||||
${linkconfig} tabindex="0">
|
||||
<div class="grow">
|
||||
<div class="-mb-1 text-lg fw7 f4 font-bold">
|
||||
${title}
|
||||
</div>
|
||||
<div class="text-sm fw3 text-neutral-500 dark:text-neutral-400">${value.item.section}<span class="px-2 text-primary-500">·</span>${value.item.date? value.item.date : ""}</span></div>
|
||||
<div class="text-sm italic">${value.item.summary}</div>
|
||||
</div>
|
||||
<div class="ml-2 ltr:block rtl:hidden text-neutral-500">→</div>
|
||||
<!--<div class="mr-2 ltr:hidden rtl:block text-neutral-500">←</div>-->
|
||||
</a>
|
||||
</li>`;
|
||||
});
|
||||
hasResults = true;
|
||||
} else {
|
||||
resultsHTML = "";
|
||||
hasResults = false;
|
||||
}
|
||||
|
||||
output.innerHTML = resultsHTML;
|
||||
if (results.length > 0) {
|
||||
first = output.firstChild.firstElementChild;
|
||||
last = output.lastChild.firstElementChild;
|
||||
}
|
||||
}
|
||||
|
||||
var inputText = document.querySelector('.SiteSearchForm > form > div > input[type="submit"]').value.split(' ')[0];
|
||||
document.querySelector('.SiteSearchForm > form > div').remove();
|
||||
document.querySelector('.SiteSearchForm').innerHTML = document.querySelector('.SiteSearchForm > form > input').outerHTML; //+ '<kbd class="gray absolute bottom-0 right-1" style="pointer-events:none; user-select:none;">CTRL+/</kbd>');
|
||||
|
||||
var inputEl = document.querySelector('.SiteSearchForm > input');
|
||||
//inputEl.classList.add('bg-transparent', 'white');
|
||||
inputEl.placeholder = (inputText + '... 🔎️ [CTRL+/]');
|
||||
inputEl.onclick = inputEl.oninput = inputEl.onchange = inputEl.onpaste = displaySearch;
|
||||
inputEl.onkeydown = (function(event){
|
||||
if (event.key == "Enter") {
|
||||
event.preventDefault();
|
||||
displaySearch();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
init();
|
||||
window.SiteInitOnLoad.push(init);
|
||||
|
||||
})();
|
|
@ -57,12 +57,13 @@
|
|||
{{ block "head" . }}{{ partial "head-additions.html" . }}{{ end }}
|
||||
</head>
|
||||
|
||||
<body class="ma0 {{ $.Param "body_classes" | default "avenir bg-near-white"}}{{ with getenv "HUGO_ENV" }} {{ . }}{{ end }}" style="overflow-wrap: break-word; background-color: #fdf4ff;">
|
||||
|
||||
<body class="ma0 {{ $.Param "body_classes" | default "avenir bg-near-white"}}{{ with getenv "HUGO_ENV" }} {{ . }}{{ end }}" style="overflow-wrap: break-word; background-color: #fdf4ff; overflow-x: hidden;">
|
||||
<!--<div style="width: 100%;" class="fixed b--dark-pink b--solid bw1"></div>-->
|
||||
{{ block "header" . }}{{ partial "site-header.html" .}}{{ end }}
|
||||
<main class="pb7" role="main">
|
||||
{{ block "main" . }}{{ end }}
|
||||
</main>
|
||||
{{ block "footer" . }}{{ partialCached "site-footer.html" . }}{{ end }}
|
||||
{{ partial "search-applet.html" . }}
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{ $featured_image := partial "func/GetFeaturedImage.html" . }}
|
||||
{{ if $featured_image }}
|
||||
{{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}}
|
||||
<header class="cover bg-top" style="background-image: url('{{ $featured_image }}');">
|
||||
<header id="!/header" class="cover bg-top" style="background-image: url('{{ $featured_image }}');">
|
||||
<div class="bg-black-60">
|
||||
{{ partial "site-navigation.html" . }}
|
||||
<div class="tc-l pv6 ph3 ph4-ns">
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<footer class="{{ .Site.Params.background_color_class | default "bg-black" }} bottom-0 w-100 pa3" role="contentinfo" style="background-color: #330066;">
|
||||
<a href="#!/header" class="fixed bg-dark-gray pa3 br-100 bottom-1 right-1" style="background-color:#707;">⬆️</a>
|
||||
<div class="flex justify-between">
|
||||
<a class="fw4 hover-white no-underline white-80 dib-ns pv2 ph3" href="{{ .Site.Home.Permalink }}" >
|
||||
© {{ with .Site.Copyright | default .Site.Title }} {{ . | safeHTML }} 2022–{{ now.Format "2006" }} {{ end }}
|
||||
|
@ -6,5 +7,5 @@
|
|||
<div>{{ partial "social-follow.html" . }}</div>
|
||||
</div>
|
||||
<span class="white-80 f6">❤️ Copying is an act of love. <a>Please copy and share</a>.</span>
|
||||
<div class="white pv3 tc">{{ partial "footer-buttons.html" }}</div>
|
||||
<div class="white pv3 tc">{{ partial "footer-buttons.html" . }}</div>
|
||||
</footer>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{ $featured_image := partial "func/GetFeaturedImage.html" . }}
|
||||
{{ if $featured_image }}
|
||||
{{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}}
|
||||
<header class="cover bg-top" style="background-image: url('{{ $featured_image }}');">
|
||||
<header id="!/header" class="cover bg-top" style="background-image: url('{{ $featured_image }}');">
|
||||
<div class="{{ .Site.Params.cover_dimming_class | default "bg-black-60" }}">
|
||||
{{ partial "site-navigation.html" .}}
|
||||
<div class="tc-l pv4 pv6-l ph3 ph4-ns">
|
||||
|
@ -17,7 +17,7 @@
|
|||
</div>
|
||||
</header>
|
||||
{{ else }}
|
||||
<header>
|
||||
<header id="!/header">
|
||||
<div class="pb3-m pb6-l {{ .Site.Params.background_color_class | default "bg-black" }}" style="background-color: #330066;">
|
||||
{{ partial "site-navigation.html" . }}
|
||||
<div class="tc-l pv3 ph3 ph4-ns">
|
||||
|
|
|
@ -1,12 +1,23 @@
|
|||
<nav class="pv3 ph3 ph4-ns" role="navigation">
|
||||
<div class="flex-l justify-between items-center center">
|
||||
<a href="{{ .Site.Home.RelPermalink }}" class="f3 fw2 hover-white no-underline white-90 dib">
|
||||
<a href="{{ .Site.Home.RelPermalink }}" class="f3 fw2 mr3 hover-white no-underline white-90 dib">
|
||||
{{ with .Site.Params.site_logo }}
|
||||
<img src="{{ relURL . }}" class="w100 mw5-ns" alt="{{ $.Site.Title }}" />
|
||||
{{ else }}
|
||||
{{ .Site.Title }}
|
||||
{{ end }}
|
||||
</a>
|
||||
<div class="SiteSearchForm di nowrap relative">
|
||||
<form class="di" action="https://hlb0.octt.eu.org/Redirector.php">
|
||||
<input class="mw5 mt2 bg-transparent moon-gray ba b--solid b--moon-gray"
|
||||
type="text" name="_query[]" required="required" placeholder="{{ i18n "searchNoJs" }}... 🔎️" />
|
||||
<div class="di">
|
||||
<input type="hidden" name="url" value="https://yacy.spacc.eu.org/yacysearch.html">
|
||||
<input type="hidden" name="_query[]" value="site:sitoctt.octt.eu.org" />
|
||||
<input class="bg-transparent moon-gray ba b--solid b--moon-gray" type="submit" value="{{ i18n "search" }} 🔎️" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="flex-l items-center">
|
||||
{{ partial "i18nlist.html" . }}
|
||||
{{ if .Site.Menus.main }}
|
||||
|
|
|
@ -1 +1,4 @@
|
|||
<!--<script src="/ajax-navigation.js"></script>-->
|
||||
<script src="/local-file-tweaks.js"></script>
|
||||
<script src="/{{ .Lang }}/searchindex.js"></script>
|
||||
<script src="/lib/fuse.min.js"></script>
|
||||
|
|
Loading…
Reference in New Issue