soames-gatsby-theme 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,24 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const jsx_runtime_1 = require("react/jsx-runtime");
4
- const HeroHeader = ({ title, subhead, backgroundImage, backgroundImageTitle, overlayOpacity, }) => {
4
+ const HeroHeader = ({ title, subhead, backgroundImage, overlayOpacity, }) => {
5
5
  if (!backgroundImage) {
6
6
  backgroundImage = "https://picsum.photos/1080/720";
7
7
  }
8
- else {
9
- if (backgroundImageTitle?.includes("_02o_"))
10
- overlayOpacity = 0.2;
11
- else if (backgroundImageTitle?.includes("_03o_"))
12
- overlayOpacity = 0.3;
13
- else if (backgroundImageTitle?.includes("_04o_"))
14
- overlayOpacity = 0.4;
15
- else if (backgroundImageTitle?.includes("_05o_"))
16
- overlayOpacity = 0.5;
17
- else if (backgroundImageTitle?.includes("_06o_"))
18
- overlayOpacity = 0.6;
19
- else if (backgroundImageTitle?.includes("_07o_"))
20
- overlayOpacity = 0.7;
21
- }
22
8
  if (!overlayOpacity) {
23
9
  overlayOpacity = 0.6;
24
10
  }
@@ -69,9 +69,9 @@ const PreviewPage = () => {
69
69
  const heroBg = isPost
70
70
  ? (content.blogHero?.guid ?? null)
71
71
  : (content.featuredImage?.sourceUrl ?? null);
72
- const heroBgTitle = isPost
73
- ? (content.blogHero?.title ?? null)
74
- : (content.title ?? null);
75
- return ((0, jsx_runtime_1.jsxs)(Layout_1.default, { children: [(0, jsx_runtime_1.jsx)(Seo_1.default, { title: `Preview: ${content.title ?? ""}` }), (0, jsx_runtime_1.jsx)(HeroHeader_1.default, { title: heroTitle, subhead: heroSubhead, backgroundImage: heroBg, backgroundImageTitle: heroBgTitle }), isPost ? ((0, jsx_runtime_1.jsx)("section", { children: (0, jsx_runtime_1.jsxs)("div", { className: "media-container-row", children: [(0, jsx_runtime_1.jsx)("div", { className: "col-12 col-lg-8", children: (0, jsx_runtime_1.jsx)("section", { id: "soames-gatsby-content-container", className: "soames-gatsby-blog-content", children: (0, jsx_runtime_1.jsxs)("article", { className: "blog-post", itemScope: true, itemType: "http://schema.org/Article", children: [(0, jsx_runtime_1.jsxs)("header", { children: [(0, jsx_runtime_1.jsx)("h1", { itemProp: "headline", children: content.title ? (0, html_react_parser_1.default)(content.title) : "" }), content.date && (0, jsx_runtime_1.jsx)("p", { children: content.date })] }), content.content && ((0, jsx_runtime_1.jsx)("section", { itemProp: "articleBody", className: "blog-post-content", children: (0, html_react_parser_1.default)(content.content) })), (0, jsx_runtime_1.jsx)("hr", {}), (0, jsx_runtime_1.jsx)("footer", { children: (0, jsx_runtime_1.jsx)(Bio_1.default, {}) })] }) }) }), (0, jsx_runtime_1.jsx)("div", { className: "col-12 col-lg-4", children: (0, jsx_runtime_1.jsxs)("section", { id: "soames-gatsby-sidebar-container", className: "soames-gatsby-sidebar", children: [content.featuredImage?.sourceUrl && ((0, jsx_runtime_1.jsx)("img", { src: content.featuredImage.sourceUrl, alt: content.featuredImage.altText || "", style: { marginBottom: 50, width: "100%" } })), (0, jsx_runtime_1.jsx)("h1", { children: "Recent Posts" }), (0, jsx_runtime_1.jsx)(BlogSidebar_1.default, { postId: "" })] }) })] }) })) : (content.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: content.content }) })))] }));
72
+ const heroOpacityStr = isPost
73
+ ? (content.blogHero?.overlayOpacity ?? null)
74
+ : (content.overlayOpacity ?? null);
75
+ return ((0, jsx_runtime_1.jsxs)(Layout_1.default, { children: [(0, jsx_runtime_1.jsx)(Seo_1.default, { title: `Preview: ${content.title ?? ""}` }), (0, jsx_runtime_1.jsx)(HeroHeader_1.default, { title: heroTitle, subhead: heroSubhead, backgroundImage: heroBg, overlayOpacity: heroOpacityStr ? parseFloat(heroOpacityStr) : undefined }), isPost ? ((0, jsx_runtime_1.jsx)("section", { children: (0, jsx_runtime_1.jsxs)("div", { className: "media-container-row", children: [(0, jsx_runtime_1.jsx)("div", { className: "col-12 col-lg-8", children: (0, jsx_runtime_1.jsx)("section", { id: "soames-gatsby-content-container", className: "soames-gatsby-blog-content", children: (0, jsx_runtime_1.jsxs)("article", { className: "blog-post", itemScope: true, itemType: "http://schema.org/Article", children: [(0, jsx_runtime_1.jsxs)("header", { children: [(0, jsx_runtime_1.jsx)("h1", { itemProp: "headline", children: content.title ? (0, html_react_parser_1.default)(content.title) : "" }), content.date && (0, jsx_runtime_1.jsx)("p", { children: content.date })] }), content.content && ((0, jsx_runtime_1.jsx)("section", { itemProp: "articleBody", className: "blog-post-content", children: (0, html_react_parser_1.default)(content.content) })), (0, jsx_runtime_1.jsx)("hr", {}), (0, jsx_runtime_1.jsx)("footer", { children: (0, jsx_runtime_1.jsx)(Bio_1.default, {}) })] }) }) }), (0, jsx_runtime_1.jsx)("div", { className: "col-12 col-lg-4", children: (0, jsx_runtime_1.jsxs)("section", { id: "soames-gatsby-sidebar-container", className: "soames-gatsby-sidebar", children: [content.featuredImage?.sourceUrl && ((0, jsx_runtime_1.jsx)("img", { src: content.featuredImage.sourceUrl, alt: content.featuredImage.altText || "", style: { marginBottom: 50, width: "100%" } })), (0, jsx_runtime_1.jsx)("h1", { children: "Recent Posts" }), (0, jsx_runtime_1.jsx)(BlogSidebar_1.default, { postId: "" })] }) })] }) })) : (content.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: content.content }) })))] }));
76
76
  };
