gatsby-theme-advanced
Version:
GatsbyJS theme equipped with advanced features.
72 lines (71 loc) • 1.85 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const gatsby_1 = require("gatsby");
const useConfig = () => {
var _a, _b;
const resp = (0, gatsby_1.useStaticQuery)((0, gatsby_1.graphql) `
query UserConfig {
site {
siteMetadata {
config {
contentDir
assetDir
embeddedImageWidth
embeddedVideoWidth
basePath
iconPath
iconCachePaths
iconList {
src
sizes
type
purpose
}
organization {
description
logoUrl
name
url
}
pathPrefix
user {
about
avatar
firstName
github
email
id
lastName
linkedIn
location
twitterName
}
website {
backgroundColor
copyright
description
language
fbAppId
googleAnalyticsId
disqusShortname
logoUrl
name
rss
rssTitle
themeColor
title
titleShort
twitterName
url
}
}
}
}
}
`);
const config = (_b = (_a = resp.site) === null || _a === void 0 ? void 0 : _a.siteMetadata) === null || _b === void 0 ? void 0 : _b.config;
if (!config)
throw Error("useConfig: Failed to query SiteConfig.");
return config;
};
exports.default = useConfig;