Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/resolve build error #229

Merged
merged 3 commits into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
description: `Celestia is a modular consensus and data network, built to enable anyone to easily deploy their own blockchain with minimal overhead.`,
author: `@CelestiaOrg`,
siteUrl: `https://celestia.org`,
// siteUrl: `https://dev.lazyledger.org`, <-- switch to this url for OG meta previews on https://dev.lazyledger.org
// siteUrl: `https://dev.lazyledger.org`, // <-- switch to this url for OG meta previews on https://dev.lazyledger.org
image: `/celestia-default-og-image.jpg`,
},

Expand Down Expand Up @@ -78,6 +78,16 @@ module.exports = {
},
},
"gatsby-plugin-react-helmet",
'gatsby-plugin-sitemap',
{
resolve: 'gatsby-plugin-robots-txt',
options: {
host: "https://dev.lazyledger.org",
sitemap: "https://dev.lazyledger.org/sitemap.xml",
output: "/robots.txt",
policy: [{ userAgent: '*', allow: '/' }]
}
},
{
resolve: `gatsby-transformer-remark`,
options: {
Expand Down
34 changes: 0 additions & 34 deletions gatsby-ssr.js
Original file line number Diff line number Diff line change
@@ -1,34 +0,0 @@
// Fix for Gatsby open graph meta tags are not recognized
// Reordering metatags at build time, priorising OG graph tags first.
// source: https://marcomelilli.com/posts/gatsby-react-helmet-og-meta-tags-are-not-recognized

const { Helmet } = require("react-helmet");

exports.onRenderBody = ({ setHeadComponents, setHtmlAttributes, setBodyAttributes }, pluginOptions) => {
const helmet = Helmet.renderStatic();
setHtmlAttributes(helmet.htmlAttributes.toComponent());
setBodyAttributes(helmet.bodyAttributes.toComponent());
setHeadComponents([
helmet.title.toComponent(),
helmet.link.toComponent(),
helmet.meta.toComponent(),
helmet.noscript.toComponent(),
helmet.script.toComponent(),
helmet.style.toComponent(),
]);
};

exports.onPreRenderHTML = ({ getHeadComponents, replaceHeadComponents }) => {
const headComponents = getHeadComponents();

headComponents.sort((x, y) => {
if (x.props && x.props["data-react-helmet"]) {
return -1;
} else if (y.props && y.props["data-react-helmet"]) {
return 1;
}
return 0;
});

replaceHeadComponents(headComponents);
};
Loading