moved the blog to its own directory
All checks were successful
Web/pipeline/head This commit looks good

This commit is contained in:
Ell 2021-03-11 03:21:23 +01:00
parent 2be60f2c6d
commit 23eea1d559
48 changed files with 46 additions and 32 deletions

2
.gitignore vendored
View file

@ -3,4 +3,4 @@ sitemap.xml
feed.json feed.json
rss.xml rss.xml
atom.xml atom.xml
blog-*.html /blog

View file

@ -14,6 +14,7 @@ RewriteRule ^actadd/?$ "https://minecraft.curseforge.com/projects/actually-addit
RewriteRule ^projects/?$ "https://ellpeck.de/#projects" [NE,R=301,L] RewriteRule ^projects/?$ "https://ellpeck.de/#projects" [NE,R=301,L]
RewriteRule ^impressum/?$ "https://ellpeck.de/#impressum" [NE,R=301,L] RewriteRule ^impressum/?$ "https://ellpeck.de/#impressum" [NE,R=301,L]
RewriteRule ^privacy/?$ "https://ellpeck.de/#privacy" [NE,R=301,L] RewriteRule ^privacy/?$ "https://ellpeck.de/#privacy" [NE,R=301,L]
RewriteRule ^blog/?$ "https://ellpeck.de/#blog" [NE,R=301,L]
RewriteRule ^mc/?$ "https://ellpeck.de/minecraft-stuff" [R=301,L] RewriteRule ^mc/?$ "https://ellpeck.de/minecraft-stuff" [R=301,L]
RewriteRule ^minecraft-stuff/?$ "https://ellpeck.de/projects" [R=301,L] RewriteRule ^minecraft-stuff/?$ "https://ellpeck.de/projects" [R=301,L]
RewriteRule ^yt/?$ "https://www.youtube.com/c/ellpeck" [R=301,L] RewriteRule ^yt/?$ "https://www.youtube.com/c/ellpeck" [R=301,L]

View file

Before

Width:  |  Height:  |  Size: 632 KiB

After

Width:  |  Height:  |  Size: 632 KiB

View file

Before

Width:  |  Height:  |  Size: 380 KiB

After

Width:  |  Height:  |  Size: 380 KiB

View file

Before

Width:  |  Height:  |  Size: 630 KiB

After

Width:  |  Height:  |  Size: 630 KiB

View file

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View file

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 118 KiB

View file

Before

Width:  |  Height:  |  Size: 5 KiB

After

Width:  |  Height:  |  Size: 5 KiB

View file

Before

Width:  |  Height:  |  Size: 145 KiB

After

Width:  |  Height:  |  Size: 145 KiB

View file

Before

Width:  |  Height:  |  Size: 133 KiB

After

Width:  |  Height:  |  Size: 133 KiB

View file

Before

Width:  |  Height:  |  Size: 156 KiB

After

Width:  |  Height:  |  Size: 156 KiB

View file

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

View file

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

View file

Before

Width:  |  Height:  |  Size: 112 KiB

After

Width:  |  Height:  |  Size: 112 KiB

View file

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View file

Before

Width:  |  Height:  |  Size: 158 KiB

After

Width:  |  Height:  |  Size: 158 KiB

View file

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

Before

Width:  |  Height:  |  Size: 126 KiB

After

Width:  |  Height:  |  Size: 126 KiB

View file

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 81 KiB

View file

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 121 KiB

View file

Before

Width:  |  Height:  |  Size: 4.3 MiB

After

Width:  |  Height:  |  Size: 4.3 MiB

View file

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 96 KiB

View file

