hugo-owu-se : very big commit

This commit is contained in:
minoplhy 2024-03-12 16:12:11 +07:00
parent 92fb79c4ef
commit 35eb738272
Signed by: minoplhy
GPG Key ID: 41D406044E2434BF
31 changed files with 131 additions and 86 deletions

7
.gitignore vendored Normal file
View File

@ -0,0 +1,7 @@
### Hugo ###
# Generated files by hugo
/public/
/resources/_gen/
/assets/jsconfig.json
hugo_stats.json
/.hugo_build.lock

View File

@ -2,3 +2,24 @@
text-decoration: none;
color:rgb(214, 124, 40);
}
.image-auto-border {
border: 5px dashed #3ffcc0;
}
.image-resize-contain {
object-fit: contain;
aspect-ratio: 2/1;
width: 125%;
}
.image-resize-fill {
width: 55%;
height: 50%;
aspect-ratio: 1;
object-fit: fill;
}
.hide-display {
display: none;
}

View File

@ -1,42 +1,16 @@
// This file is dynamically generated from pre-build script. Proceed with cautions when manually edit something!
let imgArray = [
"10.avif",
"11.avif",
"12.avif",
"13.avif",
"14.avif",
"15.avif",
"16.avif",
"17.avif",
"18.avif",
"19.avif",
"1.avif",
"20.avif",
"21.avif",
"22.avif",
"23.avif",
"24.avif",
"25.avif",
"26.avif",
"27.avif",
"28.avif",
"29.avif",
"2.avif",
"30.avif",
"31.avif",
"32.avif",
"33.avif",
"34.avif",
"35.avif",
"36.avif",
"37.avif",
"38.avif",
"39.avif",
"3.avif",
"40.avif",
"4.avif",
"5.avif",
"6.avif",
"7.avif",
"8.avif",
"9.avif",
"tamako-1.avif",
"tamako-2.avif",
"yurucamp-10.avif",
"yurucamp-11.avif",
"yurucamp-1.avif",
"yurucamp-2.avif",
"yurucamp-3.avif",
"yurucamp-4.avif",
"yurucamp-5.avif",
"yurucamp-6.avif",
"yurucamp-7.avif",
"yurucamp-8.avif",
"yurucamp-9.avif",
];

View File

@ -1,19 +0,0 @@
function randomImageBroker(ElemName, imgArray) {
const imgEl = document.getElementById(ElemName);
randomImage(imgEl, imgArray)
}
function randomImage(imgELM, srcArray) {
const randomIndex = Math.floor(Math.random()*srcArray.length);
imgELM.src = srcArray[randomIndex];
}
base_path = "/images/weebos_avif/";
//file_extension = ".avif"
// Create a new array to store the modified strings
imgArray = imgArray.map(img_path => base_path + img_path);
//console.log(imgArray)
document.onload = randomImageBroker('homepage-rand-img', imgArray);

33
assets/js/randomize.js Normal file
View File

@ -0,0 +1,33 @@
function randomImageBroker(ElemName, imgArray) {
const imgELM = document.getElementById(ElemName);
const randomIndex = mathRandom(imgELM, imgArray);
imgELM.src = imgArray[randomIndex];
}
function randomTextBroker(ElemName, textArray) {
const textElm = document.getElementById(ElemName);
const randomIndex = mathRandom(textElm, textArray);
textElm.innerHTML = textArray[randomIndex]
}
function mathRandom(imgELM, srcArray) {
return Math.floor(Math.random()*srcArray.length);
}
base_path = "/images/weebos_avif/";
//file_extension = ".avif"
// Create a new array to store the modified strings
imgArray = imgArray.map(img_path => base_path + img_path);
//console.log(imgArray)
// Set image display
var img = document.getElementById("random-img");
img.style.display = "block";
// text randomized
//document.getElementById("p1").innerHTML = "New tererxt!";
document.onload = randomImageBroker('random-img', imgArray);
randomTextBroker('random-text', text_array)

9
assets/js/text-array.js Normal file
View File

@ -0,0 +1,9 @@
let text_array = [
"( -_・) ︻デ═一 ▸ Some random weeby images ( ^◡^)",
"( ^◡^)っ ♡ ( ^◡^)っ ♡( ^◡^)っ ♡( ^◡^)っ ♡",
"ϞϞ(๑⚈ ․̫ ⚈๑)∩",
"(╯°□°)╯︵◓",
"=✪ ᆺ ✪= Sadly, I'm out of ideas =✪ ᆺ ✪=",
"(⊙‿⊙) Hello Strangers (⊙‿⊙)",
"● ● ● ●"
]

View File

@ -6,9 +6,21 @@ title = "Homepage (✿◠‿◠)"
+++
{{< rawhtml >}}
<center>
<figure>
<img src="elephant.jpg" id="homepage-rand-img">
<noscript>
<img src="/images/weebos_avif/yurucamp-4.avif" class="image-resize-contain image-auto-border">
</noscript>
<!-- Regardless of display type(even if it none). It will be set to block in script execution for "homepage-rand-img" id -->
<img id="random-img" class="hide-display image-resize-contain image-auto-border">
<h5><figcaption id="random-text" >( -_・) ︻デ═一 ▸ Some random weeby images ( ^◡^)</figcaption></h5>
</figure>
<center>
{{< /rawhtml >}}
{{< rawhtml >}}
<center>
{{< /rawhtml >}}
[Where to find me?]({{% ref "/findme" %}})
{{< rawhtml >}}
</center>
{{< /rawhtml >}}

