more stuff

This commit is contained in:
bearfm 2024-01-27 14:28:45 -08:00
parent 242cba10c2
commit fe26027d24
Signed by untrusted user who does not match committer: bearfm
GPG Key ID: 573A776FED58E1A4
25 changed files with 149 additions and 39 deletions

View File

@ -67,14 +67,18 @@ $(DISTDIR)/sitemap.xml: $(HTMLFILES)
done
@echo '</urlset>' >> $@
$(DISTDIR)/blogindex.txt: $(HTMLFILES)
$(DISTDIR)/blogindex.txt: $(MDFILES)
@> $@
@for f in $^; do \
uri="$(URI)$${f#$(DISTDIR)}"; \
uri="$(URI)$${f#$(SRCDIR)}"; \
if [[ "$$uri" == "$(URI)/blog/"* ]]; then \
echo "$$uri" >> $@; \
creation_date=$$(stat -c %Y $$f); \
uri=$$(echo "$$uri" | sed 's/\.md$$/.html/'); \
echo "$$creation_date $$uri" >> $@; \
fi; \
done
@sort -n -k1 -o $@ $@
.PHONY: clean
clean:
rm -rfv $(DISTDIR)/*

3
dist/404.html vendored
View File

@ -10,6 +10,7 @@
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="stylesheet" href="/css/center.css">
</head>
<body>
<header>
@ -26,7 +27,7 @@
<article class="article">
<h1 id="404-not-found">404: Not Found</h1>
<p><a
href="xertun.webp"><img src="/xertun.webp" width="200" height="200" class="error-image"/></a></p>
href="xertun.webp"><img src="/xertun.webp" width="200" height="200" /></a></p>
</article>
</body>
</html>

View File

@ -10,6 +10,7 @@
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
</head>
<body>
<header>

12
dist/blog/index.html vendored
View File

@ -10,6 +10,7 @@
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="stylesheet" href="/css/center.css">
</head>
<body>
<header>
@ -24,12 +25,17 @@
<p class="meta">Page last modified: January 26, 2024</p>
</div>
<article class="article">
<p>Index of blog posts:</p>
<p>(Sorted by date created)</p>
<div id="latestPost">
JavaScript must be enabled for the blog index to work. Otherwise visit <a href="/blogindex.txt">blogindex.txt</a> for a plaintext list.
</div>
<div id="blogIndex">
JavaScript must be enabled for the blog index to work. Otherwise visit <a href="/blogindex.txt">blogindex.txt</a> for a plaintext list.
</div>
<script type="text/javascript" src="/blogIndex.min.js"></script>
<script type="text/javascript">blogIndex();</script>
<p><a
href="blogIndex.min.js"><script type="text/javascript" src="/blogIndex.min.js"></script></a>
<a
href=""><script type="text/javascript">blogIndex();</script></a></p>
</article>
</body>
</html>

View File

@ -1 +1 @@
function blogIndex(){document.getElementById("blogIndex").innerHTML=null,fetch("/blogindex.txt").then(n=>n.text()).then(n=>{n=n.split("\n");const t=document.createElement("ul");n.forEach(n=>{var o,e,l=n.split("/").pop().replace(".html","");"index"!==l.toLowerCase()&&(o=document.createElement("li"),(e=document.createElement("a")).href=n.substring(n.indexOf("/blog/")),e.textContent=l,o.appendChild(e),t.appendChild(o))}),document.getElementById("blogIndex").appendChild(t)}).catch(n=>{console.error("Error fetching blog index:",n)})}
function convertCamelCaseToReadable(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/(\d{4}-\d{2}-\d{2})/g," $1").replace(/\b\w/g,e=>e.toUpperCase())}function blogIndex(){document.getElementById("blogIndex").innerHTML=null,document.getElementById("latestPost").innerHTML=null,fetch("/blogindex.txt").then(e=>e.text()).then(e=>{e=e.split("\n").filter(e=>""!==e.trim()).map(e=>{e=e.split(" ");return{timestamp:parseInt(e[0]),uri:e[1]||""}});e.sort((e,n)=>n.timestamp-e.timestamp);const l=document.createElement("ul");e.forEach(e=>{var n,o,t;e.uri&&(n=convertCamelCaseToReadable(o=e.uri.split("/").pop().replace(".html","")),"index"!==o.toLowerCase())&&(o=document.createElement("li"),(t=document.createElement("a")).href=e.uri.substring(e.uri.indexOf("/blog/")),t.textContent=n,o.appendChild(t),l.appendChild(o))}),document.getElementById("blogIndex").appendChild(l)}).catch(e=>{console.error("Error fetching and processing blog index:",e)})}

4
dist/blogindex.txt vendored
View File

@ -1,2 +1,2 @@
https://bear.oops.wtf/blog/index.html
https://bear.oops.wtf/blog/firstPost.html
1706393547 https://bear.oops.wtf/blog/firstPost.html
1706393752 https://bear.oops.wtf/blog/index.html

32
dist/coolLinks.html vendored Normal file
View File

@ -0,0 +1,32 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="google-site-verification" content="bjvkxJW39IrGsgIIZidzUziC9B0c5Ej0ncQX2Btyv60" />
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/css/style.css">
<title>Blog Index</title>
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
</head>
<body>
<header>
<nav>
<a href="/"><i class="material-icons">home</i> Home</a>
<a href="/blog"><i class="material-icons">book</i>Blog</a>
</nav>
</header>
<h1 class="title">BEAR.OOPS.WTF</h1>
<div class="center-box">
<p class="meta">Page created: January 26, 2024</p>
<p class="meta">Page last modified: January 26, 2024</p>
</div>
<article class="article">
<p>Pages I think are cool:</p>
<p><a href="https://cronyakatsuki.xyz/">Cronys Page</a></p>
</article>
</body>
</html>

1
dist/css/blogIndex.css vendored Normal file
View File

@ -0,0 +1 @@
.article{text-align:center}

1
dist/css/center.css vendored Normal file
View File

@ -0,0 +1 @@
.article{text-align:center}

2
dist/css/style.css vendored
View File

@ -1 +1 @@
@import "https://fonts.googleapis.com/icon?family=Material+Icons";body{font-family:Arial, sans-serif;font-size:1.5em;margin:2em;line-height:1.6;height:100vh;width:auto;margin:0;padding:0;text-align:center;background-color:#282828;color:#ebdbb2}.error-image{display:block;margin-left:auto;margin-right:auto}.meta{font-size:0.75em;line-height:1;color:#504945}.center-box{text-align:left;width:15%;margin:auto}header{background-color:#3c3836;color:#ebdbb2}header a{color:#ebdbb2;text-decoration:dotted;font-size:1.5rem}header a i{vertical-align:middle;display:inline-block}nav{background-color:#504945;color:#ebdbb2;display:flex;flex-direction:row;align-items:center;justify-content:center;gap:6px}.title{font-weight:bolder}.article{width:auto;margin:0 auto;margin-top:0%;text-align:justify;width:30vw}.article h1,.article h2,.article h3,.article h4,.article h5,.article h6{text-align:center}ul,li,ol{margin:0;padding:0;list-style:none}h1,h2,h3,h4,h5,h6{color:#fbf1c7}a{color:#458588}a:hover{color:#689d6a}button{background-color:#b16286;color:#fbf1c7}button:hover{background-color:#458588}p{margin-bottom:1em}pre{background-color:#504945;padding:0.5em;overflow:auto}code{font-family:'Courier New', Courier, monospace;background-color:#504945;color:#d65d0e;padding:0.2em;border-radius:3px}table{border-collapse:collapse;width:100%;margin-bottom:1em;border-collapse:collapse}table th,table td{border:1px solid #3c3836;padding:8px;text-align:left}th,td{border:1px solid #fbf1c7;padding:8px;text-align:left}th{background-color:#ebdbb2}blockquote{border-left:2px solid #504945;margin:1em 0;padding-left:1em}footer{background-color:#3c3836;color:#d5c4a1}
@import "https://fonts.googleapis.com/icon?family=Material+Icons";body{font-family:Arial, sans-serif;font-size:1.5em;margin:2em;line-height:1.6;height:100vh;width:auto;margin:0;padding:0;text-align:center;background-color:#282828;color:#ebdbb2}.center-image{display:block;margin-left:auto;margin-right:auto}.meta{font-size:0.75em;line-height:1;color:#504945}.center-box{text-align:left;width:15%;margin:auto}header{background-color:#3c3836;color:#ebdbb2}header a{color:#ebdbb2;text-decoration:dotted;font-size:1.5rem}header a i{vertical-align:middle;display:inline-block}nav{background-color:#504945;color:#ebdbb2;display:flex;flex-direction:row;align-items:center;justify-content:center;gap:6px}.title{font-weight:bolder}.article{width:auto;margin:0 auto;margin-top:0%;text-align:justify;width:30vw}.article h1,.article h2,.article h3,.article h4,.article h5,.article h6{text-align:center}ul,li,ol{margin:0;padding:0;list-style:none}h1,h2,h3,h4,h5,h6{color:#fbf1c7}a{color:#458588}a:hover{color:#689d6a}button{background-color:#b16286;color:#fbf1c7}button:hover{background-color:#458588}p{margin-bottom:1em}pre{background-color:#504945;padding:0.5em;overflow:auto}code{font-family:'Courier New', Courier, monospace;background-color:#504945;color:#d65d0e;padding:0.2em;border-radius:3px}table{border-collapse:collapse;width:100%;margin-bottom:1em;border-collapse:collapse}table th,table td{border:1px solid #3c3836;padding:8px;text-align:left}th,td{border:1px solid #fbf1c7;padding:8px;text-align:left}th{background-color:#ebdbb2}blockquote{border-left:2px solid #504945;margin:1em 0;padding-left:1em}footer{background-color:#3c3836;color:#d5c4a1}

BIN
dist/download/88x31.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

5
dist/git/index.html vendored
View File

@ -10,6 +10,7 @@
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
</head>
<body>
<header>
@ -24,8 +25,8 @@
<p class="meta">Page last modified: January 26, 2024</p>
</div>
<article class="article">
<p>This is supposed to be the location of a Gitea, the webserver
is likely misconfigured…</p>
<p>This is supposed to be the location of a Gitea instance, the
webserver is likely misconfigured…</p>
<p>Until next time…</p>
</article>
</body>

2
dist/index.html vendored
View File

@ -10,6 +10,7 @@
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="stylesheet" href="/css/center.css">
</head>
<body>
<header>
@ -27,6 +28,7 @@
<p>Hello, Im Bear.</p>
<p><a href="/coollinks">Cool Links</a></p>
<p><a href="/git">Git</a></p>
<p><a href="/blog">Blog Posts</a></p>
</article>
</body>
</html>

1
dist/sitemap.xml vendored
View File

@ -4,4 +4,5 @@
<url><loc>https://bear.oops.wtf/blog/index.html</loc></url>
<url><loc>https://bear.oops.wtf/blog/firstPost.html</loc></url>
<url><loc>https://bear.oops.wtf/git/index.html</loc></url>
<url><loc>https://bear.oops.wtf/coolLinks.html</loc></url>
</urlset>

View File

@ -1,30 +1,63 @@
function convertCamelCaseToReadable(text) {
return text
.replace(/([a-z])([A-Z])/g, '$1 $2') // Convert camelCase to separate words
.replace(/(\d{4}-\d{2}-\d{2})/g, ' $1') // Add space before date-like patterns
.replace(/\b\w/g, c => c.toUpperCase()); // Capitalize each word
}
function blogIndex() {
document.getElementById('blogIndex').innerHTML = null;
document.getElementById('latestPost').innerHTML = null;
fetch('/blogindex.txt')
.then(response => response.text())
.then(data => {
// Split the data into an array of timestamped URIs
const uriList = data.split('\n');
// Remove any empty lines
const filteredUriList = uriList.filter(entry => entry.trim() !== '');
// Create an array of objects with timestamp and URI properties
const entries = filteredUriList.map(entry => {
const parts = entry.split(' ');
return { timestamp: parseInt(parts[0]), uri: parts[1] || '' };
});
// Sort the entries by timestamp in descending order (latest first)
entries.sort((a, b) => b.timestamp - a.timestamp);
// Create an unordered list element
const ulElement = document.createElement('ul');
uriList.forEach(uri => {
const name = uri.split('/').pop().replace('.html', '');
// Iterate through the sorted entries and extract pretty names, excluding the index page
entries.forEach(entry => {
// Check if the URI is defined before processing
if (entry.uri) {
// Extract the file name without extension
const fileName = entry.uri.split('/').pop().replace('.html', '');
if (name.toLowerCase() !== 'index') {
const readableName = convertCamelCaseToReadable(fileName);
// Exclude the index page
if (fileName.toLowerCase() !== 'index') {
// Create list items with links using relative paths
const liElement = document.createElement('li');
const aElement = document.createElement('a');
aElement.href = uri.substring(uri.indexOf('/blog/'));
aElement.textContent = name;
// Use a relative link instead of the full URI
aElement.href = entry.uri.substring(entry.uri.indexOf('/blog/'));
aElement.textContent = readableName;
liElement.appendChild(aElement);
ulElement.appendChild(liElement);
}
}
});
// Append the unordered list to the blogIndex div
document.getElementById('blogIndex').appendChild(ulElement);
})
.catch(error => {
console.error('Error fetching blog index:', error);
console.error('Error fetching and processing blog index:', error);
});
}

View File

@ -3,8 +3,9 @@ title: 404 - Not Found
author: BearFM
date: January 25, 2024
modified: January 25, 2024
header: <link rel="stylesheet" href="/css/center.css">
---
# 404: Not Found
[<img src="/xertun.webp" width="200" height="200" class="error-image"/>](xertun.webp)
[<img src="/xertun.webp" width="200" height="200" />](xertun.webp)

View File

@ -3,6 +3,7 @@ title: First Post
author: BearFM
date: January 26, 2024
modified: January 26, 2024
header:
---
wowzers first post

View File

@ -3,13 +3,19 @@ title: Blog Index
author: BearFM
date: January 26, 2024
modified: January 26, 2024
header: <link rel="stylesheet" href="/css/center.css">
---
Index of blog posts:
(Sorted by date created)
<div id="latestPost">
JavaScript must be enabled for the blog index to work. Otherwise visit <a href="/blogindex.txt">blogindex.txt</a> for a plaintext list.
</div>
<div id="blogIndex">
JavaScript must be enabled for the blog index to work. Otherwise visit <a href="/blogindex.txt">blogindex.txt</a> for a plaintext list.
</div>
<script type="text/javascript" src="/blogIndex.min.js"></script>
<script type="text/javascript">blogIndex();</script>
[<script type="text/javascript" src="/blogIndex.min.js"></script>](blogIndex.min.js)
[<script type="text/javascript">blogIndex();</script>]()

11
src/coolLinks.md Normal file
View File

@ -0,0 +1,11 @@
---
title: Blog Index
author: BearFM
date: January 26, 2024
modified: January 26, 2024
header:
---
Pages I think are cool:
[Crony's Page](https://cronyakatsuki.xyz/)

View File

@ -3,8 +3,9 @@ title: You shouldn't be here...
author: BearFM
date: January 26, 2024
modified: January 26, 2024
header:
---
This is supposed to be the location of a Gitea, the webserver is likely misconfigured...
This is supposed to be the location of a Gitea instance, the webserver is likely misconfigured...
Until next time...

View File

@ -3,6 +3,7 @@ title: bear.oops.wtf
author: BearFM
date: January 6, 2024
modified: January 25, 2024
header: <link rel="stylesheet" href="/css/center.css">
---
Hello, I'm Bear.
@ -10,3 +11,5 @@ Hello, I'm Bear.
[Cool Links](/coollinks)
[Git](/git)
[Blog Posts](/blog)

3
src/scss/center.scss Normal file
View File

@ -0,0 +1,3 @@
.article {
text-align: center;
}

View File

@ -50,7 +50,7 @@ body {
color: $gruvbox-fg;
}
.error-image {
.center-image {
display: block;
margin-left: auto;
margin-right: auto;

View File

@ -10,6 +10,7 @@
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
$header$
</head>
<body>
<header>

BIN
static/download/88x31.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB