Skip to content

Commit

Permalink
Merge branch 'master' into souvikinator/recognition-program-section-c…
Browse files Browse the repository at this point in the history
…ommunity-page
  • Loading branch information
souvikinator authored Jan 13, 2025
2 parents 6c7f8eb + f311b94 commit 34aef93
Show file tree
Hide file tree
Showing 44 changed files with 1,084 additions and 815 deletions.
2 changes: 1 addition & 1 deletion .github/build/features-to-json.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node

const fs = require("fs").promises; // Use fs.promises
const fs = require("fs").promises;
const csv = require("csvtojson");
const [major, minor, patch] = process.versions.node.split(".").map(Number);
console.log(`Using Node.js version: ${major}.${minor}.${patch}`);
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build-and-preview-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
- name: Install and Build 🔧
run: |
npm install --legacy-peer-deps
node -v
npm run version
npm run noIndex
- name: Zip Site
Expand Down
2 changes: 2 additions & 0 deletions gatsby-browser.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import "./fonts.css";
import "slick-carousel/slick/slick.css";
import "slick-carousel/slick/slick-theme.css";

document.addEventListener("DOMContentLoaded", () => {
/** init gtm after 3500 seconds - this could be adjusted */
Expand Down
3 changes: 1 addition & 2 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ module.exports = {
},
trailingSlash: "never",
plugins: [
"@mediacurrent/gatsby-plugin-silence-css-order-warning",
{
resolve: "gatsby-plugin-webpack-bundle-analyser-v2",
options: {
Expand Down Expand Up @@ -546,7 +545,7 @@ module.exports = {
resolve: "gatsby-plugin-robots-txt",
options: {
host: "https://layer5.io",
sitemap: "https://layer5.io/sitemap/sitemap-index.xml",
sitemap: "https://layer5.io/sitemap-index.xml",
policy: [{ userAgent: "*", allow: "/" }],
}
},
Expand Down
48 changes: 38 additions & 10 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const path = require("path");
const slugify = require("./src/utils/slugify");
const { paginate } = require("gatsby-awesome-pagination");
const { createFilePath } = require("gatsby-source-filesystem");
const FilterWarningsPlugin = require("webpack-filter-warnings-plugin");
const config = require("./gatsby-config");
const {
componentsData,
Expand Down Expand Up @@ -336,7 +335,12 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
redirectInBrowser: true,
isPermanent: true,
});

createRedirect({
fromPath: "/sitemap.xml",
toPath: "/sitemap-index.xml",
redirectInBrowser: true,
isPermanent: true,
});
// Create Pages
const { createPage } = actions;

Expand Down Expand Up @@ -988,14 +992,6 @@ exports.onCreateWebpackConfig = ({ actions, stage, getConfig }) => {
},
},
});
actions.setWebpackConfig({
plugins: [
new FilterWarningsPlugin({
exclude:
/mini-css-extract-plugin[^]*Conflicting order. Following module has been added:/,
}),
],
});

if (stage === "build-javascript") {
const config = getConfig();
Expand Down Expand Up @@ -1038,3 +1034,35 @@ exports.createSchemaCustomization = ({ actions }) => {
`;
createTypes(typeDefs);
};

const fs = require("fs");

exports.onPostBuild = async ({ graphql, reporter }) => {
const result = await graphql(`
{
allSitePage {
nodes {
path
matchPath
}
}
site {
siteMetadata {
siteUrl
}
}
}
`);

if (result.errors) {
reporter.panicOnBuild("Error while running GraphQL query.");
return;
}

// Log the result to the console
console.log("GraphQL query result:", JSON.stringify(result, null, 2));

// Optionally, write the result to a file for easier inspection
const outputPath = path.resolve(__dirname, "public", "query-result.json");
fs.writeFileSync(outputPath, JSON.stringify(result, null, 2));
};
Loading

0 comments on commit 34aef93

Please sign in to comment.