123
25
Makefile
|
@ -4,6 +4,7 @@ STATICDIR = static
|
|||
CSSDIR = $(DISTDIR)/css
|
||||
SCSSDIR = $(SRCDIR)/scss
|
||||
SCSSINCDIR = $(SCSSDIR)/includes
|
||||
JSDIR = js
|
||||
|
||||
SCSSFILES = $(wildcard $(SCSSDIR)/*.scss)
|
||||
CSSFILES = $(patsubst $(SCSSDIR)/%.scss, $(CSSDIR)/%.css, $(SCSSFILES))
|
||||
|
@ -11,12 +12,17 @@ CSSFILES = $(patsubst $(SCSSDIR)/%.scss, $(CSSDIR)/%.css, $(SCSSFILES))
|
|||
MDFILES = $(shell find $(SRCDIR) -type f -name '*.md')
|
||||
HTMLFILES = $(patsubst $(SRCDIR)/%.md, $(DISTDIR)/%.html, $(MDFILES))
|
||||
TMPL = $(SRCDIR)/tmpl.html
|
||||
|
||||
STATICFILES = $(shell find $(STATICDIR) -type f -name '*')
|
||||
STATICOUT = $(patsubst $(STATICDIR)/%, $(DISTDIR)/%, $(STATICFILES))
|
||||
|
||||
JSFILES = $(shell find $(JSDIR) -type f -name '*.js')
|
||||
MINIFIEDFILES := $(patsubst $(JSDIR)/%.js, $(DISTDIR)/%.min.js, $(JSFILES))
|
||||
|
||||
URI = "https://bear.oops.wtf"
|
||||
|
||||
.PHONY: all
|
||||
all: html css $(DISTDIR)/robots.txt $(DISTDIR)/sitemap.xml $(DISTDIR)/blogindex.txt static
|
||||
all: html css $(DISTDIR)/robots.txt $(DISTDIR)/sitemap.xml $(DISTDIR)/blogindex.txt static js
|
||||
|
||||
# Build
|
||||
|
||||
|
@ -27,12 +33,19 @@ html: $(HTMLFILES)
|
|||
# pandoc --from markdown --to html --standalone $< -o $@
|
||||
|
||||
$(DISTDIR)/%.html: $(SRCDIR)/%.md $(TMPL)
|
||||
@mkdir -pv $(dir $@)
|
||||
pandoc \
|
||||
--from markdown_github+smart+yaml_metadata_block+auto_identifiers \
|
||||
--to html \
|
||||
--template $(TMPL) \
|
||||
-o $@ $<
|
||||
|
||||
.PHONY: js
|
||||
js: $(MINIFIEDFILES)
|
||||
|
||||
$(DISTDIR)/%.min.js: $(JSDIR)/%.js
|
||||
uglifyjs $< -m -c --mangle-props -o $@
|
||||
|
||||
.PHONY: css
|
||||
css: $(CSSFILES)
|
||||
|
||||
|
@ -64,8 +77,7 @@ $(DISTDIR)/blogindex.txt: $(HTMLFILES)
|
|||
done
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -v $(HTMLFILES)
|
||||
rm -rfv $(CSSDIR)
|
||||
rm -rfv $(DISTDIR)/*
|
||||
|
||||
.PHONY: help
|
||||
help:
|
||||
|
@ -73,5 +85,8 @@ help:
|
|||
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[34m%-15s\033[0m %s\n", $$1, $$2}'
|
||||
|
||||
.PHONY: static
|
||||
static: $(STATICFILES)
|
||||
@cp -r $(STATICFILES) $(DISTDIR)
|
||||
static: $(STATICOUT)
|
||||
|
||||
$(STATICOUT): $(STATICFILES)
|
||||
@mkdir -p $(dir $@)
|
||||
@cp -v $< $@
|
|
@ -1,3 +1,9 @@
|
|||
bear.oops.wtf
|
||||
|
||||
Redesign of https://bear.oops.wtf
|
||||
Redesign of https://bear.oops.wtf
|
||||
|
||||
Requirements:
|
||||
pandoc
|
||||
make
|
||||
uglify-js
|
||||
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 238 KiB After Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 9.7 KiB |
|
@ -27,7 +27,7 @@
|
|||
<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.js"></script>
|
||||
<script type="text/javascript" src="/blogIndex.min.js"></script>
|
||||
<script type="text/javascript">blogIndex();</script>
|
||||
</article>
|
||||
</body>
|
||||
|
|
|
@ -0,0 +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)})}
|
Before Width: | Height: | Size: 875 B After Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 9.7 KiB |
|
@ -0,0 +1,31 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="/css/style.css">
|
||||
<title>You shouldn’t be here…</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>This is supposed to be the location of a Gitea, the webserver
|
||||
is likely misconfigured…</p>
|
||||
<p>Until next time…</p>
|
||||
</article>
|
||||
</body>
|
||||
</html>
|
Before Width: | Height: | Size: 263 B After Width: | Height: | Size: 9.7 KiB |
|
@ -3,4 +3,5 @@
|
|||
<url><loc>https://bear.oops.wtf/404.html</loc></url>
|
||||
<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>
|
||||
</urlset>
|
||||
|
|
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 9.7 KiB |
|
@ -11,5 +11,5 @@ Index of blog posts:
|
|||
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.js"></script>
|
||||
<script type="text/javascript" src="/blogIndex.min.js"></script>
|
||||
<script type="text/javascript">blogIndex();</script>
|
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
title: You shouldn't be here...
|
||||
author: BearFM
|
||||
date: January 26, 2024
|
||||
modified: January 26, 2024
|
||||
---
|
||||
|
||||
This is supposed to be the location of a Gitea, the webserver is likely misconfigured...
|
||||
|
||||
Until next time...
|
|
@ -1,30 +0,0 @@
|
|||
function blogIndex() {
|
||||
document.getElementById('blogIndex').innerHTML = null;
|
||||
|
||||
fetch('/blogindex.txt')
|
||||
|
||||
.then(response => response.text())
|
||||
.then(data => {
|
||||
const uriList = data.split('\n');
|
||||
const ulElement = document.createElement('ul');
|
||||
|
||||
uriList.forEach(uri => {
|
||||
const name = uri.split('/').pop().replace('.html', '');
|
||||
|
||||
if (name.toLowerCase() !== 'index') {
|
||||
const liElement = document.createElement('li');
|
||||
const aElement = document.createElement('a');
|
||||
|
||||
aElement.href = uri.substring(uri.indexOf('/blog/'));
|
||||
aElement.textContent = name;
|
||||
liElement.appendChild(aElement);
|
||||
ulElement.appendChild(liElement);
|
||||
}
|
||||
});
|
||||
|
||||
document.getElementById('blogIndex').appendChild(ulElement);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error fetching blog index:', error);
|
||||
});
|
||||
}
|