diff --git a/.eleventy.js b/.eleventy.js
index 57af464..e7df33a 100644
--- a/.eleventy.js
+++ b/.eleventy.js
@@ -3,17 +3,33 @@ module.exports = function (eleventyConfig) {
if (str instanceof Date) {
return str;
}
- const date = DateTime.fromISO(str, { zone: "utc" });
- return date.toJSDate();
+ return Date.parse(str);
};
+ const formatPart = (part, date) =>
+ new Intl.DateTimeFormat("en", part).format(date);
+
eleventyConfig.addPassthroughCopy({ "src/static": "/" });
eleventyConfig.addFilter("date_to_datetime", (obj) => {
const date = parseDate(obj);
- return DateTime.fromJSDate(date).toUTC().toISO();
+ return date.toISOString();
});
+ eleventyConfig.addFilter("date_formatted", (obj) => {
+ const date = parseDate(obj);
+
+ const month = formatPart({ month: "short" }, date);
+ const day = formatPart({ day: "numeric" }, date);
+ const year = formatPart({ year: "numeric" }, date);
+
+ return `${month} ${day}, ${year}`;
+ });
+
+ eleventyConfig.addCollection('posts', collection => {
+ return collection.getFilteredByGlob('src/posts/*.md').reverse()
+ })
+
return {
templateFormats: ["njk", "md", "html"],
dir: {
diff --git a/src/_data/nav.json b/src/_data/nav.json
index 5c1bf82..c64bd16 100644
--- a/src/_data/nav.json
+++ b/src/_data/nav.json
@@ -3,6 +3,10 @@
"name": "home",
"link": "/"
},
+ {
+ "name": "blog",
+ "link": "/posts/"
+ },
{
"name": "sample packs",
"link": "/samples/"
diff --git a/src/_includes/components/pagination.njk b/src/_includes/components/pagination.njk
new file mode 100644
index 0000000..b168225
--- /dev/null
+++ b/src/_includes/components/pagination.njk
@@ -0,0 +1,17 @@
+
+ {% if pagination.nextPageLink -%}
+ {% set nextPageNumber = pagination.pageNumber + 1 %}
+ {% set nextPageLink = 'page/' ~ nextPageNumber %}
+ Older
+ {%- endif %}
+
+ {% if pagination.previousPageLink -%}
+ {% set previousPageNumber = pagination.pageNumber - 1 %}
+ {%- if pagination.pageNumber == 1 -%}
+ {% set previousPageLink = '' %}
+ {%- else -%}
+ {% set previousPageLink = 'page/' ~ previousPageNumber %}
+ {%- endif -%}
+ Newer
+ {%- endif %}
+
\ No newline at end of file
diff --git a/src/_includes/layouts/default.njk b/src/_includes/layouts/default.njk
index e665c36..deec910 100644
--- a/src/_includes/layouts/default.njk
+++ b/src/_includes/layouts/default.njk
@@ -21,12 +21,12 @@
-
+
- {% block content %}{% endblock %}
+ {% block main %}{% endblock %}
{% include "components/footer.njk" %}
diff --git a/src/_includes/layouts/post.njk b/src/_includes/layouts/post.njk
new file mode 100644
index 0000000..23a1506
--- /dev/null
+++ b/src/_includes/layouts/post.njk
@@ -0,0 +1,16 @@
+---
+subhead: blog
+---
+{% extends 'layouts/default.njk' %}
+{% block main %}
+
+
+
+ {{ date | date_formatted }}
+ by {{ site.name }}
+
+ {{ title }}
+
+ {{ content | safe }}
+
+{% endblock %}
\ No newline at end of file
diff --git a/src/index.njk b/src/index.njk
index c625b5c..63beef1 100644
--- a/src/index.njk
+++ b/src/index.njk
@@ -2,7 +2,7 @@
permalink: /index.html
---
{% extends 'layouts/default.njk' %}
-{% block content %}
+{% block main %}
hello i am {{ site.name }} ({{ site.pronouns }}) and this website is not finished at all as a
matter of fact i havent even rly started working on it yet.
diff --git a/src/posts.njk b/src/posts.njk
new file mode 100644
index 0000000..a381d35
--- /dev/null
+++ b/src/posts.njk
@@ -0,0 +1,21 @@
+---
+title: maia blog :3
+subhead: blog
+pagination:
+ data: collections.posts
+ addAllPagesToCollections: true
+ size: 10
+permalink: /posts/{% if pagination.pageNumber > 0 %}page/{{ pagination.pageNumber }}/{% endif %}index.html
+---
+{% extends 'layouts/default.njk' %}
+{% block main %}
+
+ {% for entry in pagination.items %}
+
+ {{ entry.data.title }} on {{ entry.data.date | date_formatted }}
+
+ {% endfor %}
+
+
+ {% include "components/pagination.njk" %}
+{% endblock %}
diff --git a/src/posts/example.md b/src/posts/example.md
new file mode 100644
index 0000000..9509549
--- /dev/null
+++ b/src/posts/example.md
@@ -0,0 +1,9 @@
+---
+title: "example blog post"
+date: 2022-05-31
+description: "owo"
+---
+
+test
+
+## test
\ No newline at end of file
diff --git a/src/posts/posts.json b/src/posts/posts.json
new file mode 100644
index 0000000..08b472c
--- /dev/null
+++ b/src/posts/posts.json
@@ -0,0 +1,4 @@
+{
+ "layout": "layouts/post",
+ "permalink": "posts/{{ page.fileSlug }}/index.html"
+}
\ No newline at end of file
diff --git a/src/samples.njk b/src/samples.njk
index f778312..bd61279 100644
--- a/src/samples.njk
+++ b/src/samples.njk
@@ -1,15 +1,16 @@
---
-permalink: /samples/index.html
+title: maia sample packs :3
subhead: sample packs
+permalink: /samples/index.html
---
{% extends 'layouts/default.njk' %}
-{% block content %}
+{% block main %}
here are some sample packs i made!
diff --git a/src/static/style.css b/src/static/style.css
index ba73e99..6b1970c 100644
--- a/src/static/style.css
+++ b/src/static/style.css
@@ -12,7 +12,7 @@ li.lavender-webring-curr-site > a {
color: rgb(195, 0, 255);
}
-header {
+#site_header {
padding-bottom: 5px;
border-bottom: 1px solid rgb(255, 0, 140);
}
@@ -22,8 +22,8 @@ footer {
border-top: 1px solid rgb(255, 0, 140);
}
-header,
footer,
+#site_header,
.lavender-webring-container {
text-align: center;
}
@@ -36,6 +36,23 @@ footer,
padding-bottom: 2em;
}
+.byline {
+ font-size: 0.75rem;
+}
+
+time, .author {
+ font-weight: bold;
+}
+
+.article_header {
+ padding-bottom: 4px;
+ border-bottom: 1px dotted rgb(219, 103, 167);
+}
+
+.article_header > h1 {
+ margin: 0.1rem;
+}
+
.lavender-webring-container {
all: unset;
display: flex;