Dont fail if page has no frontmatter

Luke Karrys committed Oct 17, 2023 at 08:31 UTC 08f5912d96d3ed3e1227c09fd214d33b20343cd5
3 files changed +2 -4
cli/package.json
+1 -2
@@ -14,8 +14,7 @@
14 "lintfix": "npm run lint -- --fix",
15 "snap": "tap",
16 "test": "tap",
17 - "posttest": "npm run lint",
18 - "format": "prettier --write ."
17 + "posttest": "npm run lint"
18 },
19 "dependencies": {
20 "@octokit/rest": "^20.0.2",
src/components/search-results.js
-1
@@ -34,7 +34,6 @@ function SearchResults({results, getItemProps, highlightedIndex}) {
34 color: 'fg.default',
35 fontSize: 1,
36 bg: highlightedIndex === index ? 'neutral.muted' : 'transparent',
37 - cursor: 'pointer',
37 }}
38 {...getItemProps({item, index})}
39 >
src/layout.js
+1 -1
@@ -15,7 +15,7 @@ export const usePageContext = () => React.useContext(PageContext)
15 export const useLocation = () => React.useContext(LocationContext)
16
17 const Head = () => {
18 - const {frontmatter} = usePageContext()
18 + const {frontmatter = {}} = usePageContext()
19 const siteMetadata = useSiteMetdata()
20
21 const title = [frontmatter.title, siteMetadata.title].filter(Boolean).join(' | ')