import _ from 'lodash'; import { BenzinConfig } from './lib/types'; import nginxAdapter from './lib/nginxAdapter'; const config: BenzinConfig = { title: `Eugene's Space`, CDN: 'https://git.eug-vs.xyz/eug-vs/eug-vs-xyz/plain/src', adapter: nginxAdapter, paths: { favicon: '/public/icon-64.png', logo: '/public/eug-vs.png', emojiRoot: '/public/emoji', css: '/public/style.css?h=benzin-next-cdn', }, hooks: { async preRender(path, data, adapter, cdn) { if (path.length === 1 && path[0] === 'index') { // Inject blog preview into home page const blog = await adapter.getMarkdownSource(cdn, ['blog', 'index']); const previewContent = blog .split('\n') .filter(line => line.startsWith('-')) .slice(0, 4) .join('\n'); const split = data.split('# Recent blog posts'); return [split[0], '# Recent blog posts\n', previewContent, split[1]].join(''); } return data; } }, }; export default config;