diff --git a/_build.ts b/_build.ts index dbef696..5d27a2e 100644 --- a/_build.ts +++ b/_build.ts @@ -1,6 +1,4 @@ -type BuildMode = string | undefined - -const createConfig = (mode: BuildMode) => { +const createConfig = (mode?: string) => { if (typeof mode === 'undefined') { throw new Error('BUILD_MODE is not defined') } @@ -16,6 +14,6 @@ const createConfig = (mode: BuildMode) => { } } -const BUILD_MODE: BuildMode = Deno.env.get('BUILD_MODE') +const BUILD_MODE = Deno.env.get('BUILD_MODE') export const config = createConfig(BUILD_MODE) diff --git a/plugins/md5-cache-buster/mod.ts b/plugins/md5-cache-buster/mod.ts index fae12bc..b5c9054 100644 --- a/plugins/md5-cache-buster/mod.ts +++ b/plugins/md5-cache-buster/mod.ts @@ -31,7 +31,7 @@ export default function (userOptions?: Partial) { site.addEventListener('afterRender', () => { site.process(options.extensions, (pages) => pages.forEach(buildHash)) - site.process(['.html'], replaceUrls) + site.process(['.html'], (pages) => pages.forEach(replaceUrls)) }) function buildHash(page: Lume.Page) { diff --git a/src/_components/layout/navbar.tsx b/src/_components/layout/navbar.tsx index 8f7d3f4..925e0b4 100644 --- a/src/_components/layout/navbar.tsx +++ b/src/_components/layout/navbar.tsx @@ -2,7 +2,7 @@ export default ( { activeUrl, comp, icons, search }: Lume.PageProps, { urlFilter }: Lume.Helpers, ) => { - const items = search.pages('menu.visible=true', 'menu.order') + const items = search.pages('menu.visible=true', 'menu.order') return ( <> diff --git a/src/blog.tmpl.ts b/src/blog.tmpl.ts index ce5e1c2..7fd2c53 100644 --- a/src/blog.tmpl.ts +++ b/src/blog.tmpl.ts @@ -2,8 +2,8 @@ export const indexable = true export const layout = 'layouts/posts.tsx' export const importJs = '/scripts/search.js' -export default function* ({ paginate, search }: Lume.Data) { - const posts = search.pages('type=post', 'date=desc') +export default function* ({ paginate, search }: Lume.PageProps) { + const posts = search.pages('type=post', 'date=desc') const options = { url: (n: number) => n == 1 ? `/blog/` : `/blog/${n}/`, size: 4, diff --git a/src/index.tsx b/src/index.tsx index 4bd7b0d..e99483b 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -5,7 +5,7 @@ export const title = 'Home' export const layout = 'layouts/root.tsx' export default ({ comp, search }: Lume.Data) => { - const posts = search.pages('type=post', 'date=desc', 3) + const posts = search.pages('type=post', 'date=desc', 3) return ( <> @@ -38,7 +38,7 @@ export default ({ comp, search }: Lume.Data) => {

Recent posts

- {posts.map(({ data }, index) => ( + {posts.map((data, index) => ( ))} {posts?.length === 0 &&

Sorry, no posts matched your criteria.

} diff --git a/src/posts/_data.ts b/src/posts/_data.ts index 37a18bc..6570f6f 100644 --- a/src/posts/_data.ts +++ b/src/posts/_data.ts @@ -1,10 +1,8 @@ -import type { Page } from '#types' - export const indexable = true export const type = 'post' export const layout = 'layouts/post.tsx' export const importJs = '/scripts/blog.js' -export function url(page: Page): string { +export function url(page: Lume.Page): string { return `/blog/${page.data.title}/` }