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

Migration: frontend changes to redirect to Grafana Docs #1642

Merged
merged 11 commits into from
Jul 16, 2024
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
24 changes: 10 additions & 14 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,19 +176,11 @@ const getPageVersions = (
const topLevelLinks = [
{
label: 'guides',
to: '/',
to: 'https://grafana.com/docs/k6/latest/',
},
{
label: 'JAVASCRIPT API',
to: '/javascript-api/',
submenu: [
{ label: 'k6 API', to: `/javascript-api/` },
{
label: 'xk6-disruptor',
to: `/javascript-api/xk6-disruptor/`,
},
{ label: 'jslib', to: `/javascript-api/jslib/` },
],
to: 'https://grafana.com/docs/k6/latest/javascript-api/',
},
{
label: 'Cloud Docs',
Expand All @@ -203,15 +195,15 @@ const topLevelLinks = [
},
{
label: 'Extensions',
to: '/extensions/',
to: 'https://grafana.com/docs/k6/latest/extensions/',
},
{
label: 'Integrations',
to: '/integrations/',
to: 'https://grafana.com/docs/k6/latest/misc/integrations/',
},
{
label: 'examples',
to: '/examples/',
to: 'https://grafana.com/docs/k6/latest/examples/',
},
];

Expand Down Expand Up @@ -1179,7 +1171,10 @@ async function createDocPages({
reporter,
}),
)
.map((pageProps) => actions.createPage(pageProps));
.map((pageProps) =>
// console.log(pageProps.path);
actions.createPage(pageProps),
);
}

const createRedirects = ({ actions }) => {
Expand Down Expand Up @@ -2099,6 +2094,7 @@ exports.onCreateNode = ({ node, actions }) => {
// Adding default values for some fields and moving them under node.fields
// because that how createNodeField works
if (node.frontmatter) {
// console.log('node slug: ' , node.frontmatter.slug);
createNodeField({
node,
name: 'redirect',
Expand Down
Loading
Loading