77
77
  exports.default = PreviewPage;
@@ -15,7 +15,7 @@ const BlogIndex = ({ data, pageContext }) => {
15
15
  const archive = data.wpPage;
16
16
  const { nextPagePath, previousPagePath } = pageContext;
17
17
  if (!posts.length) {
18
- return ((0, jsx_runtime_1.jsxs)(Layout_1.default, { children: [(0, jsx_runtime_1.jsx)(Seo_1.default, { title: "All posts" }), (0, jsx_runtime_1.jsx)(HeroHeader_1.default, { title: archive.title ? (0, html_react_parser_1.default)(archive.title) : "Blog", subhead: archive.excerpt ? (0, html_react_parser_1.default)(archive.excerpt) : "", backgroundImage: archive.featuredImage?.node.guid || null, backgroundImageTitle: archive.featuredImage?.node.title || null }), (0, jsx_runtime_1.jsx)("p", { children: "No blog posts found. Add posts to your WordPress site and they'll appear here!" })] }));
18
+ return ((0, jsx_runtime_1.jsxs)(Layout_1.default, { children: [(0, jsx_runtime_1.jsx)(Seo_1.default, { title: "All posts" }), (0, jsx_runtime_1.jsx)(HeroHeader_1.default, { title: archive.title ? (0, html_react_parser_1.default)(archive.title) : "Blog", subhead: archive.excerpt ? (0, html_react_parser_1.default)(archive.excerpt) : "", backgroundImage: archive.featuredImage?.node.guid || null, overlayOpacity: archive.overlayOpacity ? parseFloat(archive.overlayOpacity) : undefined }), (0, jsx_runtime_1.jsx)("p", { children: "No blog posts found. Add posts to your WordPress site and they'll appear here!" })] }));
19
19
  }
20
20
  const groupedPosts = posts.reduce((groups, post, index) => {
21
21
  if (index % 3 === 0) {
@@ -26,7 +26,7 @@ const BlogIndex = ({ data, pageContext }) => {
26
26
  }
27
27
  return groups;
28
28
  }, []);
29
- return ((0, jsx_runtime_1.jsxs)(Layout_1.default, { isHomePage: true, children: [(0, jsx_runtime_1.jsx)(Seo_1.default, { title: "All posts" }), (0, jsx_runtime_1.jsx)(HeroHeader_1.default, { title: archive.title ? (0, html_react_parser_1.default)(archive.title) : "Blog", subhead: archive.excerpt ? (0, html_react_parser_1.default)(archive.excerpt) : "", backgroundImage: archive.featuredImage?.node.guid || null, backgroundImageTitle: archive.featuredImage?.node.title || null }), (0, jsx_runtime_1.jsx)("section", { className: "soames-blog-roll", children: (0, jsx_runtime_1.jsx)("div", { className: "container", children: groupedPosts.map((group, index) => ((0, jsx_runtime_1.jsx)("div", { className: "media-container-row", children: group.map((post, idx) => ((0, jsx_runtime_1.jsx)("div", { className: "card p-3 col-12 col-lg-4", children: (0, jsx_runtime_1.jsxs)("div", { className: "card-wrapper", children: [(0, jsx_runtime_1.jsxs)("div", { className: "card-box", children: [(0, jsx_runtime_1.jsx)("h4", { className: "card-title mbr-fonts-style display-5", children: (0, html_react_parser_1.default)(post.title) }), (0, jsx_runtime_1.jsx)("h4", { className: "mbr-fonts-style display-7", children: post.date }), (0, html_react_parser_1.default)(post.excerpt)] }), (0, jsx_runtime_1.jsx)("div", { className: "mbr-section-btn text-center", children: (0, jsx_runtime_1.jsx)(gatsby_1.Link, { to: `/blog${post.uri}`, itemProp: "url", className: "btn btn-primary display-4", children: (0, jsx_runtime_1.jsx)("span", { itemProp: "headline", children: "Read More" }) }) })] }) }, idx))) }, index))) }) }), (0, jsx_runtime_1.jsxs)("section", { children: [previousPagePath && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(gatsby_1.Link, { to: `/blog${previousPagePath}`, children: "Previous page" }), (0, jsx_runtime_1.jsx)("br", {})] })), nextPagePath && (0, jsx_runtime_1.jsx)(gatsby_1.Link, { to: `/blog${nextPagePath}`, children: "Next page" })] })] }));
29
+ return ((0, jsx_runtime_1.jsxs)(Layout_1.default, { isHomePage: true, children: [(0, jsx_runtime_1.jsx)(Seo_1.default, { title: "All posts" }), (0, jsx_runtime_1.jsx)(HeroHeader_1.default, { title: archive.title ? (0, html_react_parser_1.default)(archive.title) : "Blog", subhead: archive.excerpt ? (0, html_react_parser_1.default)(archive.excerpt) : "", backgroundImage: archive.featuredImage?.node.guid || null, overlayOpacity: archive.overlayOpacity ? parseFloat(archive.overlayOpacity) : undefined }), (0, jsx_runtime_1.jsx)("section", { className: "soames-blog-roll", children: (0, jsx_runtime_1.jsx)("div", { className: "container", children: groupedPosts.map((group, index) => ((0, jsx_runtime_1.jsx)("div", { className: "media-container-row", children: group.map((post, idx) => ((0, jsx_runtime_1.jsx)("div", { className: "card p-3 col-12 col-lg-4", children: (0, jsx_runtime_1.jsxs)("div", { className: "card-wrapper", children: [(0, jsx_runtime_1.jsxs)("div", { className: "card-box", children: [(0, jsx_runtime_1.jsx)("h4", { className: "card-title mbr-fonts-style display-5", children: (0, html_react_parser_1.default)(post.title) }), (0, jsx_runtime_1.jsx)("h4", { className: "mbr-fonts-style display-7", children: post.date }), (0, html_react_parser_1.default)(post.excerpt)] }), (0, jsx_runtime_1.jsx)("div", { className: "mbr-section-btn text-center", children: (0, jsx_runtime_1.jsx)(gatsby_1.Link, { to: `/blog${post.uri}`, itemProp: "url", className: "btn btn-primary display-4", children: (0, jsx_runtime_1.jsx)("span", { itemProp: "headline", children: "Read More" }) }) })] }) }, idx))) }, index))) }) }), (0, jsx_runtime_1.jsxs)("section", { children: [previousPagePath && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(gatsby_1.Link, { to: `/blog${previousPagePath}`, children: "Previous page" }), (0, jsx_runtime_1.jsx)("br", {})] })), nextPagePath && (0, jsx_runtime_1.jsx)(gatsby_1.Link, { to: `/blog${nextPagePath}`, children: "Next page" })] })] }));
30
30
  };
