Making The Website

Making the site wasn't as difficult as I thought, once you've wrapped your head around flexbox and have a decent colorscheme it's not that difficult to get a good result. The most interesting (not necessarily very interesting) part of the site is how I got the blogpost list to work, and that's pretty simple. It's just a few lines of javascript.

const posts = [
    ["2024-05-28", "Making The Website"], 

document.write("Available posts:<br><ul>");

for (var i in posts) {
  document.write('<li><a href="/blogposts/' + posts[i][0] 
    + "'" + posts[i][0] + ": " + posts[i][1]  + "</a></li>");
    // formats to "yyyy-mm-dd: blogpost title"



It just takes a manually inputted list and prints it with the so very readable line of text formatting inside that for loop. The blogpost website just loads a .js file with the above code using a <script> tag and those document.write()s just add the text in them onto the page. The code above is highlighted with prism.js and getting it to display right probably took longer to figure out how to do than anything else on the website. For some reason there is no built in way to sanitize text in HTML or Javascript. Everything else is just basic css and HTML.

The CSS for the site is pretty simple but it's located here, and the header file that all of these pages automatically run that contains the sidebar and basic formatting is located here.