diff --git a/apps/landing-page/project.json b/apps/landing-page/project.json
index ee8de297..544a62d7 100644
--- a/apps/landing-page/project.json
+++ b/apps/landing-page/project.json
@@ -3,17 +3,18 @@
"sourceRoot": "apps/landing-page",
"projectType": "application",
"targets": {
- "build-docs": {
+ "prebuild": {
"executor": "nx:run-commands",
"options": {
- "command": "yarn docs"
+ "command": "yarn docs",
+ "outputPath": ["libs/docs/src/scripts/build-directory/dist", "libs/docs/src/scripts/build-navigation/dist", "libs/docs/src/scripts/copy-devfile-schemas/dist"]
}
},
"build": {
"executor": "@nrwl/next:build",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
- "dependsOn": ["build-docs"],
+ "dependsOn": ["prebuild"],
"options": {
"root": "apps/landing-page",
"outputPath": "dist/apps/landing-page"
@@ -26,7 +27,7 @@
"serve": {
"executor": "@nrwl/next:server",
"defaultConfiguration": "development",
- "dependsOn": ["build-docs"],
+ "dependsOn": ["prebuild"],
"options": {
"buildTarget": "landing-page:build",
"dev": true
@@ -42,8 +43,15 @@
}
}
},
+ "preexport": {
+ "executor": "nx:run-commands",
+ "options": {
+ "command": "next-sitemap --config ./apps/landing-page/next-sitemap.config.mjs"
+ }
+ },
"export": {
"executor": "@nrwl/next:export",
+ "dependsOn": ["preexport"],
"options": {
"buildTarget": "landing-page:build:production"
}
@@ -64,5 +72,6 @@
}
}
},
- "tags": []
+ "tags": [],
+ "implicitDependencies": ["docs"]
}
diff --git a/libs/core/src/components/fence/fence.tsx b/libs/core/src/components/fence/fence.tsx
index b9f6496b..f3ddec58 100644
--- a/libs/core/src/components/fence/fence.tsx
+++ b/libs/core/src/components/fence/fence.tsx
@@ -72,7 +72,7 @@ export function Fence(props: FenceProps): JSX.Element {
)}
-
+
{tokens.map((line, lineIndex) => (
// eslint-disable-next-line react/no-array-index-key
diff --git a/libs/core/src/components/footer/footer.tsx b/libs/core/src/components/footer/footer.tsx
index 505395f0..a07486f9 100644
--- a/libs/core/src/components/footer/footer.tsx
+++ b/libs/core/src/components/footer/footer.tsx
@@ -62,7 +62,7 @@ export function Footer(): JSX.Element {
))}
+
Links
diff --git a/libs/core/src/components/header/header.tsx b/libs/core/src/components/header/header.tsx
index 7aa4ff5c..67a9e448 100644
--- a/libs/core/src/components/header/header.tsx
+++ b/libs/core/src/components/header/header.tsx
@@ -58,15 +58,16 @@ export function Header(): JSX.Element {
-
+
{headerNavigation.map((item) => (
{item.image ? (
diff --git a/libs/core/src/layouts/landing-page-layout/landing-page-layout.tsx b/libs/core/src/layouts/landing-page-layout/landing-page-layout.tsx
index 9c8ab326..bb628062 100644
--- a/libs/core/src/layouts/landing-page-layout/landing-page-layout.tsx
+++ b/libs/core/src/layouts/landing-page-layout/landing-page-layout.tsx
@@ -2,6 +2,7 @@ import Link from 'next/link';
import { useRouter } from 'next/router';
import clsx from 'clsx';
import { PencilIcon } from '@heroicons/react/solid';
+import { githubDocsUrl } from '@devfile-web/docs';
import { Navigation, Prose, LandingPageSearch as Search, Hero, Fence } from '../../components';
import { useTableOfContents, useNavigation, useCodeblock, CodeblockProvider } from '../../hooks';
import type { TableOfContents, TableOfContentsChild } from '../../hooks';
@@ -15,15 +16,15 @@ export interface LandingPageLayoutProps {
export function LandingPageLayout(props: LandingPageLayoutProps): JSX.Element {
const { children, title, tableOfContents } = props;
- const { versionedDocsNavigation: docsNavigation } = useNavigation();
+ const { versionedDocsNavigation } = useNavigation();
const router = useRouter();
const isDocsPage = router.pathname.includes('docs');
const isDevfileSchema = router.pathname.includes('/devfile-schema');
- const allLinks = docsNavigation.flatMap((section) => section.links);
+ const allLinks = versionedDocsNavigation.flatMap((section) => section.links);
const linkIndex = allLinks.findIndex((link) => link.href === router.pathname);
const previousPage = allLinks[linkIndex - 1];
const nextPage = allLinks[linkIndex + 1];
- const section = docsNavigation.find((section_) =>
+ const section = versionedDocsNavigation.find((section_) =>
section_.links.find((link) => link.href === router.pathname),
);
const { currentSection } = useTableOfContents(tableOfContents);
@@ -48,8 +49,8 @@ export function LandingPageLayout(props: LandingPageLayoutProps): JSX.Element {
<>
{router.asPath === '/docs' && }
-
-
+
+
@@ -67,7 +68,7 @@ export function LandingPageLayout(props: LandingPageLayoutProps): JSX.Element {
) : (
{(title || section) && (
-
)}
{!isDevfileSchema && (
-
+
Edit this page
diff --git a/libs/docs/src/types/index.ts b/libs/docs/src/types/index.ts
index efef82bc..364c379d 100644
--- a/libs/docs/src/types/index.ts
+++ b/libs/docs/src/types/index.ts
@@ -11,7 +11,7 @@ export interface Section {
links: {
title: string;
href: string;
- githubHref: string;
+ githubHref?: string;
}[];
}
diff --git a/package.json b/package.json
index 37bfee44..3927076a 100644
--- a/package.json
+++ b/package.json
@@ -39,6 +39,7 @@
"js-yaml": "^4.1.0",
"next": "^12.2.0",
"next-compose-plugins": "^2.2.1",
+ "next-sitemap": "^3.1.17",
"prismjs": "^1.28.0",
"react": "18.0.0",
"react-dom": "18.0.0",
diff --git a/yarn.lock b/yarn.lock
index eb6bcf06..6f124c7f 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1316,6 +1316,11 @@
resolved "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz"
integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==
+"@corex/deepmerge@^4.0.29":
+ version "4.0.29"
+ resolved "https://registry.yarnpkg.com/@corex/deepmerge/-/deepmerge-4.0.29.tgz#af9debf07d7f6b0d2a9d04a266abf2c1418ed2f6"
+ integrity sha512-q/yVUnqckA8Do+EvAfpy7RLdumnBy9ZsducMUtZTvpdbJC7azEf1hGtnYYxm0QfphYxjwggv6XtH64prvS1W+A==
+
"@cspotcode/source-map-support@^0.8.0":
version "0.8.1"
resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1"
@@ -12696,6 +12701,14 @@ next-compose-plugins@^2.2.1:
resolved "https://registry.yarnpkg.com/next-compose-plugins/-/next-compose-plugins-2.2.1.tgz#020fc53f275a7e719d62521bef4300fbb6fde5ab"
integrity sha512-OjJ+fV15FXO2uQXQagLD4C0abYErBjyjE0I0FHpOEIB8upw0hg1ldFP6cqHTJBH1cZqy96OeR3u1dJ+Ez2D4Bg==
+next-sitemap@^3.1.17:
+ version "3.1.17"
+ resolved "https://registry.yarnpkg.com/next-sitemap/-/next-sitemap-3.1.17.tgz#2ba30cd63d89d0d4ffa52557af8f90f2d84a4be8"
+ integrity sha512-xop7KgEbWsqOe4Fr50g9RQ1UGb1bAEJoKYVVynbUqietpSltAnCIzvq/StL2gZcNyFW9K+9tZV7EpcD+72gRrA==
+ dependencies:
+ "@corex/deepmerge" "^4.0.29"
+ minimist "^1.2.6"
+
next@^12.2.0:
version "12.2.0"
resolved "https://registry.yarnpkg.com/next/-/next-12.2.0.tgz#aef47cd96b602bc1307d1dcf9a1ee3e753845544"