some metadata stuff
This commit is contained in:
@ -27,4 +27,9 @@ export default function(eleventyConfig) {
|
|||||||
(strings || []).sort((b, a) => b.localeCompare(a))
|
(strings || []).sort((b, a) => b.localeCompare(a))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/* Remove year from image filenames for OG metadata */
|
||||||
|
eleventyConfig.addFilter("toOgFilename", (filename) => {
|
||||||
|
return filename.split("/")[1];
|
||||||
|
})
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -3,14 +3,19 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
<title>{{ title or metadata.title }}</title>
|
{% set pageTitle %}{{ title }} | {{ metadata.title }}{% endset %}
|
||||||
|
<title>{{ pageTitle }}</title>
|
||||||
<meta name="description" content="{{ description or metadata.description }}">
|
<meta name="description" content="{{ description or metadata.description }}">
|
||||||
{# <link rel="alternate" href="/feed/feed.xml" type="application/atom+xml" title="{{ metadata.title }}"> #}
|
<link rel="alternate" href="/feed.xml" type="application/atom+xml" title="{{ metadata.title }}">
|
||||||
|
|
||||||
<meta property="og:title" content="{{ title or metadata.title }}" />
|
<meta property="og:title" content="{{ title or metadata.title }}" />
|
||||||
<meta property="og:type" content="website" />
|
<meta property="og:type" content="website" />
|
||||||
<meta property="og:description" content="{{ description or metadata.description }}" />
|
<meta property="og:description" content="{{ description or metadata.description }}" />
|
||||||
<meta property="og:site_name" content="{{ metadata.title }}" />
|
<meta property="og:site_name" content="{{ metadata.title }}" />
|
||||||
|
{% if image %}
|
||||||
|
<meta property="og:image" content="/img/{{ image.src | toOgFilename }}" />
|
||||||
|
<meta property="og:image:alt" content="{{ image.alt }}" />
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<meta name="generator" content="{{ eleventy.generator }}">
|
<meta name="generator" content="{{ eleventy.generator }}">
|
||||||
|
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import { feedPlugin } from "@11ty/eleventy-plugin-rss";
|
|||||||
import syntaxHighlight from "@11ty/eleventy-plugin-syntaxhighlight";
|
import syntaxHighlight from "@11ty/eleventy-plugin-syntaxhighlight";
|
||||||
import { attrs } from "@mdit/plugin-attrs";
|
import { attrs } from "@mdit/plugin-attrs";
|
||||||
import { chunk } from "lodash-es";
|
import { chunk } from "lodash-es";
|
||||||
|
import path from "node:path";
|
||||||
|
|
||||||
import pluginFilters from "./_config/filters.js";
|
import pluginFilters from "./_config/filters.js";
|
||||||
|
|
||||||
@ -91,6 +92,9 @@ export default async function(eleventyConfig) {
|
|||||||
decoding: "async",
|
decoding: "async",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
filenameFormat: function (id, src, width, format, options) {
|
||||||
|
return path.basename(src);
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
/* Navigation */
|
/* Navigation */
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
"description": "Lee's personal website, take 2, built with 11ty",
|
"description": "Lee's personal website, take 2, built with 11ty",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "rm -rf _site && npx @11ty/eleventy",
|
"build": "rm -rf _site && npx @11ty/eleventy --quiet",
|
||||||
"start": "rm -rf _site && npx @11ty/eleventy --serve --quiet"
|
"start": "rm -rf _site && npx @11ty/eleventy --serve --quiet"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
|
|||||||
Reference in New Issue
Block a user