Prototype post title style

This commit is contained in:
vib 2023-09-07 10:05:34 +03:00
parent 3b3cd9344b
commit f0174becf7
3 changed files with 23 additions and 3 deletions

View file

@ -1,6 +1,6 @@
module.exports = function (eleventyConfig) {
eleventyConfig.addPassthroughCopy ("src/media");
eleventyConfig.addPassthroughCopy ("src/resources");
eleventyConfig.addPassthroughCopy ({ "src/resources": "/" });
eleventyConfig.addPassthroughCopy ("src/robots.txt");
eleventyConfig.addPlugin( require("@11ty/eleventy-plugin-rss") );
@ -22,6 +22,12 @@ module.exports = function (eleventyConfig) {
}).toFormat("yyyy-MM-dd");
});
eleventyConfig.addFilter("postDate", dateObj => {
return DateTime.fromJSDate(dateObj, {
zone: 'utc'
}).toFormat("DDDD");
});
return {
dir: {
input: "src",

View file

@ -1,8 +1,10 @@
---
layout: base.njk
---
<h1>{{ title }}</h1>
<h3>{{ date }}</h3>
<div class="title">
<h1>{{ title }}</h1>
<time datetime="{{ date | readableDate }}">{{ date | postDate }}</time>
</div>
<article>
{{ content | safe }}
</article>

View file

@ -13,6 +13,7 @@ html {
--link_h: #771e2d;
--bg_grey: #ebadc1;
--dark_grey: #f46c97;
--title: #f46c9750;
}
@media (prefers-color-scheme: dark) {
:root {
@ -23,6 +24,7 @@ html {
--link_h: #f94578;
--bg_grey: #2d2531;
--dark_grey: #221c25;
--title: #221c2550;
}
}
@ -361,3 +363,13 @@ footer {
padding: 5px;
font-size: 13px;
}
.title {
background-color: var(--title);
padding: 5px;
text-align: right;
}
.title h1 {
text-align: center;
}