@@ -3,6 +3,7 @@ import date from "lume/plugins/date.ts";
33import basePath from "lume/plugins/base_path.ts" ;
44import tailwindcss from "lume/plugins/tailwindcss.ts" ;
55import feed from "lume/plugins/feed.ts" ;
6+ import ogImages from "lume/plugins/og_images.ts" ;
67import { parse as parseYaml } from "@std/yaml" ;
78
89const site = lume ( {
@@ -17,6 +18,29 @@ site.use(date());
1718site . use ( tailwindcss ( ) ) ;
1819site . use ( basePath ( ) ) ; // rewrites href/src in the output to include the base path
1920
21+ // Lume's _cache keys entries with WebCrypto MD5, which Deno 2.8 removed, so
22+ // every cache write throws. Disabling the cache only costs re-rendering the
23+ // og:image cards each build, which is fast. TODO: drop once Lume digests with
24+ // a supported algorithm.
25+ site . cache = undefined ;
26+
27+ // Per-repo og:image cards (pages opt in via `openGraphLayout`; the repo tab
28+ // landing pages do — see src/repo-feeds.page.ts and src/_includes/og/repo.ts).
29+ const mulish = ( weight : number ) =>
30+ Deno . readFile ( new URL ( `./src/_fonts/mulish-${ weight } .ttf` , import . meta. url ) ) ;
31+ site . use ( ogImages ( {
32+ options : {
33+ width : 1200 ,
34+ height : 630 ,
35+ fonts : [
36+ { name : "Mulish" , weight : 500 , style : "normal" , data : await mulish ( 500 ) } ,
37+ { name : "Mulish" , weight : 600 , style : "normal" , data : await mulish ( 700 ) } ,
38+ { name : "Mulish" , weight : 700 , style : "normal" , data : await mulish ( 700 ) } ,
39+ { name : "Mulish" , weight : 800 , style : "normal" , data : await mulish ( 800 ) } ,
40+ ] ,
41+ } ,
42+ } ) ) ;
43+
2044// Expose the watched repo list (from repos.yml) to all templates.
2145const reposDoc = parseYaml ( await Deno . readTextFile ( "repos.yml" ) ) as {
2246 repos ?: ( string | { repo : string } ) [ ] ;
0 commit comments