Prototype post title style

This commit is contained in:
Cheri 2023-09-07 10:05:34 +03:00 committed by vib
parent 58d06e9f0d
commit 71614e3481
3 changed files with 23 additions and 3 deletions

View file

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

View file

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

View file

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