From f32019b52537dac33069a4afd85938fb31f2d2ab Mon Sep 17 00:00:00 2001 From: Gil Date: Tue, 18 Feb 2025 14:12:10 -0600 Subject: [PATCH] Framework for layouts/partials --- .eleventy.js | 34 ++++++++++++++++++++-------------- .gitignore | 2 +- CHANGELOG | 6 +++++- package.json | 4 ++-- src/_data/meta.js | 8 ++++++++ src/_includes/footer.njk | 0 src/_includes/head/meta.njk | 11 +++++++++++ src/_includes/header.njk | 0 src/_includes/nav.njk | 0 src/_layouts/base.njk | 14 ++++++++++++++ src/assets/css/reset.css | 6 ------ src/index.md | 18 +++++++++++++----- 12 files changed, 74 insertions(+), 29 deletions(-) create mode 100644 src/_data/meta.js create mode 100644 src/_includes/footer.njk create mode 100644 src/_includes/head/meta.njk create mode 100644 src/_includes/header.njk create mode 100644 src/_includes/nav.njk create mode 100644 src/_layouts/base.njk diff --git a/.eleventy.js b/.eleventy.js index 3dee6db..12f336f 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -3,18 +3,19 @@ import markdownIt from "markdown-it"; import markdownItFootnote from "markdown-it-footnote"; import markdownItAnchor from "markdown-it-anchor"; -const MARKDOWN_OPTIONS = { - html: true, - breaks: true, - linkify: true, - typographer: true, -}; - -const md = new markdownIt(MARKDOWN_OPTIONS) - .use(markdownItFootnote) - .use(markdownItAnchor); - export default function (eleventyConfig) { + + const MARKDOWN_OPTIONS = { + html: true, + breaks: true, + linkify: true, + typographer: true, + }; + + let md = markdownIt(MARKDOWN_OPTIONS) + .use(markdownItFootnote) + .use(markdownItAnchor); + // Libraries eleventyConfig.setLibrary("md", md); @@ -22,13 +23,18 @@ export default function (eleventyConfig) { eleventyConfig.addPlugin(eleventyNavigationPlugin); // Passthrough copies - eleventyConfig.addPassthroughCopy({ "./src/assets": "assets" }); + ["src/assets"].forEach((path) => { + eleventyConfig.addPassthroughCopy(path); + }); + eleventyConfig.addWatchTarget("./src/assets/css"); return { dir: { - input: "src", - output: "_site", + input: 'src', + output: 'public', + includes: '_includes', + layouts: '_layouts', }, }; } diff --git a/.gitignore b/.gitignore index 75432d6..fc2a7a7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ node_modules/ -_site/ +public/ .directory \ No newline at end of file diff --git a/CHANGELOG b/CHANGELOG index 0526a09..2f0a6c3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,4 +4,8 @@ GIL.INK CHANGELOG ================== - Created site/project scaffolding & Eleventy boilerplate - Added CSS reset (from https://piccalil.li/blog/a-more-modern-css-reset/) -- Added index.md \ No newline at end of file +- Added index.md + +2025-02-## (0.0.2) +================== +- Basic layouts and includes \ No newline at end of file diff --git a/package.json b/package.json index 7359b5b..1d809f6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { - "name": "gil", + "name": "gil.ink", "version": "0.0.1", - "description": "", + "description": "Test", "scripts": { "watch:sass": "sass --watch scss:src/assets/css", "build:sass": "sass scss:src/assets/css", diff --git a/src/_data/meta.js b/src/_data/meta.js new file mode 100644 index 0000000..cd5e433 --- /dev/null +++ b/src/_data/meta.js @@ -0,0 +1,8 @@ +export default function () { + return { + name: "Gil.Ink", + description: "Gil's personal website", + author: "Gil Caley", + fediverseAuthor: "@gil@hol.ogra.ph", + }; +} diff --git a/src/_includes/footer.njk b/src/_includes/footer.njk new file mode 100644 index 0000000..e69de29 diff --git a/src/_includes/head/meta.njk b/src/_includes/head/meta.njk new file mode 100644 index 0000000..0c40f91 --- /dev/null +++ b/src/_includes/head/meta.njk @@ -0,0 +1,11 @@ + + + +{{ title or metaTitle | safe }}{% if title !== meta.name %} • {{ meta.name }}{% endif %} + + + + + + + \ No newline at end of file diff --git a/src/_includes/header.njk b/src/_includes/header.njk new file mode 100644 index 0000000..e69de29 diff --git a/src/_includes/nav.njk b/src/_includes/nav.njk new file mode 100644 index 0000000..e69de29 diff --git a/src/_layouts/base.njk b/src/_layouts/base.njk new file mode 100644 index 0000000..db435c8 --- /dev/null +++ b/src/_layouts/base.njk @@ -0,0 +1,14 @@ + + + + {% include 'head/meta.njk' %} + + + + + {% include 'header.njk' %} + {% include 'nav.njk' %} +
{{ content | safe }}
+ {% include 'footer.njk' %} + + \ No newline at end of file diff --git a/src/assets/css/reset.css b/src/assets/css/reset.css index 502cb94..63db9e2 100644 --- a/src/assets/css/reset.css +++ b/src/assets/css/reset.css @@ -47,12 +47,6 @@ h3, h4 { text-wrap: balance; } -/* A elements that don't have a class get default styles */ -a:not([class]) { - text-decoration-skip-ink: auto; - color: currentColor; -} - /* Make images easier to work with */ img, picture { diff --git a/src/index.md b/src/index.md index af86502..8636e66 100644 --- a/src/index.md +++ b/src/index.md @@ -1,12 +1,16 @@ -# gil.ink +--- +title: 'Gil.Ink' +layout: base.njk +--- +# {{ meta.name }} --- -Howdy! I'm Gil ([he/they](https://en.pronouns.page/@kalanggam)). +Howdy! -I write things, make games, and study engineering. +My name's Gil ([he/they](https://en.pronouns.page/@kalanggam)). I write things, make games, and study engineering. I like building community offline and online. -I like building community offline and online. Find me here: +Find me: - Microblog: @gil@hol.ogra.ph - Code: [ide.ogra.ph/gil](https://ide.ogra.ph/gil) @@ -14,6 +18,10 @@ I like building community offline and online. Find me here: - Photos: [pixelfed.social/kalanggam](https://pixelfed.social/kalanggam) - Reads: [bookwyrm.social/user/kalanggam](https://bookwyrm.social/user/kalanggam) -Or you can subscribe to my (upcoming) newsletter: [gilosophies.ghost.io](https://gilosophies.ghost.io) +Subscribe to my (upcoming) newsletter: [gilosophies.ghost.io](https://gilosophies.ghost.io) --- + +## Publications + +2022 Jul 28: ["Dear Mom, Akong Tanan"](https://www.mahalayasf.org/reflections/dear-mom-akong-tanan), _Mahalaya_ \ No newline at end of file