From abee32152dc13ccd3f7e9e8816ddb64dc4176dd0 Mon Sep 17 00:00:00 2001 From: Chris Krycho Date: Sat, 26 Oct 2024 11:00:13 -0600 Subject: [PATCH] Update post meta to hopefully boost subscriptions etc. - Bump the 'you can hire me' bit up to the top. - Add subscription info and put it second. Everything else is valuable, too, but should come *after* those first bits given my current goals. --- eleventy/config.ts | 7 + package.json | 3 +- site/_includes/base.njk | 6 +- site/_includes/components/item.njk | 178 +++++++++++------- site/_includes/styles/_defaults.scss | 32 ++++ .../_includes/styles/components/_contact.scss | 25 --- .../styles/components/post-meta.scss | 4 + site/index.md | 4 +- types/eleventy.d.ts | 10 + 9 files changed, 175 insertions(+), 94 deletions(-) diff --git a/eleventy/config.ts b/eleventy/config.ts index ea33db4e7..25e647945 100644 --- a/eleventy/config.ts +++ b/eleventy/config.ts @@ -1,4 +1,5 @@ import { env } from 'process'; +import { randomBytes } from 'node:crypto'; import { DateTime } from 'luxon'; @@ -213,6 +214,10 @@ function config(config: Config): UserConfig { return safe.slice(0, safe.lastIndexOf(' ', 200)) + '…'; }); + config.addShortcode('randomHash', (env: string | undefined) => + env === 'serve' ? `?v=${randomBytes(8).toString('hex')}` : '', + ); + config.addShortcode('localeDate', localeDate); config.addShortcode('copyright', copyright); @@ -300,6 +305,8 @@ function config(config: Config): UserConfig { }, }); + config.addGlobalData('ENV', process.env.ELEVENTY_RUN_MODE); + return { dir: { input: 'site', diff --git a/package.json b/package.json index 271e7d10b..79a7760c2 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,8 @@ "prettier": { "singleQuote": true, "printWidth": 90, - "trailingComma": "all" + "trailingComma": "all", + "tabWidth": 3 }, "scripts": { "build:styles": "gulp all", diff --git a/site/_includes/base.njk b/site/_includes/base.njk index ed3b7def5..14480d754 100644 --- a/site/_includes/base.njk +++ b/site/_includes/base.njk @@ -10,9 +10,9 @@ {{title | siteTitle(config) | striptags(true) | safe}} - - - + + + diff --git a/site/_includes/components/item.njk b/site/_includes/components/item.njk index 572d333d0..33f1f098d 100644 --- a/site/_includes/components/item.njk +++ b/site/_includes/components/item.njk @@ -39,90 +39,140 @@ {%- set DATE_FORMAT = 'MMMM d, yyyy' %} {%- set TIME_FORMAT = 'HH:mm' %} {% endmacro %} diff --git a/site/_includes/styles/_defaults.scss b/site/_includes/styles/_defaults.scss index 786314429..c8c668f6c 100644 --- a/site/_includes/styles/_defaults.scss +++ b/site/_includes/styles/_defaults.scss @@ -179,3 +179,35 @@ mark { ::selection { background-color: var(--selection-bg); } + +input, +textarea { + border: 1px solid var(--main-border); + color: var(--fg); + background: var(--bg); + font-family: var(--sans); + font-weight: 300; + font-size: 16px; // no zoom on mobile! + padding: 0.25em; + line-height: var(--line-height); + + &:focus { + border-color: var(--blue-3); + outline: none; + } +} + +button[type='submit'] { + border: 1px solid var(--main-border); + background: var(--kbd-bg); + color: var(--kdb-fg); + box-shadow: 1px 1px 0 var(--kbd-shadow); + font-family: var(--sans); + font-size: 16px; + font-weight: bold; + line-height: var(--line-height); + + &:active { + box-shadow: inset 1px 1px 3px -1px var(--kbd-shadow); + } +} diff --git a/site/_includes/styles/components/_contact.scss b/site/_includes/styles/components/_contact.scss index 753766f7e..a20fcdd52 100644 --- a/site/_includes/styles/components/_contact.scss +++ b/site/_includes/styles/components/_contact.scss @@ -18,35 +18,10 @@ input, textarea { grid-column: span 2; - border: 1px solid var(--main-border); - color: var(--fg); - background: var(--bg); - font-family: var(--sans); - font-weight: 300; - font-size: 16px; // no zoom on mobile! - padding: 0.25em; - line-height: var(--line-height); - - &:focus { - border-color: var(--blue-3); - outline: none; - } } &__submit { grid-column: span 2; - border: 1px solid var(--main-border); - background: var(--kbd-bg); - color: var(--kdb-fg); - box-shadow: 1px 1px 0 var(--kbd-shadow); - font-family: var(--sans); - font-size: 16px; - font-weight: bold; - line-height: var(--line-height); - - &:active { - box-shadow: inset 1px 1px 3px -1px var(--kbd-shadow); - } } } diff --git a/site/_includes/styles/components/post-meta.scss b/site/_includes/styles/components/post-meta.scss index 9251a971a..2e11fa207 100644 --- a/site/_includes/styles/components/post-meta.scss +++ b/site/_includes/styles/components/post-meta.scss @@ -54,6 +54,10 @@ } } +.post-meta-section { + display: contents; +} + .section-label { grid-column: 1 / 2; align-self: first baseline; diff --git a/site/index.md b/site/index.md index 2900d1bcf..30834c163 100644 --- a/site/index.md +++ b/site/index.md @@ -7,4 +7,6 @@ summary: {{config.description}} Hello! -{% include 'blocks/short-about.njk' %} +I'm Chris Krycho—a follower of Christ, a husband, and a dad. I'm a [software engineer](/cv/) by trade; a theologian and [composer](https://music.chriskrycho.com) by vocation; and a writer, [runner and cyclist](https://www.strava.com/athletes/chriskrycho), and erstwhile podcaster by hobby. + +I help teams with front-end web strategy development, TypeScript adoption and conversion, and Rust adoption. [Hire me to work with you!](/services/) diff --git a/types/eleventy.d.ts b/types/eleventy.d.ts index 9d5931f37..a2f059c66 100644 --- a/types/eleventy.d.ts +++ b/types/eleventy.d.ts @@ -158,6 +158,16 @@ export interface EleventyClass { } export interface Config { + /** + In addition to Global Data Files global data can be added to the Eleventy + config object using the `addGlobalData` method. This is especially useful + for plugins. + + The first value of `addGlobalData` is the key that will be available to + your templates and the second value is the value of the value returned to + the template. + */ + addGlobalData(key: string, value: string | undefined): void; dir?: { /** Controls the top level directory/file/glob that we’ll use to look for templates. */ input?: string;