UNPKG

soames-gatsby-theme

Version:

A customizable Gatsby theme for personal websites using WordPress as a headless CMS.

34 lines (33 loc) 1.71 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.pageQuery = void 0; const jsx_runtime_1 = require("react/jsx-runtime"); const gatsby_1 = require("gatsby"); const html_react_parser_1 = __importDefault(require("html-react-parser")); const Layout_1 = __importDefault(require("../components/Layout")); const Seo_1 = __importDefault(require("../components/Seo")); const HeroHeader_1 = __importDefault(require("../components/HeroHeader")); const Shortcodes_1 = require("../utils/shortcodes/Shortcodes"); // Gutenberg block styles require("../styles/vendor/wordpress-blocks.css"); const Page = ({ data: { page } }) => ((0, jsx_runtime_1.jsxs)(Layout_1.default, { children: [(0, jsx_runtime_1.jsx)(Seo_1.default, { title: page.title }), (0, jsx_runtime_1.jsx)(HeroHeader_1.default, { title: (0, html_react_parser_1.default)(page.title), subhead: page.excerpt ? (0, html_react_parser_1.default)(page.excerpt) : "", backgroundImage: page.featuredImage?.node.guid || null, backgroundImageTitle: page.featuredImage?.node.title || null }), page.content && ((0, jsx_runtime_1.jsx)("section", { id: "soames-gatsby-content-container", className: "soames-gatsby-content", children: (0, jsx_runtime_1.jsx)(Shortcodes_1.Shortcodes, { children: page.content }) }))] })); exports.default = Page; exports.pageQuery = (0, gatsby_1.graphql) ` query PageById($id: String!) { page: wpPage(id: { eq: $id }) { id title excerpt content featuredImage { node { title guid } } } } `;