@ -133,7 +133,7 @@
Foe Frenzy is a game created by <a href="https://ellpeck.de">Ellpeck</a>, a student and indie game developer from Germany. It started as a small project inspired by Mario Kart and similar games, because the short-lasting battle items you can use in those games allow for fast and fun gameplay. Foe Frenzy is a game created by <a href="https://ellpeck.de">Ellpeck</a>, a student and indie game developer from Germany. It started as a small project inspired by Mario Kart and similar games, because the short-lasting battle items you can use in those games allow for fast and fun gameplay.
</p> </p>
<p> <p>
Development on the project started early in 2019, back when Foe Frenzy was still considered a small side project. Ellpeck made <a href="https://ellpeck.de/blog-small_projects">a blog post</a> about the process of Foe Frenzy's early creation in which he described how creating small projects is easier. After a while of developing the game, Ellpeck took a break from it due to lack of motivation. When he came back to it about two months later, he decided to turn Foe Frenzy into a bigger project, which included redesigning the art for the game, as well as the plan to turn it into a commercial project. Shortly after the rework, he made <a href="https://ellpeck.de/blog-big_projects">a second blog post</a> about this decision. Development on the project started early in 2019, back when Foe Frenzy was still considered a small side project. Ellpeck made <a href="https://ellpeck.de/blog/small_projects">a blog post</a> about the process of Foe Frenzy's early creation in which he described how creating small projects is easier. After a while of developing the game, Ellpeck took a break from it due to lack of motivation. When he came back to it about two months later, he decided to turn Foe Frenzy into a bigger project, which included redesigning the art for the game, as well as the plan to turn it into a commercial project. Shortly after the rework, he made <a href="https://ellpeck.de/blog/big_projects">a second blog post</a> about this decision.
</p> </p>
<p>With Foe Frenzy, Ellpeck hopes to have created a game that brings fun and banter to many friend groups' gaming meetups.</p> <p>With Foe Frenzy, Ellpeck hopes to have created a game that brings fun and banter to many friend groups' gaming meetups.</p>

View file

@ -12,8 +12,8 @@
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto">
<link rel="stylesheet" href="style/prettify.css"> <link rel="stylesheet" href="./style/prettify.css">
<link rel="stylesheet" href="style/style.css"> <link rel="stylesheet" href="./style/style.css">
<link rel="icon" href="favicon.ico"> <link rel="icon" href="favicon.ico">
<meta property="og:title" content="Ellpeck.de"> <meta property="og:title" content="Ellpeck.de">
@ -28,8 +28,8 @@
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/prettify.js"></script> <script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/prettify.js"></script>
<script src="scripts/util.js"></script> <script src="./scripts/util.js"></script>
<script src="scripts/main.js"></script> <script src="./scripts/main.js"></script>
<!-- Global site tag (gtag.js) - Google Analytics --> <!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XC0W9LJMCJ"></script> <script async src="https://www.googletagmanager.com/gtag/js?id=G-XC0W9LJMCJ"></script>
@ -48,11 +48,11 @@
<body data-spy="scroll" data-target="#navbar"> <body data-spy="scroll" data-target="#navbar">
<!-- Navbar --> <!-- Navbar -->
<nav class="navbar fixed-top navbar-expand-lg navbar-light bg-light rounded-bottom" id="navbar"> <nav class="navbar fixed-top navbar-expand-lg navbar-light bg-light rounded-bottom" id="navbar">
<script src="scripts/navbar.js"></script> <script src="./scripts/navbar.js"></script>
<!-- Navbar brand and logo --> <!-- Navbar brand and logo -->
<a class="navbar-brand mb-0 h1" href="#"> <a class="navbar-brand mb-0 h1" href="#">
<img src="res/logo.png" width="40" height="40" alt=""> Ellpeck.de <img src="./res/logo.png" width="40" height="40" alt=""> Ellpeck.de
</a> </a>
<!-- Responsive navbar menu opener --> <!-- Responsive navbar menu opener -->
@ -80,7 +80,7 @@
<!-- Content --> <!-- Content -->
<div class="container main"> <div class="container main">
<!-- Cookie notification --> <!-- Cookie notification -->
<script src="scripts/cookieinfo.js"></script> <script src="./scripts/cookieinfo.js"></script>
<div id="main"> <div id="main">
<div class="no-blog"> <div class="no-blog">
@ -89,11 +89,11 @@
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-md-auto"> <div class="col-md-auto">
<img src="res/me.png" class="rounded-circle" width="200" height="200" id="navbar-image"> <img src="./res/me.png" class="rounded-circle" width="200" height="200" id="navbar-image">
</div> </div>
<div class="col"> <div class="col">
<h1 class="display-4" id="intro-text"></h1> <h1 class="display-4" id="intro-text"></h1>
<script src="scripts/greet.js"></script> <script src="./scripts/greet.js"></script>
<p class="lead">Welcome to my little website! I'm Ellpeck, a student and programmer from Germany. I do a lot of stuff, actually. My life is pretty busy.</p> <p class="lead">Welcome to my little website! I'm Ellpeck, a student and programmer from Germany. I do a lot of stuff, actually. My life is pretty busy.</p>
<!-- Sponsor buttons --> <!-- Sponsor buttons -->
@ -117,7 +117,7 @@
<div id="project-list"> <div id="project-list">
<em>The content that should be here is dynamically generated. Please enable JavaScript if you see this.</em> <em>The content that should be here is dynamically generated. Please enable JavaScript if you see this.</em>
</div> </div>
<script src="scripts/projects.js"></script> <script src="./scripts/projects.js"></script>
</div> </div>
<!-- Social --> <!-- Social -->
@ -145,7 +145,7 @@
</div> </div>
</div> </div>
<script src="scripts/social.js"></script> <script src="./scripts/social.js"></script>
</div> </div>
<!-- About --> <!-- About -->
@ -158,7 +158,7 @@
<div id="about-list"> <div id="about-list">
<em>The content that should be here is dynamically generated. Please enable JavaScript if you see this.</em> <em>The content that should be here is dynamically generated. Please enable JavaScript if you see this.</em>
</div> </div>
<script src="scripts/about.js"></script> <script src="./scripts/about.js"></script>
</div> </div>
<!-- Blog --> <!-- Blog -->
@ -176,7 +176,7 @@
<div id="blog-archive"> <div id="blog-archive">
<em>The content that should be here is dynamically generated. Please enable JavaScript if you see this.</em> <em>The content that should be here is dynamically generated. Please enable JavaScript if you see this.</em>
</div> </div>
<script src="scripts/blog.js"></script> <script src="./scripts/blog.js"></script>
</div> </div>
</div> </div>
</div> </div>
@ -187,8 +187,8 @@
<span class="text-muted"><a href="https://git.ellpeck.de/Ellpeck/Web">&copy; 2018-2021 Ellpeck</a> &ndash; <a href="#impressum">Impressum</a> &ndash; <a href="#privacy">Privacy</a></span> <span class="text-muted"><a href="https://git.ellpeck.de/Ellpeck/Web">&copy; 2018-2021 Ellpeck</a> &ndash; <a href="#impressum">Impressum</a> &ndash; <a href="#privacy">Privacy</a></span>
<div class="quote"> <div class="quote">
<span id="quote-text"></span> <span id="quote-text"></span>
<script src="scripts/quote.js"></script> <script src="./scripts/quote.js"></script>
<img src="res/blobheart.png" id="blobheart"> <img src="./res/blobheart.png" id="blobheart">
</div> </div>
</div> </div>

