Skip to content

Commit c2a18ea

Browse files
authored
Merge pull request #2 from beyonddream/blog-style-changes
Blog style changes
2 parents a216b87 + 733a1af commit c2a18ea

File tree

8 files changed

+565
-108
lines changed

8 files changed

+565
-108
lines changed

_includes/layout.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<title>{{ title | default: "Thoughts from beyond dreamscape." }}</title>
77
<link rel="stylesheet" href="/styles/bundle.css">
8+
<link rel="stylesheet" href="/styles/prism-base16-monokai.dark.css">
89
</head>
910
<body>
1011
<header>
@@ -24,7 +25,7 @@ <h1>{{ title }}</h1>
2425
</div>
2526
<footer>
2627
<div class="container">
27-
<p>&copy; {% year %} Beyonddream. All rights reserved.</p>
28+
<p>&copy; 2025 Beyonddream. All rights reserved.</p>
2829
</div>
2930
</footer>
3031
</body>

eleventy.config.js

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,43 @@
1-
export default function(eleventyConfig) {
1+
const pluginRss = require("@11ty/eleventy-plugin-rss");
2+
const pluginSyntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight");
3+
const pluginNavigation = require("@11ty/eleventy-navigation");
4+
const markdownIt = require("markdown-it");
5+
const markdownItAnchor = require("markdown-it-anchor");
6+
const { DateTime } = require("luxon");
7+
8+
module.exports = function(eleventyConfig) {
9+
10+
// Add plugins
11+
eleventyConfig.addPlugin(pluginRss);
12+
eleventyConfig.addPlugin(pluginSyntaxHighlight);
13+
eleventyConfig.addPlugin(pluginNavigation);
14+
215
eleventyConfig.addPassthroughCopy("styles");
316

4-
// Add shortcode for current year
5-
eleventyConfig.addShortcode("year", () => `${new Date().getFullYear()}`);
17+
// Customize Markdown library and settings:
18+
let markdownLibrary = markdownIt({
19+
html: true,
20+
breaks: true,
21+
linkify: true,
22+
}).use(markdownItAnchor, {
23+
permalink: markdownItAnchor.permalink.ariaHidden({
24+
placement: "after",
25+
class: "direct-link",
26+
symbol: "#",
27+
level: [1, 2, 3, 4],
28+
}),
29+
slugify: eleventyConfig.getFilter("slug"),
30+
});
31+
eleventyConfig.setLibrary("md", markdownLibrary);
32+
33+
eleventyConfig.addFilter("readableDate", (dateObj) => {
34+
return DateTime.fromJSDate(dateObj, { zone: "utc" }).toFormat(
35+
"dd LLL yyyy"
36+
);
37+
});
38+
39+
// https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-date-string
40+
eleventyConfig.addFilter("htmlDateString", (dateObj) => {
41+
return DateTime.fromJSDate(dateObj, { zone: "utc" }).toFormat("yyyy-LL-dd");
42+
});
643
};

images/.gitkeep

Whitespace-only changes.

index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
layout: layout.html
33
---
44
<ul class="post-list">
5-
{% for post in collections.post %}
5+
{% for post in collections.post reversed %}
66
<li>
77
<div class="post-header">
8-
<span class="post-date">{{ post.date | date: "%Y-%m-%d" }}</span>
8+
<span class="post-date">{{ post.date | htmlDateString }}</span>
99
<a class="post-title" href="{{ post.url }}">{{ post.data.title }}</a>
1010
</div>
1111
{% if post.data.description %}
1212
<p>{{ post.data.description }}</p>
1313
{% endif %}
1414
</li>
1515
{% endfor %}
16-
</ul>
16+
</ul>

package.json

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,22 @@
33
"version": "1.0.0",
44
"description": "Beyonddream's blog",
55
"scripts": {
6-
"start": "npx @11ty/eleventy --serve",
7-
"build": "npx @11ty/eleventy"
6+
"build": "npx @11ty/eleventy",
7+
"start": "npx @11ty/eleventy --serve",
8+
"debug": "DEBUG=* eleventy"
89
},
910
"license": "MIT",
10-
"dependencies": {
11-
"@11ty/eleventy": "^3.1.0"
11+
"author": {
12+
"name": "Beyonddream",
13+
"url": "https://www.beyonddream.me"
14+
},
15+
"devDependencies": {
16+
"@11ty/eleventy": "^3.1.0",
17+
"@11ty/eleventy-plugin-rss": "^2.0.4",
18+
"@11ty/eleventy-plugin-syntaxhighlight": "^5.0.1",
19+
"@11ty/eleventy-navigation": "^1.0.4",
20+
"markdown-it": "^14.1.0",
21+
"markdown-it-anchor": "^9.2.0",
22+
"luxon": "^3.6.1"
1223
}
13-
}
24+
}

posts/post-1.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: How to read and write a set of deeply nested datetime partitioned files using Spark (Pre and Post LLM Coding Agents)
3+
date: 2025-05-30
34
---
45

56
## Introduction

0 commit comments

Comments
 (0)