View File

@ -1,7 +1,7 @@
+++
title = "Back to Self Hosting"
date = 2022-03-30T12:00:00+00:00
slug = "Back-to-Self-Hosting"
tags = ["blog",]
+++

View File

@ -2,6 +2,7 @@
title = "Crappy's Blog but this is Jekyll"
date = 2021-06-07T12:00:00+00:00
lastmod = 2024-03-09T06:43:04+00:00
slug = "Crappy-blog-again"
tags = ["blog",]
+++

View File

@ -2,6 +2,7 @@
title = "Crappy's Blog but moved from Cloudflare"
date = 2021-12-25T12:00:00+00:00
lastmod = 2022-02-12T12:00:00+00:00
slug = "Moved-from-cloudflare"
tags = ["blog",]
+++

View File

@ -1,6 +1,7 @@
+++
title = "Transition: new year, new domain, new Jekyll site, new servers, and 15.99 for gtld"
date = 2023-06-09T12:00:00+00:00
slug = "big-migration-2023"
tags = ["blog",]
+++

View File

@ -1,6 +1,7 @@
+++
title = "Crappy's v4(or 3?) a new Project in a while"
date = 2022-09-19T12:00:00+00:00
slug = "v4-crappy"
tags = ["blog",]
+++

View File

@ -25,4 +25,7 @@ PGP Key -> `923DFF2B99B75D731C55BF7490667A59A9908AEC`
<pre>
<a href="/assets/misc/hej_pgp.txt">Here</a>, <a href="https://keys.openpgp.org/vks/v1/by-fingerprint/923DFF2B99B75D731C55BF7490667A59A9908AEC">openpgp</a>
</pre>
<br>
{{< /rawhtml >}}
##### on : [GitHub](https://github.com/minoplhy), [owu.se/p-p](https://owu.se/p-p/explore/repos), [Framagit](https://framagit.org/meeillo), [Codeberg](https://codeberg.org/DoulpaGllo)

10
layouts/404.html Normal file
View File

@ -0,0 +1,10 @@
{{ define "title" }}404 Page not found | {{ .Site.Title }}{{ end }}
{{ define "main" }}
<figure>
<center>
<img src="/images/yuru-camp△-404.avif" class="image-resize-fill image-auto-border">
</center>
</figure>
<center><h3>404┻━┻︵ヽ(`Д´)ノ︵ ┻━┻404</h3></center>
{{ end }}

View File

@ -1,24 +1,13 @@
{{- /* Special CSS */}}
{{- $specials_css := (resources.Get "css/specials.css") | resources.Minify }}
{{- if not site.Params.assets.disableFingerprinting }}
{{- $specials_css := $specials_css | fingerprint }}
<link crossorigin="anonymous" href="{{ $specials_css.RelPermalink }}" integrity="{{ $specials_css.Data.Integrity }}" rel="preload stylesheet" as="style">
{{ else }}
<link crossorigin="anonymous" href="{{ $specials_css.RelPermalink }}" rel="preload stylesheet" as="style">
{{ end }}
{{ if (.Eq (site.GetPage "/")) }}
{{- $image_random := (resources.Get "js/image-randomize.js") | resources.Minify }}
{{- $image_array := (resources.Get "js/image-array.js") | resources.Minify }}
{{- $randomize := (resources.Get "js/randomize.js" ) }}
{{- $image_array := (resources.Get "js/image-array.js" ) }}
{{- $text_array := (resources.Get "js/text-array.js" )}}
{{- $randomize_combined := slice $image_array $text_array $randomize | resources.Concat "js/random.js" | resources.Minify }}
{{- if not site.Params.assets.disableFingerprinting }}
{{- $image_random := $image_random | fingerprint }}
{{- $image_array := $image_array | fingerprint }}
<script async crossorigin="anonymous" src="{{ $image_array.RelPermalink }}" integrity="{{ $image_array.Data.Integrity }}"></script>
<script defer crossorigin="anonymous" src="{{ $image_random.RelPermalink }}" integrity="{{ $image_random.Data.Integrity }}"></script>
{{- $randomize_combined := $randomize_combined | fingerprint }}
<script async crossorigin="anonymous" src="{{ $randomize_combined.RelPermalink }}" integrity="{{ $randomize_combined.Data.Integrity }}"></script>
{{ else }}
<script async crossorigin="anonymous" src="{{ $image_array.RelPermalink }}"></script>
<script defer crossorigin="anonymous" src="{{ $image_random.RelPermalink }}"></script>
<script async crossorigin="anonymous" src="{{ $randomize_combined.RelPermalink }}"></script>
{{ end }}
{{ end }}

View File

@ -5,7 +5,9 @@ files=($(ls static/images/weebos_avif))
# Generate JavaScript code with the array
cat /dev/null > assets/js/image-array.js
echo 'let imgArray = [' >> assets/js/image-array.js
echo '// This file is dynamically generated from pre-build script. Proceed with cautions when manually edit something!
let imgArray = [' >> assets/js/image-array.js
# Iterate through the file names and add them to the JavaScript array
for file in "${files[@]}"; do

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -1 +1 @@
Subproject commit d734281a6ae3771e4e7e54bd48c98160ec99c5b8
Subproject commit 134c3a0015d08c009ef3c59aaa65fba5bb2162e5