View file

@ -9,16 +9,26 @@ console.log("Refreshing blog sub-sites...");
fs.readFile(folder + "index.html", function (_, html) { fs.readFile(folder + "index.html", function (_, html) {
let templateDom = new JSDOM(html); let templateDom = new JSDOM(html);
// remove all non-blog stuff from the template (which is just our index.html)
let noBlog = templateDom.window.document.getElementsByClassName("no-blog"); let noBlog = templateDom.window.document.getElementsByClassName("no-blog");
while (noBlog.length > 0) while (noBlog.length > 0)
noBlog[0].parentNode.removeChild(noBlog[0]); noBlog[0].parentNode.removeChild(noBlog[0]);
// change all relative links to move to the parent directory (since we're in blog/)
let elements = templateDom.window.document.getElementsByTagName("*");
for (let i = 0; i < elements.length; i++) {
let element = elements[i];
if (element.src && element.src.startsWith("./"))
element.src = "../" + element.src.substring(2);
if (element.href && element.href.startsWith("./"))
element.href = "../" + element.href.substring(2);
}
let template = templateDom.serialize(); let template = templateDom.serialize();
fs.readFile(folder + "blog/posts.json", function (_, data) { fs.readFile(folder + "blogsrc/posts.json", function (_, data) {
let json = JSON.parse(data); let json = JSON.parse(data);
for (let i = 0; i < json.length; i++) { for (let i = 0; i < json.length; i++) {
let post = json[i]; let post = json[i];
fs.readFile(folder + "blog/" + post.id + ".md", function (_, content) { fs.readFile(folder + "blogsrc/" + post.id + ".md", function (_, content) {
let dom = new JSDOM(template); let dom = new JSDOM(template);
let document = dom.window.document; let document = dom.window.document;
@ -31,10 +41,10 @@ fs.readFile(folder + "index.html", function (_, html) {
nav += '<a class="nav-item nav-link" href="/#blog">Back to Main Page</a>'; nav += '<a class="nav-item nav-link" href="/#blog">Back to Main Page</a>';
let last = getAdjacentPost(json, i, -1); let last = getAdjacentPost(json, i, -1);
if (last) if (last)
nav += '<a class="nav-item nav-link" href="/blog-' + last.id + '">Previous Post</a>'; nav += '<a class="nav-item nav-link" href="/blog/' + last.id + '">Previous Post</a>';
let next = getAdjacentPost(json, i, 1); let next = getAdjacentPost(json, i, 1);
if (next) if (next)
nav += '<a class="nav-item nav-link" href="/blog-' + next.id + '">Next Post</a>'; nav += '<a class="nav-item nav-link" href="/blog/' + next.id + '">Next Post</a>';
document.getElementById("nav-items").innerHTML = nav; document.getElementById("nav-items").innerHTML = nav;
let c = ""; let c = "";
@ -53,7 +63,9 @@ fs.readFile(folder + "index.html", function (_, html) {
document.getElementById("main").innerHTML = c; document.getElementById("main").innerHTML = c;
let ret = dom.serialize(); let ret = dom.serialize();
fs.writeFile(folder + "blog-" + post.id + ".html", ret, function (_, _) {}); fs.mkdir(folder + "blog", function () {
fs.writeFile(folder + "blog/" + post.id + ".html", ret, function (_, _) {});
});
}); });
} }
}); });

View file

@ -31,17 +31,17 @@ function createFeed(callback) {
} }
}); });
fs.readFile(__dirname + "/../blog/posts.json", function (_, data) { fs.readFile(__dirname + "/../blogsrc/posts.json", function (_, data) {
let json = JSON.parse(data); let json = JSON.parse(data);
for (let i = json.length - 1; i >= 0; i--) { for (let i = json.length - 1; i >= 0; i--) {
let post = json[i]; let post = json[i];
let date = new Date(post.date); let date = new Date(post.date);
fs.readFile(__dirname + "/../blog/" + post.id + ".md", function (_, content) { fs.readFile(__dirname + "/../blogsrc/" + post.id + ".md", function (_, content) {
let html = converter.makeHtml(content.toString()); let html = converter.makeHtml(content.toString());
feed.addItem({ feed.addItem({
title: post.name + (post.archived ? " (Archived)" : ""), title: post.name + (post.archived ? " (Archived)" : ""),
link: "https://ellpeck.de/blog-" + post.id, link: "https://ellpeck.de/blog/" + post.id,
description: post.summary, description: post.summary,
content: html, content: html,
date: date, date: date,

View file

@ -6,7 +6,7 @@ $("#blog-archive-button").on("click", function () {
$.ajax({ $.ajax({
dataType: "json", dataType: "json",
url: "blog/posts.json", url: "blogsrc/posts.json",
cache: false, cache: false,
success: function (json) { success: function (json) {
let list = $('#blog-list'); let list = $('#blog-list');
@ -18,7 +18,7 @@ $.ajax({
let p = ""; let p = "";
p += '<div class="card bg-light blog-entry rounded-0">'; p += '<div class="card bg-light blog-entry rounded-0">';
p += '<div class="card-body">'; p += '<div class="card-body">';
p += '<h4 class="card-title"><a class="blog-button" href="/blog-' + obj.id + '">' + obj.name + '</a></h4>'; p += '<h4 class="card-title"><a class="blog-button" href="/blog/' + obj.id + '">' + obj.name + '</a></h4>';
p += '<div class="card-text text-muted blog-summary">' + obj.summary + '</div>'; p += '<div class="card-text text-muted blog-summary">' + obj.summary + '</div>';
p += '<span class="text-muted project-status">' + obj.date + "</span>"; p += '<span class="text-muted project-status">' + obj.date + "</span>";
p += '</div></div>'; p += '</div></div>';

View file

@ -1,12 +1,13 @@
let dark = getCookie("dark") === "true"; const dark = getCookie("dark") === "true";
let pride = new Date().getMonth() == 5; const pride = new Date().getMonth() == 5;
const loc = $("script").last().attr("src").split("/")[0];
if (dark) { if (dark) {
document.write('<link rel="stylesheet" href="style/dark.css">') document.write(`<link rel="stylesheet" href="${loc}/style/dark.css">`)
document.write('<link rel="stylesheet" href="style/prettify-dark.css">') document.write(`<link rel="stylesheet" href="${loc}/style/prettify-dark.css">`)
} }
if (pride) if (pride)
document.write('<link rel="stylesheet" href="style/pride.css">') document.write(`<link rel="stylesheet" href="${loc}/style/pride.css">`)
$(function () { $(function () {
let openModals = function (hash) { let openModals = function (hash) {