diff --git a/Makefile b/Makefile index 3c4672d..c6af19f 100644 --- a/Makefile +++ b/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) \ No newline at end of file +static: $(STATICOUT) + +$(STATICOUT): $(STATICFILES) + @mkdir -p $(dir $@) + @cp -v $< $@ \ No newline at end of file diff --git a/README.txt b/README.txt index 7e77eca..6931ae8 100644 --- a/README.txt +++ b/README.txt @@ -1,3 +1,9 @@ bear.oops.wtf -Redesign of https://bear.oops.wtf \ No newline at end of file +Redesign of https://bear.oops.wtf + +Requirements: + pandoc + make + uglify-js + \ No newline at end of file diff --git a/dist/android-chrome-192x192.png b/dist/android-chrome-192x192.png old mode 100755 new mode 100644 index 48b32ba..3bacb72 Binary files a/dist/android-chrome-192x192.png and b/dist/android-chrome-192x192.png differ diff --git a/dist/android-chrome-512x512.png b/dist/android-chrome-512x512.png old mode 100755 new mode 100644 index a36af9f..3bacb72 Binary files a/dist/android-chrome-512x512.png and b/dist/android-chrome-512x512.png differ diff --git a/dist/apple-touch-icon.png b/dist/apple-touch-icon.png old mode 100755 new mode 100644 index 08cc23a..3bacb72 Binary files a/dist/apple-touch-icon.png and b/dist/apple-touch-icon.png differ diff --git a/dist/blog/index.html b/dist/blog/index.html index e86b77e..adb262e 100644 --- a/dist/blog/index.html +++ b/dist/blog/index.html @@ -27,7 +27,7 @@
JavaScript must be enabled for the blog index to work. Otherwise visit blogindex.txt for a plaintext list.
- + diff --git a/dist/blogIndex.min.js b/dist/blogIndex.min.js new file mode 100644 index 0000000..4cd0105 --- /dev/null +++ b/dist/blogIndex.min.js @@ -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)})} \ No newline at end of file diff --git a/dist/favicon-16x16.png b/dist/favicon-16x16.png old mode 100755 new mode 100644 index 4f17ef9..3bacb72 Binary files a/dist/favicon-16x16.png and b/dist/favicon-16x16.png differ diff --git a/dist/favicon-32x32.png b/dist/favicon-32x32.png old mode 100755 new mode 100644 index 786433c..3bacb72 Binary files a/dist/favicon-32x32.png and b/dist/favicon-32x32.png differ diff --git a/dist/favicon.ico b/dist/favicon.ico old mode 100755 new mode 100644 index 93c107b..3bacb72 Binary files a/dist/favicon.ico and b/dist/favicon.ico differ diff --git a/dist/git/index.html b/dist/git/index.html new file mode 100644 index 0000000..4337b6a --- /dev/null +++ b/dist/git/index.html @@ -0,0 +1,31 @@ + + + + + + + You shouldn’t be here… + + + + + + +
+ +
+

BEAR.OOPS.WTF

+
+

Page created: January 26, 2024

+

Page last modified: January 26, 2024

+
+
+

This is supposed to be the location of a Gitea, the webserver + is likely misconfigured…

+

Until next time…

+
+ + diff --git a/dist/site.webmanifest b/dist/site.webmanifest index 45dc8a2..3bacb72 100644 Binary files a/dist/site.webmanifest and b/dist/site.webmanifest differ diff --git a/dist/sitemap.xml b/dist/sitemap.xml index a830bb1..5b6401b 100644 --- a/dist/sitemap.xml +++ b/dist/sitemap.xml @@ -3,4 +3,5 @@ https://bear.oops.wtf/404.html https://bear.oops.wtf/blog/index.html https://bear.oops.wtf/blog/firstPost.html +https://bear.oops.wtf/git/index.html diff --git a/dist/xertun.webp b/dist/xertun.webp old mode 100755 new mode 100644 diff --git a/dist/blogIndex.js b/js/blogIndex.js old mode 100755 new mode 100644 similarity index 100% rename from dist/blogIndex.js rename to js/blogIndex.js diff --git a/src/blog/index.md b/src/blog/index.md index 2234a57..5098886 100644 --- a/src/blog/index.md +++ b/src/blog/index.md @@ -11,5 +11,5 @@ Index of blog posts: JavaScript must be enabled for the blog index to work. Otherwise visit blogindex.txt for a plaintext list. - + \ No newline at end of file diff --git a/src/git/index.md b/src/git/index.md new file mode 100644 index 0000000..60477e6 --- /dev/null +++ b/src/git/index.md @@ -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... \ No newline at end of file diff --git a/static/blogIndex.js b/static/blogIndex.js deleted file mode 100644 index 7245c84..0000000 --- a/static/blogIndex.js +++ /dev/null @@ -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); - }); -} \ No newline at end of file