feat: reset post

This commit is contained in:
Matthew McKinnon 2024-09-18 23:29:53 +10:00
parent 2129e0dce8
commit 11cbf5d003
8 changed files with 52 additions and 41 deletions

View File

@ -2,6 +2,10 @@ const blogTools = require("eleventy-plugin-blog-tools");
const markdownIt = require("markdown-it"); const markdownIt = require("markdown-it");
const markdownItAttrs = require("markdown-it-attrs"); const markdownItAttrs = require("markdown-it-attrs");
// Import prior to `module.exports` within `.eleventy.js`
const { DateTime } = require("luxon");
module.exports = function(eleventyConfig) { module.exports = function(eleventyConfig) {
const mdOptions = { const mdOptions = {
html: true, html: true,
@ -11,6 +15,11 @@ module.exports = function(eleventyConfig) {
const markdownLib = markdownIt(mdOptions) const markdownLib = markdownIt(mdOptions)
.use(markdownItAttrs) .use(markdownItAttrs)
.disable("code"); .disable("code");
eleventyConfig.addFilter("postDate", (dateObj) => {
return DateTime.fromJSDate(dateObj).toLocaleString(DateTime.DATE_MED);
});
eleventyConfig.setLibrary("md", markdownLib); eleventyConfig.setLibrary("md", markdownLib);

View File

@ -2,10 +2,10 @@
<div class="container-footer"> <div class="container-footer">
<div class="footer"> <div class="footer">
<span class="footer-text"> <span class="footer-text">
Built with Eleventy <br> Built with <a href="https://www.11ty.dev/" target="_blank">Eleventy</a><br>
Running on Docker Running on <a href="https://www.docker.com/" target="_blank">Docker</a>
<br> <br>
Copyright (c) 2022 - Comprofix Copyright <i class="fas fa-copyright"></i> - Comprofix
</span> </span>
</div> </div>
</div> </div>

View File

@ -9,7 +9,7 @@
<ul class="menu>"> <ul class="menu>">
<li class="menu"><a href="/">Home</a></li> <li class="menu"><a href="/">Home</a></li>
<li class="menu"><a href="/disclaimer">Disclaimer</a></li> <li class="menu"><a href="/disclaimer">Disclaimer</a></li>
<li class="menu"><a href="/contact">Contact Me</a></li> <li class="menu"><a href="/blog">Blog</a></li>
<li class="menu"> <li class="menu">
<button id="modeSwitcher" class="container"> <button id="modeSwitcher" class="container">
<div class="sun visible"></div> <div class="sun visible"></div>
@ -24,8 +24,7 @@
</div> </div>
<div class="hero-image"> <div class="hero-image">
<div class="hero-text"> <div class="hero-text">
<h1 style="font-size:50px">Comprofix</h1> <h1 style="font-size:100px">Comprofix</h1>
<p style="font-size:24px">Computer Problems Fixed</p>
</div> </div>
</div> </div>

View File

@ -6,7 +6,7 @@
{% block content %} {% block content %}
<h1>{{ title }}</h1> <h1>{{ title }}</h1>
<p><time>{{ page.date }} </time></p> <p><time>{{ page.date | postDate }} </time></p>
<ul> <ul>
{% for tag in tags %} {% for tag in tags %}
<li> <li>

View File

@ -4,18 +4,22 @@ title: Blog
eleventyExcludeFromCollections: true eleventyExcludeFromCollections: true
--- ---
<h1>{{ title }}</h1> <h1>{{ title }}</h1>
<ul> {% for post in collections.posts %}
{% for post in collections.posts %} {{ post.date | postDate }}
<ul>
{# {% for post in collections.posts %} #}
<li> <li>
<a href={{ post.url }}>{{ post.data.title }}</a> <a href={{ post.url }}>{{ post.data.title }}</a>
</li> </li>
{# {% endfor %} #}
{% endfor %}
</ul> </ul>
{% endfor %}

View File

@ -1,27 +0,0 @@
---
layout: layouts/post.njk
title: Welcome to the new Website.
description: We have a new website at last.
date: 2022-08-07
author: Matthew McKinnon
---
<!-- excerpt start -->
<center>
![](/assets/img/fireworks.jpg) {width=200}
</center>
After many months, we finally have a new website that works.
In the past, previous websites were built using Wordpress. Because I could go many months without creating a blog post, the website would get "forgotten". Because of this, the versions of Wordpress and plugins that were being used at the time would sometimes become "compromised", thus allowing attackers to gain entry to server and deface website etc.
<!-- excerpt end -->
So a new website back end was needed. After investigating and trying many different styles, I settled on using [Eleventy](https://11ty.dev){target="_blank"}.
Eleventy is a framework for building static websites. Once I built the code and templates. The website was born. All using pure HTML pages.
I will start rebuilding my old blog posts. As well as create some new and awesome content for you all to enjoy.

View File

@ -0,0 +1,26 @@
---
layout: layouts/post.njk
title: Reset and Restart
description: It's time to reset and restart the website.
date: 2024-09-15
author: Matthew McKinnon
---
<!-- excerpt start -->
<center>
![](https://t4.ftcdn.net/jpg/08/45/37/17/360_F_845371701_1efvAwbZQVOM2I3YslbPrpNf8408z56C.jpg){width=800}
</center>
It's time to reset the website and start building my blog again. I have had this domain for a number of years and it has always been used for my E-Mail.
But the website has been more of a play ground for experimenting and testing.
I am now hoping to get into the habit of writing more blog posts as I document my journey as I experiment with my HomeLab.
<!-- excerpt end -->

View File

@ -1,6 +1,6 @@
--- ---
layout: layouts/homepage.njk layout: layouts/homepage.njk
title: Computer Problems Fixed title: Comprofix
eleventyExcludeFromCollections: true eleventyExcludeFromCollections: true
--- ---
@ -9,7 +9,7 @@ eleventyExcludeFromCollections: true
<div id="blog" class="post"> <div id="blog" class="post">
<h1>{{ post.data.title }}</h1> <h1>{{ post.data.title }}</h1>
{{ post.data.date }} {{ post.data.date | postDate }}
<P> <P>
{% excerpt post %} {% excerpt post %}