Website optimization
- Remove AnyLink and ReactCSSTransitionReplace - Clean up GraphQL queries - Improve getTextualContent method in website utilities - Convert ttf fonts to woff2 - Add title attribute to menu items
This commit is contained in:
@ -8,8 +8,6 @@ import Meta from '../components/Meta';
|
||||
import Search from '../components/Search';
|
||||
import SnippetCard from '../components/SnippetCard';
|
||||
|
||||
import { getRawCodeBlocks as getCodeBlocks } from '../util';
|
||||
|
||||
// ===================================================
|
||||
// Search page
|
||||
// ===================================================
|
||||
@ -20,13 +18,7 @@ const SearchPage = props => {
|
||||
v => v.node.frontmatter.title === snippet.title,
|
||||
).node.html,
|
||||
tags: snippet.attributes.tags,
|
||||
text: snippet.attributes.text,
|
||||
id: snippet.id,
|
||||
code: getCodeBlocks(
|
||||
props.data.allMarkdownRemark.edges.find(
|
||||
v => v.node.frontmatter.title === snippet.title,
|
||||
).node.rawMarkdownBody,
|
||||
).code,
|
||||
}));
|
||||
|
||||
const [searchQuery, setSearchQuery] = React.useState(props.searchQuery);
|
||||
@ -116,26 +108,15 @@ export const searchPageQuery = graphql`
|
||||
title
|
||||
attributes {
|
||||
tags
|
||||
text
|
||||
}
|
||||
}
|
||||
}
|
||||
allMarkdownRemark(
|
||||
limit: 1000
|
||||
sort: { fields: [frontmatter___title], order: ASC }
|
||||
) {
|
||||
totalCount
|
||||
allMarkdownRemark {
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
node {
|
||||
html
|
||||
rawMarkdownBody
|
||||
fields {
|
||||
slug
|
||||
}
|
||||
frontmatter {
|
||||
title
|
||||
tags
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user