type error hotfixes
This commit is contained in:
parent
d189096e96
commit
24a76f8f7c
@ -17,7 +17,9 @@ function FuzzyBar(): JSX.Element {
|
|||||||
let entries = [...pages];
|
let entries = [...pages];
|
||||||
|
|
||||||
for (const [k,v] of posts.entries()) {
|
for (const [k,v] of posts.entries()) {
|
||||||
entries.push({title: v.title, link: `posts/${v.slug}`});
|
const item = v as any;
|
||||||
|
if (item.title && item.slug)
|
||||||
|
entries.push({title: item.title, link: `posts/${item.slug}`});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -11,7 +11,7 @@ module.exports = {
|
|||||||
config.plugins.push(
|
config.plugins.push(
|
||||||
{
|
{
|
||||||
apply: (compiler) => {
|
apply: (compiler) => {
|
||||||
compiler.hooks.initialize.tap('cachePostLinkDataInit', _ => {
|
compiler.hooks.beforeCompile.tap('cachePostLinkDataInit', _ => {
|
||||||
cachePostLinkData();
|
cachePostLinkData();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ import Posts from '../../public/posts.json';
|
|||||||
import prettyDatePrint from '../../util/pretty-date';
|
import prettyDatePrint from '../../util/pretty-date';
|
||||||
|
|
||||||
function HomePage({posts}: any) {
|
function HomePage({posts}: any) {
|
||||||
Posts.sort((x, y) => { return x.title.localeCompare(y.title) });
|
Posts.sort((x, y) => { return (x as any).title.localeCompare((x as any).title) });
|
||||||
// todo: create a table-like interface
|
// todo: create a table-like interface
|
||||||
return (
|
return (
|
||||||
<Layout name='Posts'>
|
<Layout name='Posts'>
|
||||||
|
Loading…
Reference in New Issue
Block a user