mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2025-10-14 17:35:53 +02:00
chore: update
This commit is contained in:
@@ -10,20 +10,18 @@ interface CategoriesQueryResult {
|
||||
}
|
||||
|
||||
const useCategoriesList = () => {
|
||||
const { allMarkdownRemark } = useStaticQuery<CategoriesQueryResult>(
|
||||
graphql`
|
||||
query CategoriesListQuery {
|
||||
allMarkdownRemark(
|
||||
filter: { frontmatter: { template: { eq: "post" }, draft: { ne: true } } }
|
||||
) {
|
||||
group(field: { frontmatter: { category: SELECT } }) {
|
||||
fieldValue
|
||||
totalCount
|
||||
}
|
||||
const { allMarkdownRemark } = useStaticQuery<CategoriesQueryResult>(graphql`
|
||||
query CategoriesListQuery {
|
||||
allMarkdownRemark(
|
||||
filter: { frontmatter: { template: { eq: "post" }, draft: { ne: true } } }
|
||||
) {
|
||||
group(field: { frontmatter: { category: SELECT } }) {
|
||||
fieldValue
|
||||
totalCount
|
||||
}
|
||||
}
|
||||
`
|
||||
);
|
||||
}
|
||||
`);
|
||||
|
||||
return allMarkdownRemark.group ?? [];
|
||||
};
|
||||
|
@@ -1,52 +1,50 @@
|
||||
import { graphql, useStaticQuery } from "gatsby";
|
||||
|
||||
const useSiteMetadata = () => {
|
||||
const { site } = useStaticQuery(
|
||||
graphql`
|
||||
query SiteMetaData {
|
||||
site {
|
||||
siteMetadata {
|
||||
author {
|
||||
bio
|
||||
name
|
||||
photo
|
||||
contacts {
|
||||
rss
|
||||
line
|
||||
email
|
||||
weibo
|
||||
gitlab
|
||||
medium
|
||||
github
|
||||
twitter
|
||||
codepen
|
||||
youtube
|
||||
facebook
|
||||
linkedin
|
||||
telegram
|
||||
instagram
|
||||
soundcloud
|
||||
phone
|
||||
}
|
||||
const { site } = useStaticQuery(graphql`
|
||||
query SiteMetaData {
|
||||
site {
|
||||
siteMetadata {
|
||||
author {
|
||||
bio
|
||||
name
|
||||
photo
|
||||
contacts {
|
||||
rss
|
||||
line
|
||||
email
|
||||
weibo
|
||||
gitlab
|
||||
medium
|
||||
github
|
||||
twitter
|
||||
codepen
|
||||
youtube
|
||||
facebook
|
||||
linkedin
|
||||
telegram
|
||||
instagram
|
||||
soundcloud
|
||||
phone
|
||||
}
|
||||
menu {
|
||||
path
|
||||
label
|
||||
}
|
||||
legalMenu {
|
||||
path
|
||||
label
|
||||
}
|
||||
url
|
||||
title
|
||||
subtitle
|
||||
copyright
|
||||
disqusShortname
|
||||
}
|
||||
menu {
|
||||
path
|
||||
label
|
||||
}
|
||||
legalMenu {
|
||||
path
|
||||
label
|
||||
}
|
||||
url
|
||||
title
|
||||
subtitle
|
||||
copyright
|
||||
disqusShortname
|
||||
}
|
||||
}
|
||||
`
|
||||
);
|
||||
}
|
||||
`);
|
||||
|
||||
return site.siteMetadata;
|
||||
};
|
||||
|
@@ -10,20 +10,18 @@ interface TagsQueryResult {
|
||||
}
|
||||
|
||||
const useTagsList = () => {
|
||||
const { allMarkdownRemark } = useStaticQuery<TagsQueryResult>(
|
||||
graphql`
|
||||
query TagsListQuery {
|
||||
allMarkdownRemark(
|
||||
filter: { frontmatter: { template: { eq: "post" }, draft: { ne: true } } }
|
||||
) {
|
||||
group(field: { frontmatter: { tags: SELECT } }) {
|
||||
fieldValue
|
||||
totalCount
|
||||
}
|
||||
const { allMarkdownRemark } = useStaticQuery<TagsQueryResult>(graphql`
|
||||
query TagsListQuery {
|
||||
allMarkdownRemark(
|
||||
filter: { frontmatter: { template: { eq: "post" }, draft: { ne: true } } }
|
||||
) {
|
||||
group(field: { frontmatter: { tags: SELECT } }) {
|
||||
fieldValue
|
||||
totalCount
|
||||
}
|
||||
}
|
||||
`
|
||||
);
|
||||
}
|
||||
`);
|
||||
|
||||
return allMarkdownRemark.group || [];
|
||||
};
|
||||
|
Reference in New Issue
Block a user