soames-gatsby-theme 0.1.0

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.
Files changed (73) hide show
  1. package/LICENSE +29 -0
  2. package/README.md +24 -0
  3. package/dist/gatsby-config.js +47 -0
  4. package/dist/gatsby-node.js +7 -0
  5. package/dist/src/components/Bio.js +23 -0
  6. package/dist/src/components/BlogSidebar.js +30 -0
  7. package/dist/src/components/Footer.js +11 -0
  8. package/dist/src/components/FooterMenu.js +26 -0
  9. package/dist/src/components/Header.js +12 -0
  10. package/dist/src/components/HeaderMenu.js +34 -0
  11. package/dist/src/components/HeroHeader.js +39 -0
  12. package/dist/src/components/Layout.js +24 -0
  13. package/dist/src/components/Logo.js +17 -0
  14. package/dist/src/components/Seo.js +59 -0
  15. package/dist/src/components/shortcodes/RemoveContentAreaPadding.js +12 -0
  16. package/dist/src/components/shortcodes/SoamesFeature.js +9 -0
  17. package/dist/src/components/shortcodes/SoamesGalleryMenu.js +15 -0
  18. package/dist/src/components/shortcodes/SoamesIconList.js +15 -0
  19. package/dist/src/components/shortcodes/SoamesSoundCloud.js +18 -0
  20. package/dist/src/components/shortcodes/SoamesTextBlock.js +8 -0
  21. package/dist/src/components/shortcodes/SoamesTextList.js +8 -0
  22. package/dist/src/components/shortcodes/SoamesTitle.js +7 -0
  23. package/dist/src/components/shortcodes/SoamesTitleBar.js +7 -0
  24. package/dist/src/components/shortcodes/SoamesTitleBarLg.js +25 -0
  25. package/dist/src/components/shortcodes/SoamesVideo.js +8 -0
  26. package/dist/src/pages/index.js +9 -0
  27. package/dist/src/templates/blog-post-archive.js +59 -0
  28. package/dist/src/templates/blog-post.js +67 -0
  29. package/dist/src/templates/page.js +33 -0
  30. package/dist/src/utils/shortcodes/Shortcodes.js +105 -0
  31. package/dist/src/utils/shortcodes/getAttributes.js +18 -0
  32. package/dist/src/utils/shortcodes/getContent.js +7 -0
  33. package/gatsby-browser.js +11 -0
  34. package/gatsby-node.js +138 -0
  35. package/gatsby-ssr.js +12 -0
  36. package/package.json +76 -0
  37. package/src/components/Bio.tsx +63 -0
  38. package/src/components/BlogSidebar.tsx +86 -0
  39. package/src/components/Footer.tsx +53 -0
  40. package/src/components/FooterMenu.tsx +66 -0
  41. package/src/components/Header.tsx +37 -0
  42. package/src/components/HeaderMenu.tsx +123 -0
  43. package/src/components/HeroHeader.tsx +75 -0
  44. package/src/components/Layout.tsx +60 -0
  45. package/src/components/Logo.tsx +49 -0
  46. package/src/components/Seo.tsx +84 -0
  47. package/src/components/shortcodes/RemoveContentAreaPadding.tsx +13 -0
  48. package/src/components/shortcodes/SoamesFeature.tsx +54 -0
  49. package/src/components/shortcodes/SoamesGalleryMenu.tsx +63 -0
  50. package/src/components/shortcodes/SoamesIconList.tsx +57 -0
  51. package/src/components/shortcodes/SoamesSoundCloud.tsx +71 -0
  52. package/src/components/shortcodes/SoamesTextBlock.tsx +27 -0
  53. package/src/components/shortcodes/SoamesTextList.tsx +27 -0
  54. package/src/components/shortcodes/SoamesTitle.tsx +23 -0
  55. package/src/components/shortcodes/SoamesTitleBar.tsx +21 -0
  56. package/src/components/shortcodes/SoamesTitleBarLg.tsx +56 -0
  57. package/src/components/shortcodes/SoamesVideo.tsx +34 -0
  58. package/src/styles/soames/base.css +592 -0
  59. package/src/styles/soames/components.css +1551 -0
  60. package/src/styles/soames/layout.css +209 -0
  61. package/src/styles/soames/overrides.css +1779 -0
  62. package/src/styles/soames/typography.css +23 -0
  63. package/src/styles/theme.css +8 -0
  64. package/src/styles/vendor/normalize.css +343 -0
  65. package/src/styles/vendor/wordpress-blocks.css +3451 -0
  66. package/src/templates/blog-post-archive.tsx +167 -0
  67. package/src/templates/blog-post.tsx +183 -0
  68. package/src/templates/page.tsx +65 -0
  69. package/src/utils/shortcodes/Shortcodes.tsx +119 -0
  70. package/src/utils/shortcodes/getAttributes.ts +19 -0
  71. package/src/utils/shortcodes/getContent.ts +5 -0
  72. package/static/js/soames-nav-dropdown.js +646 -0
  73. package/static/js/soames-navbar-dropdown.js +127 -0