31
31
  exports.default = BlogIndex;
32
32
  exports.pageQuery = (0, gatsby_1.graphql) `
@@ -48,10 +48,10 @@ exports.pageQuery = (0, gatsby_1.graphql) `
48
48
  wpPage(isPostsPage: { eq: true }) {
49
49
  title
50
50
  excerpt
51
+ overlayOpacity
51
52
  featuredImage {
52
53
  node {
53
54
  guid
54
- title
55
55
  }
56
56
  }
57
57
  }
@@ -18,7 +18,7 @@ const BlogPostTemplate = ({ data }) => {
18
18
  const { post, previous, next, page } = data;
19
19
  const featuredImageData = post.featuredImage?.node?.gatsbyImage ?? null;
20
20
  const featuredImageAlt = post.featuredImage?.node?.altText || "Featured image";
21
- return ((0, jsx_runtime_1.jsxs)(Layout_1.default, { children: [(0, jsx_runtime_1.jsx)(Seo_1.default, { title: post.title || "", description: post.excerpt || undefined }), (0, jsx_runtime_1.jsx)(HeroHeader_1.default, { title: page?.title ? (0, html_react_parser_1.default)(page.title) : "Blog", subhead: page?.excerpt ? (0, html_react_parser_1.default)(page.excerpt) : "", backgroundImage: page?.featuredImage?.node?.guid || null, backgroundImageTitle: page?.title || null }), (0, jsx_runtime_1.jsx)("section", { children: (0, jsx_runtime_1.jsxs)("div", { className: "media-container-row", children: [(0, jsx_runtime_1.jsx)("div", { className: "col-12 col-lg-8", children: (0, jsx_runtime_1.jsxs)("section", { id: "soames-gatsby-content-container", className: "soames-gatsby-blog-content", children: [(0, jsx_runtime_1.jsxs)("article", { className: "blog-post", itemScope: true, itemType: "http://schema.org/Article", children: [(0, jsx_runtime_1.jsxs)("header", { children: [(0, jsx_runtime_1.jsx)("h1", { itemProp: "headline", children: post.title ? (0, html_react_parser_1.default)(post.title) : "" }), (0, jsx_runtime_1.jsx)("p", { children: post.date })] }), post.content && ((0, jsx_runtime_1.jsx)("section", { itemProp: "articleBody", className: "blog-post-content", children: (0, html_react_parser_1.default)(post.content) })), (0, jsx_runtime_1.jsx)("hr", {}), (0, jsx_runtime_1.jsx)("footer", { children: (0, jsx_runtime_1.jsx)(Bio_1.default, {}) })] }), (0, jsx_runtime_1.jsx)("nav", { className: "blog-post-nav", children: (0, jsx_runtime_1.jsxs)("ul", { style: {
21
+ return ((0, jsx_runtime_1.jsxs)(Layout_1.default, { children: [(0, jsx_runtime_1.jsx)(Seo_1.default, { title: post.title || "", description: post.excerpt || undefined }), (0, jsx_runtime_1.jsx)(HeroHeader_1.default, { title: page?.title ? (0, html_react_parser_1.default)(page.title) : "Blog", subhead: page?.excerpt ? (0, html_react_parser_1.default)(page.excerpt) : "", backgroundImage: page?.featuredImage?.node?.guid || null, overlayOpacity: page?.overlayOpacity ? parseFloat(page.overlayOpacity) : undefined }), (0, jsx_runtime_1.jsx)("section", { children: (0, jsx_runtime_1.jsxs)("div", { className: "media-container-row", children: [(0, jsx_runtime_1.jsx)("div", { className: "col-12 col-lg-8", children: (0, jsx_runtime_1.jsxs)("section", { id: "soames-gatsby-content-container", className: "soames-gatsby-blog-content", children: [(0, jsx_runtime_1.jsxs)("article", { className: "blog-post", itemScope: true, itemType: "http://schema.org/Article", children: [(0, jsx_runtime_1.jsxs)("header", { children: [(0, jsx_runtime_1.jsx)("h1", { itemProp: "headline", children: post.title ? (0, html_react_parser_1.default)(post.title) : "" }), (0, jsx_runtime_1.jsx)("p", { children: post.date })] }), post.content && ((0, jsx_runtime_1.jsx)("section", { itemProp: "articleBody", className: "blog-post-content", children: (0, html_react_parser_1.default)(post.content) })), (0, jsx_runtime_1.jsx)("hr", {}), (0, jsx_runtime_1.jsx)("footer", { children: (0, jsx_runtime_1.jsx)(Bio_1.default, {}) })] }), (0, jsx_runtime_1.jsx)("nav", { className: "blog-post-nav", children: (0, jsx_runtime_1.jsxs)("ul", { style: {
22
22
  display: `flex`,
23
23
  flexWrap: `wrap`,
24
24
  justifyContent: `space-between`,
@@ -57,6 +57,7 @@ exports.pageQuery = (0, gatsby_1.graphql) `
57
57
  page: wpPage(isPostsPage: { eq: true }) {
58
58
  title
59
59
  excerpt
60
+ overlayOpacity
60
61
  featuredImage {
61
62
  node {
62
63
  guid
@@ -13,7 +13,7 @@ const HeroHeader_1 = __importDefault(require("../components/HeroHeader"));
13
13
  const Shortcodes_1 = require("../utils/shortcodes/Shortcodes");
14
14
  // Gutenberg block styles
15
15
  require("../styles/vendor/wordpress-blocks.css");
16
- 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 }) }))] }));
16
+ 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, overlayOpacity: page.overlayOpacity ? parseFloat(page.overlayOpacity) : undefined }), 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 }) }))] }));
17
17
  exports.default = Page;
18
18
  exports.pageQuery = (0, gatsby_1.graphql) `
19
19
  query PageById($id: String!) {
@@ -22,9 +22,9 @@ exports.pageQuery = (0, gatsby_1.graphql) `
22
22
  title
23
23
  excerpt
24
24
  content
25
+ overlayOpacity
25
26
  featuredImage {
26
27
  node {
27
- title
28
28
  guid
29
29
  }
30
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "soames-gatsby-theme",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "A customizable Gatsby theme for personal websites using WordPress as a headless CMS.",
5
5
  "main": "dist/gatsby-config.js",
6
6
  "scripts": {
@@ -4,7 +4,6 @@ export interface HeroHeaderProps {
4
4
  title: React.ReactNode;
5
5
  subhead?: React.ReactNode;
6
6
  backgroundImage?: string | null;
7
- backgroundImageTitle?: string | null;
8
7
  overlayOpacity?: number;
9
8
  }
10
9
 
@@ -12,18 +11,10 @@ const HeroHeader = ({
12
11
  title,
13
12
  subhead,
14
13
  backgroundImage,
15
- backgroundImageTitle,
16
14
  overlayOpacity,
17
15
  }: HeroHeaderProps) => {
18
16
  if (!backgroundImage) {
19
17
  backgroundImage = "https://picsum.photos/1080/720";
20
- } else {
21
- if (backgroundImageTitle?.includes("_02o_")) overlayOpacity = 0.2;
22
- else if (backgroundImageTitle?.includes("_03o_")) overlayOpacity = 0.3;
23
- else if (backgroundImageTitle?.includes("_04o_")) overlayOpacity = 0.4;
24
- else if (backgroundImageTitle?.includes("_05o_")) overlayOpacity = 0.5;
25
- else if (backgroundImageTitle?.includes("_06o_")) overlayOpacity = 0.6;
26
- else if (backgroundImageTitle?.includes("_07o_")) overlayOpacity = 0.7;
27
18
  }
28
19
 
29
20
  if (!overlayOpacity) {
@@ -17,6 +17,7 @@ interface BlogHero {
17
17
  title?: string | null;
18
18
  excerpt?: string | null;
19
19
  guid?: string | null;
20
+ overlayOpacity?: string | null;
20
21
  }
21
22
 
22
23
  interface PreviewContent {
@@ -25,6 +26,7 @@ interface PreviewContent {
25
26
  content?: string;
26
27
  excerpt?: string;
27
28
  date?: string;
29
+ overlayOpacity?: string | null;
28
30
  featuredImage?: FeaturedImage | null;
29
31
  blogHero?: BlogHero | null;
30
32
  }
@@ -109,9 +111,9 @@ const PreviewPage: React.FC = () => {
109
111
  const heroBg = isPost
110
112
  ? (content.blogHero?.guid ?? null)
111
113
  : (content.featuredImage?.sourceUrl ?? null);
112
- const heroBgTitle = isPost
113
- ? (content.blogHero?.title ?? null)
114
- : (content.title ?? null);
114
+ const heroOpacityStr = isPost
115
+ ? (content.blogHero?.overlayOpacity ?? null)
116
+ : (content.overlayOpacity ?? null);
115
117
 
116
118
  return (
117
119
  <Layout>
@@ -120,7 +122,7 @@ const PreviewPage: React.FC = () => {
120
122
  title={heroTitle}
121
123
  subhead={heroSubhead}
122
124
  backgroundImage={heroBg}
123
- backgroundImageTitle={heroBgTitle}
125
+ overlayOpacity={heroOpacityStr ? parseFloat(heroOpacityStr) : undefined}
124
126
  />
125
127
  {isPost ? (
126
128
  <section>
@@ -22,10 +22,10 @@ interface PostNode {
22
22
  interface ArchivePage {
23
23
  title: string;
24
24
  excerpt: string;
25
+ overlayOpacity?: string | null;
25
26
  featuredImage?: {
26
27
  node: {
27
28
  guid: string;
28
- title: string;
29
29
  };
30
30
  };
31
31
  }
@@ -53,7 +53,7 @@ const BlogIndex: React.FC<BlogPostArchiveProps> = ({ data, pageContext }) => {
53
53
  title={archive.title ? parse(archive.title) : "Blog"}
54
54
  subhead={archive.excerpt ? parse(archive.excerpt) : ""}
55
55
  backgroundImage={archive.featuredImage?.node.guid || null}
56
- backgroundImageTitle={archive.featuredImage?.node.title || null}
56
+ overlayOpacity={archive.overlayOpacity ? parseFloat(archive.overlayOpacity) : undefined}
57
57
  />
58
58
  <p>
59
59
  No blog posts found. Add posts to your WordPress site and they'll appear here!
@@ -78,7 +78,7 @@ const BlogIndex: React.FC<BlogPostArchiveProps> = ({ data, pageContext }) => {
78
78
  title={archive.title ? parse(archive.title) : "Blog"}
79
79
  subhead={archive.excerpt ? parse(archive.excerpt) : ""}
80
80
  backgroundImage={archive.featuredImage?.node.guid || null}
81
- backgroundImageTitle={archive.featuredImage?.node.title || null}
81
+ overlayOpacity={archive.overlayOpacity ? parseFloat(archive.overlayOpacity) : undefined}
82
82
  />
83
83
 
84
84
  <section className="soames-blog-roll">
@@ -156,10 +156,10 @@ export const pageQuery = graphql`
156
156
  wpPage(isPostsPage: { eq: true }) {
157
157
  title
158
158
  excerpt
159
+ overlayOpacity
159
160
  featuredImage {
160
161
  node {
161
162
  guid
162
- title
163
163
  }
164
164
  }
165
165
  }
@@ -32,6 +32,7 @@ interface Post {
32
32
  interface Page {
33
33
  title?: string | null;
34
34
  excerpt?: string | null;
35
+ overlayOpacity?: string | null;
35
36
  featuredImage?: {
36
37
  node: {
37
38
  guid?: string | null;
@@ -66,7 +67,7 @@ const BlogPostTemplate: React.FC<BlogPostTemplateProps> = ({ data }) => {
66
67
  title={page?.title ? parse(page.title) : "Blog"}
67
68
  subhead={page?.excerpt ? parse(page.excerpt) : ""}
68
69
  backgroundImage={page?.featuredImage?.node?.guid || null}
69
- backgroundImageTitle={page?.title || null}
70
+ overlayOpacity={page?.overlayOpacity ? parseFloat(page.overlayOpacity) : undefined}
70
71
  />
71
72
  <section>
72
73
  <div className="media-container-row">
@@ -173,6 +174,7 @@ export const pageQuery = graphql`
173
174
  page: wpPage(isPostsPage: { eq: true }) {
174
175
  title
175
176
  excerpt
177
+ overlayOpacity
176
178
  featuredImage {
177
179
  node {
178
180
  guid
@@ -16,9 +16,9 @@ type PageTemplateProps = PageProps<{
16
16
  title: string;
17
17
  excerpt?: string;
18
18
  content?: string;
19
+ overlayOpacity?: string | null;
19
20
  featuredImage?: {
20
21
  node: {
21
- title: string;
22
22
  guid: string;
23
23
  };
24
24
  };
@@ -32,7 +32,7 @@ const Page: React.FC<PageTemplateProps> = ({ data: { page } }) => (
32
32
  title={parse(page.title)}
33
33
  subhead={page.excerpt ? parse(page.excerpt) : ""}
34
34
  backgroundImage={page.featuredImage?.node.guid || null}
35
- backgroundImageTitle={page.featuredImage?.node.title || null}
35
+ overlayOpacity={page.overlayOpacity ? parseFloat(page.overlayOpacity) : undefined}
36
36
  />
37
37
  {page.content && (
38
38
  <section
@@ -54,9 +54,9 @@ export const pageQuery = graphql`
54
54
  title
55
55
  excerpt
56
56
  content
57
+ overlayOpacity
57
58
  featuredImage {
58
59
  node {
59
- title
60
60
  guid
61
61
  }
62
62
  }