@@ -0,0 +1,86 @@
1
+ // src/components/BlogSidebar.tsx
2
+
3
+ import React from "react";
4
+ import { graphql, useStaticQuery, Link } from "gatsby";
5
+ import parse from "html-react-parser";
6
+
7
+ interface FeaturedImage {
8
+ node: {
9
+ guid: string;
10
+ };
11
+ }
12
+
13
+ interface PostNode {
14
+ id: string;
15
+ excerpt: string;
16
+ uri: string;
17
+ date: string;
18
+ title: string;
19
+ featuredImage?: FeaturedImage;
20
+ }
21
+
22
+ interface SidebarPostArchiveData {
23
+ posts: {
24
+ nodes: PostNode[];
25
+ };
26
+ }
27
+
28
+ interface BlogSidebarProps {
29
+ postId: string;
30
+ }
31
+
32
+ const BlogSidebar: React.FC<BlogSidebarProps> = ({ postId }) => {
33
+ const data = useStaticQuery<SidebarPostArchiveData>(graphql`
34
+ query SidebarPostArchive {
35
+ posts: allWpPost(sort: { date: DESC }) {
36
+ nodes {
37
+ id
38
+ excerpt
39
+ uri
40
+ date(formatString: "MMMM DD, YYYY")
41
+ title
42
+ featuredImage {
43
+ node {
44
+ guid
45
+ }
46
+ }
47
+ }
48
+ }
49
+ }
50
+ `);
51
+
52
+ return (
53
+ <section className="soames-blog-roll pt-3">
54
+ <div className="container">
55
+ {data.posts.nodes.map((post, index) =>
56
+ post.id !== postId ? (
57
+ <div key={index} className="media-container-row">
58
+ <div className="card p-3 col-12">
59
+ <div className="card-wrapper">
60
+ <div className="card-box">
61
+ <h4 className="card-title mbr-fonts-style display-5">
62
+ {parse(post.title)}
63
+ </h4>
64
+ <h4 className="mbr-fonts-style display-7">{post.date}</h4>
65
+ {parse(post.excerpt)}
66
+ </div>
67
+ <div className="mbr-section-btn text-center">
68
+ <Link
69
+ to={`/blog${post.uri}`}
70
+ itemProp="url"
71
+ className="btn btn-primary display-4"
72
+ >
73
+ <span itemProp="headline">Read More</span>
74
+ </Link>
75
+ </div>
76
+ </div>
77
+ </div>
78
+ </div>
79
+ ) : null
80
+ )}
81
+ </div>
82
+ </section>
83
+ );
84
+ };
85
+
86
+ export default BlogSidebar;
@@ -0,0 +1,53 @@
1
+ import React from "react";
2
+ import FooterMenu from "./FooterMenu";
3
+
4
+ interface FooterProps {
5
+ title: string;
6
+ }
7
+
8
+ const Footer: React.FC<FooterProps> = ({ title }) => {
9
+ return (
10
+ <section className="soames-footer mt-5">
11
+ <div className="container">
12
+ <div className="media-container-row content text-white">
13
+ <div className="col-12 col-md-2">
14
+ <div className="media-wrap">{` `}</div>
15
+ </div>
16
+ <div className="col-12 col-md-4 mbr-fonts-style display-7">
17
+ <h5 className="pb-3">Links</h5>
18
+ <FooterMenu />
19
+ </div>
20
+ <div className="col-12 col-md-4 mbr-fonts-style display-7">
21
+ <h5 className="pb-3">Contact</h5>
22
+ <p className="soames-text pr-3">
23
+ fritz followed by ASCII 0x40 followed by the domain name of this site.
24
+ </p>
25
+ <p className="soames-text pt-3">
26
+ © {new Date().getFullYear()} {title}
27
+ <br />
28
+ Built with{" "}
29
+ <a href="https://www.soames.app" target="_blank" rel="noreferrer">
30
+ Soames
31
+ </a>
32
+ ,{" "}
33
+ <a href="https://www.gatsbyjs.com" target="_blank" rel="noreferrer">
34
+ Gatsby
35
+ </a>
36
+ , and{" "}
37
+ <a href="https://wordpress.org/" target="_blank" rel="noreferrer">
38
+ WordPress
39
+ </a>
40
+ <br />
41
+ <br />
42
+ </p>
43
+ </div>
44
+ <div className="col-12 col-md-2 mbr-fonts-style display-7">
45
+ <h5 className="pb-3">{` `}</h5>
46
+ </div>
47
+ </div>
48
+ </div>
49
+ </section>
50
+ );
51
+ };
52
+
53
+ export default Footer;
@@ -0,0 +1,66 @@
1
+ import React from "react";
2
+ import { graphql, useStaticQuery, Link } from "gatsby";
3
+
4
+ interface MenuItem {
5
+ id: string;
6
+ label: string;
7
+ parentDatabaseId: number;
8
+ path: string;
9
+ uri: string;
10
+ order: number;
11
+ }
12
+
13
+ interface FooterMenuData {
14
+ wpMenu: {
15
+ id: string;
16
+ name: string;
17
+ menuItems: {
18
+ nodes: MenuItem[];
19
+ };
20
+ };
21
+ }
22
+
23
+ const FooterMenu: React.FC = () => {
24
+ const data: FooterMenuData = useStaticQuery(graphql`
25
+ query WpFooterMenu {
26
+ wpMenu(name: { eq: "soames-footer-menu" }) {
27
+ id
28
+ name
29
+ menuItems {
30
+ nodes {
31
+ id
32
+ label
33
+ parentDatabaseId
34
+ path
35
+ uri
36
+ order
37
+ }
38
+ }
39
+ }
40
+ }
41
+ `);
42
+
43
+ return (
44
+ <div className="soames-footer-content">
45
+ <ul>
46
+ {data.wpMenu.menuItems.nodes.map((item) =>
47
+ item.parentDatabaseId === 0 ? (
48
+ item.uri.includes("http") ? (
49
+ <li className="soames-footer-list-item" key={item.id}>
50
+ <a href={item.uri} target="_blank" rel="noreferrer">
51
+ {item.label}
52
+ </a>
53
+ </li>
54
+ ) : (
55
+ <li className="soames-footer-list-item" key={item.id}>
56
+ <Link to={item.uri}>{item.label}</Link>
57
+ </li>
58
+ )
59
+ ) : null
60
+ )}
61
+ </ul>
62
+ </div>
63
+ );
64
+ };
65
+
66
+ export default FooterMenu;
@@ -0,0 +1,37 @@
1
+ import React from "react";
2
+ import HeaderMenu from "./HeaderMenu";
3
+ import Logo from "./Logo";
4
+
5
+ interface HeaderProps {
6
+ title: string;
7
+ isHomePage: boolean;
8
+ }
9
+
10
+ const Header: React.FC<HeaderProps> = ({ title, isHomePage }) => {
11
+ return (
12
+ <section className="menu soames-menu">
13
+ <nav className="navbar navbar-expand beta-menu navbar-dropdown align-items-center navbar-fixed-top navbar-toggleable-sm">
14
+ <button
15
+ className="navbar-toggler navbar-toggler-right"
16
+ type="button"
17
+ data-bs-toggle="collapse"
18
+ data-bs-target="#navbarSupportedContent"
19
+ aria-controls="navbarSupportedContent"
20
+ aria-expanded="false"
21
+ aria-label="Toggle navigation"
22
+ >
23
+ <div className="hamburger">
24
+ <span></span>
25
+ <span></span>
26
+ <span></span>
27
+ <span></span>
28
+ </div>
29
+ </button>
30
+ <Logo title={title} />
31
+ <HeaderMenu />
32
+ </nav>
33
+ </section>
34
+ );
35
+ };
36
+
37
+ export default Header;
@@ -0,0 +1,123 @@
1
+ import React from "react";
2
+ import { graphql, useStaticQuery, Link } from "gatsby";
3
+
4
+ interface MenuItem {
5
+ id: string;
6
+ label: string;
7
+ parentDatabaseId: number;
8
+ path: string;
9
+ uri: string;
10
+ order: number;
11
+ childItems: {
12
+ nodes: Array<{
13
+ id: string;
14
+ label: string;
15
+ uri: string;
16
+ order: number;
17
+ }>;
18
+ };
19
+ }
20
+
21
+ interface WpMenuQueryData {
22
+ wpMenu: {
23
+ id: string;
24
+ name: string;
25
+ menuItems: {
26
+ nodes: MenuItem[];
27
+ };
28
+ };
29
+ }
30
+
31
+ const HeaderMenu: React.FC = () => {
32
+ const data = useStaticQuery<WpMenuQueryData>(graphql`
33
+ query WpHeaderMenu {
34
+ wpMenu(name: { eq: "soames-header-menu" }) {
35
+ id
36
+ name
37
+ menuItems {
38
+ nodes {
39
+ id
40
+ label
41
+ parentDatabaseId
42
+ path
43
+ uri
44
+ order
45
+ childItems {
46
+ nodes {
47
+ id
48
+ label
49
+ uri
50
+ order
51
+ }
52
+ }
53
+ }
54
+ }
55
+ }
56
+ }
57
+ `);
58
+
59
+ return (
60
+ <div className="collapse navbar-collapse" id="navbarSupportedContent">
61
+ <ul className="navbar-nav nav-dropdown nav-right" data-app-modern-menu="true">
62
+ {data.wpMenu.menuItems.nodes.map((item) =>
63
+ item.path !== "/home/" && item.parentDatabaseId === 0 ? (
64
+ item.childItems.nodes.length === 0 ? (
65
+ <li key={item.id} className="nav-item">
66
+ {item.uri.includes("http") ? (
67
+ <a
68
+ className="nav-link link text-white display-4"
69
+ href={item.uri}
70
+ target="_blank"
71
+ rel="noreferrer"
72
+ >
73
+ {item.label}
74
+ </a>
75
+ ) : (
76
+ <Link to={item.uri} className="nav-link link text-white display-4">
77
+ {item.label}
78
+ </Link>
79
+ )}
80
+ </li>
81
+ ) : (
82
+ <li key={item.id} className="nav-item dropdown">
83
+ <a
84
+ className="nav-link link text-white dropdown-toggle display-4"
85
+ href={item.uri}
86
+ data-toggle="dropdown-submenu"
87
+ aria-expanded="false"
88
+ >
89
+ {item.label}
90
+ </a>
91
+ <div className="dropdown-menu">
92
+ <ul className="navbar-nav nav-dropdown nav-right">
93
+ {item.childItems.nodes.map((childItem) => (
94
+ <li key={childItem.id}>
95
+ {childItem.uri.includes("http") ? (
96
+ <a
97
+ className="text-white dropdown-item display-4"
98
+ target="_blank"
99
+ rel="noreferrer"
100
+ href={childItem.uri}
101
+ >
102
+ {childItem.label}
103
+ <br />
104
+ </a>
105
+ ) : (
106
+ <Link to={childItem.uri} className="text-white dropdown-item display-4">
107
+ {childItem.label}
108
+ </Link>
109
+ )}
110
+ </li>
111
+ ))}
112
+ </ul>
113
+ </div>
114
+ </li>
115
+ )
116
+ ) : null
117
+ )}
118
+ </ul>
119
+ </div>
120
+ );
121
+ };
122
+
123
+ export default HeaderMenu;
@@ -0,0 +1,75 @@
1
+ import React from "react";
2
+
3
+ export interface HeroHeaderProps {
4
+ title: React.ReactNode;
5
+ subhead?: React.ReactNode;
6
+ backgroundImage?: string | null;
7
+ backgroundImageTitle?: string | null;
8
+ overlayOpacity?: number;
9
+ }
10
+
11
+ const HeroHeader = ({
12
+ title,
13
+ subhead,
14
+ backgroundImage,
15
+ backgroundImageTitle,
16
+ overlayOpacity,
17
+ }: HeroHeaderProps) => {
18
+ if (!backgroundImage) {
19
+ backgroundImage = "https://picsum.photos/1080/720";
20
+ } else {
21
+ if (backgroundImageTitle?.includes("_03o_")) overlayOpacity = 0.3;
22
+ else if (backgroundImageTitle?.includes("_04o_")) overlayOpacity = 0.4;
23
+ else if (backgroundImageTitle?.includes("_05o_")) overlayOpacity = 0.5;
24
+ else if (backgroundImageTitle?.includes("_06o_")) overlayOpacity = 0.6;
25
+ else if (backgroundImageTitle?.includes("_07o_")) overlayOpacity = 0.7;
26
+ }
27
+
28
+ if (!overlayOpacity) {
29
+ overlayOpacity = 0.6;
30
+ }
31
+
32
+ const css = `
33
+ .soames-background-lg::after {
34
+ background: url(${backgroundImage});
35
+ background-position: 50% 50%;
36
+ background-size: cover;
37
+ background-repeat: no-repeat;
38
+ position: fixed;
39
+ top: 0px;
40
+ left: 0px;
41
+ overflow: hidden;
42
+ pointer-events: none;
43
+ margin-top: -180px;
44
+ }
45
+ `;
46
+
47
+ return (
48
+ <>
49
+ <style>{css}</style>
50
+ <section
51
+ className="soames-header-lg soames-parallax soames-background-lg"
52
+ id="header1"
53
+ >
54
+ <div
55
+ className="soames-overlay"
56
+ style={{ opacity: overlayOpacity, backgroundColor: "rgb(46, 46, 46)" }}
57
+ />
58
+ <div className="container">
59
+ <div className="row justify-content-md-center">
60
+ <div className="soames-hero-header soames-white col-md-10">
61
+ <h1 className="soames-section-title align-center soames-bold mbr-fonts-style display-1">
62
+ {title}
63
+ </h1>
64
+ <div className="soames-section-subtitle align-center soames-light soames-white mbr-fonts-style display-5">
65
+ {subhead}
66
+ </div>
67
+ </div>
68
+ </div>
69
+ </div>
70
+ </section>
71
+ </>
72
+ );
73
+ };
74
+
75
+ export default HeroHeader;
@@ -0,0 +1,60 @@
1
+ import React, { ReactNode } from "react";
2
+ import { useStaticQuery, graphql } from "gatsby";
3
+ import { Helmet } from "react-helmet";
4
+
5
+ import Header from "./Header";
6
+ import Footer from "./Footer";
7
+
8
+ import "../styles/theme.css";
9
+
10
+ type LayoutProps = {
11
+ isHomePage?: boolean;
12
+ children: ReactNode;
13
+ };
14
+
15
+ const Layout: React.FC<LayoutProps> = ({ isHomePage = false, children }) => {
16
+ const {
17
+ wp: {
18
+ generalSettings: { title },
19
+ },
20
+ wpMediaItem,
21
+ } = useStaticQuery(graphql`
22
+ query LayoutQuery {
23
+ wp {
24
+ generalSettings {
25
+ title
26
+ description
27
+ }
28
+ }
29
+ wpMediaItem(title: { eq: "favicon" }) {
30
+ title
31
+ guid
32
+ }
33
+ }
34
+ `);
35
+
36
+ return (
37
+ <div className="global-wrapper" data-is-root-path={isHomePage}>
38
+ <Helmet>
39
+ {wpMediaItem && (
40
+ <link
41
+ rel="icon"
42
+ href={wpMediaItem.guid}
43
+ type="image/png"
44
+ />
45
+ )}
46
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
47
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />
48
+ <link
49
+ rel="stylesheet"
50
+ href="https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300;0,400;0,500;0,700;0,900;1,300;1,400;1,500;1,700;1,900&display=swap"
51
+ />
52
+ </Helmet>
53
+ <main>
54
+ {children}
55
+ </main>
56
+ </div>
57
+ );
58
+ };
59
+
60
+ export default Layout;
@@ -0,0 +1,49 @@
1
+ import React from "react";
2
+ import { graphql, useStaticQuery } from "gatsby";
3
+
4
+ interface LogoProps {
5
+ title: string;
6
+ }
7
+
8
+ interface LogoQueryData {
9
+ wpMediaItem: {
10
+ title: string;
11
+ guid: string;
12
+ } | null;
13
+ }
14
+
15
+ const Logo: React.FC<LogoProps> = ({ title }) => {
16
+ const data = useStaticQuery<LogoQueryData>(graphql`
17
+ query LogoQuery {
18
+ wpMediaItem(title: { eq: "logo" }) {
19
+ title
20
+ guid
21
+ }
22
+ }
23
+ `);
24
+
25
+ const logo = data.wpMediaItem;
26
+
27
+ return (
28
+ <div className="menu-logo">
29
+ <div className="navbar-brand">
30
+ <span className="navbar-caption-wrap">
31
+ <a className="navbar-caption text-white display-5" href="/">
32
+ {logo ? (
33
+ <img width="108" alt={logo.title} src={logo.guid} />
34
+ ) : (
35
+ <img
36
+ width="108"
37
+ alt="Orbi Software"
38
+ src="https://orbivision.net/wp-content/uploads/2023/01/punch_card.png"
39
+ />
40
+ )}
41
+ &nbsp;&nbsp;{title}
42
+ </a>
43
+ </span>
44
+ </div>
45
+ </div>
46
+ );
47
+ };
48
+
49
+ export default Logo;
@@ -0,0 +1,84 @@
1
+ import React from "react";
2
+ import { Helmet } from "react-helmet";
3
+ import { useStaticQuery, graphql } from "gatsby";
4
+
5
+ interface SeoProps {
6
+ title: string;
7
+ description?: string;
8
+ lang?: string;
9
+ meta?: Array<{
10
+ name?: string;
11
+ property?: string;
12
+ content: string;
13
+ }>;
14
+ }
15
+
16
+ const Seo: React.FC<SeoProps> = ({
17
+ title,
18
+ description = "",
19
+ lang = "en",
20
+ meta = [],
21
+ }) => {
22
+ const { wp, wpUser } = useStaticQuery(graphql`
23
+ query {
24
+ wp {
25
+ generalSettings {
26
+ title
27
+ description
28
+ }
29
+ }
30
+ wpUser {
31
+ name
32
+ }
33
+ }
34
+ `);
35
+
36
+ const metaDescription = description || wp.generalSettings?.description;
37
+ const defaultTitle = wp.generalSettings?.title;
38
+ const twitterHandle = wpUser?.name || "";
39
+
40
+ return (
41
+ <Helmet
42
+ htmlAttributes={{ lang }}
43
+ title={title}
44
+ titleTemplate={defaultTitle ? `%s | ${defaultTitle}` : undefined}
45
+ meta={[
46
+ {
47
+ name: "description",
48
+ content: metaDescription,
49
+ },
50
+ {
51
+ property: "og:title",
52
+ content: title,
53
+ },
54
+ {
55
+ property: "og:description",
56
+ content: metaDescription,
57
+ },
58
+ {
59
+ property: "og:type",
60
+ content: "website",
61
+ },
62
+ {
63
+ name: "twitter:card",
64
+ content: "summary",
65
+ },
66
+ {
67
+ name: "twitter:creator",
68
+ content: twitterHandle,
69
+ },
70
+ {
71
+ name: "twitter:title",
72
+ content: title,
73
+ },
74
+ {
75
+ name: "twitter:description",
76
+ content: metaDescription,
77
+ },
78
+ ...meta,
79
+ ]}
80
+ />
81
+ );
82
+ };
83
+
84
+ export default Seo;
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+
3
+ const RemoveContentAreaPadding: React.FC = () => {
4
+ const css = `
5
+ .soames-gatsby-content {
6
+ padding: 0px;
7
+ }
8
+ `;
9
+
10
+ return <style>{css}</style>;
11
+ };
12
+
13
+ export default RemoveContentAreaPadding;