diff --git a/.env.example b/.env.example index 06febbd612..5f74c6e465 100644 --- a/.env.example +++ b/.env.example @@ -1,13 +1,3 @@ -PCC_SITE_ID= -PCC_TOKEN= - -PCC_MANAGEMENT_TOKEN= -SERVE_LOCAL= - -CONTENT_PCC_SITE_ID= -CONTENT_PCC_TOKEN= - - # Either of the following # NEXT_PUBLIC_GA_ID= # NEXT_PUBLIC_GTM_ID= diff --git a/.github/workflows/send-content-to-ingest-api.yml b/.github/workflows/send-content-to-ingest-api.yml deleted file mode 100644 index 2838a20818..0000000000 --- a/.github/workflows/send-content-to-ingest-api.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: on main push - -on: - push: - branches: - - multi-content-publisher-ingest-testing - -jobs: - get-changed-files: - runs-on: ubuntu-latest - - steps: - - name: Checkout repo - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Required to get full history - - - name: Get last successful commit SHA - id: last_success - run: | - last_success_sha=$(gh run list --branch=main --workflow="${{ github.workflow }}" --status=success --limit=1 --json=headSha --jq='.[0].headSha') - echo "Last successful SHA: $last_success_sha" - echo "last_success_sha=$last_success_sha" >> $GITHUB_OUTPUT - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Get changed files since last successful run - run: | - mkdir -p /tmp - if [ -z "${{ steps.last_success.outputs.last_success_sha }}" ]; then - echo "No previous successful build found, listing all files" - git diff --name-only HEAD > /tmp/changed_files.txt - else - echo "Comparing ${{ steps.last_success.outputs.last_success_sha }}..HEAD" - git diff --name-only ${{ steps.last_success.outputs.last_success_sha }} HEAD > /tmp/changed_files.txt - fi - echo "Files changed:" - cat /tmp/changed_files.txt - - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version: "20" - - - name: Install pnpm - run: npm install -g pnpm - - - name: Install dependencies - run: pnpm install - - - name: Run your Node.js script - run: pnpm run update - env: - PCC_SITE_ID: ${{ secrets.PCC_SITE_ID }} - PCC_TOKEN: ${{ secrets.PCC_TOKEN }} - PCC_MANAGEMENT_TOKEN: ${{ secrets.PCC_MANAGEMENT_TOKEN }} diff --git a/next.config.js b/next.config.js index 87e244cb68..6f470eac58 100644 --- a/next.config.js +++ b/next.config.js @@ -6,33 +6,10 @@ require("dotenv").config({ path: path.resolve(process.cwd(), ".env.development.local"), }); -function ensureEnvVariable(name) { - if (process.env[name] == null) { - if (process.env.NODE_ENV === "development") { - console.error( - `No ${name} found.\nSee the README.md for information on setting this variable locally.` - ); - } else if (process.env.NODE_ENV === "production") { - console.warn( - `No ${name} environment variable found.\nLink to your PCC Instance or set the ${name} environment variable in the settings tab in the dashboard\nIf your site does not require a backend to build, remove this check from the next.config.js.` - ); - } - } -} - -if (process.env.IS_CICD !== "true") { - ensureEnvVariable("PCC_SITE_ID"); - ensureEnvVariable("PCC_TOKEN"); -} - /** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, output: "standalone", - env: { - NEXT_PUBLIC_PCC_SITE_ID: process.env.PCC_SITE_ID, - NEXT_PUBLIC_PCC_HOST: process.env.PCC_HOST, - }, images: { remotePatterns: [ { diff --git a/package-lock.json b/package-lock.json index 345417dbdd..7598a8f254 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,8 +11,6 @@ "@adobe/mdast-util-gridtables": "^4.0.13", "@adobe/remark-gridtables": "^3.0.14", "@next/bundle-analyzer": "^15.4.5", - "@pantheon-systems/pcc-react-sdk": "3.13.0-beta.2", - "@pantheon-systems/pcc-sdk-core": "3.13.0-beta.2", "@pantheon-systems/pds-toolkit-react": "1.0.0-dev.256", "@radix-ui/react-popover": "^1.1.14", "@radix-ui/react-slot": "^1.2.3", @@ -156,48 +154,6 @@ "node": ">=6.0.0" } }, - "node_modules/@apollo/client": { - "version": "3.13.9", - "resolved": "https://registry.npmjs.org/@apollo/client/-/client-3.13.9.tgz", - "integrity": "sha512-RStSzQfL1XwL6/NWd7W8avhGQYTgPCtJ+qHkkTTSj9Upp3VVm6Oppv81YWdXG1FgEpDPW4hvCrTUELdcC4inCQ==", - "license": "MIT", - "dependencies": { - "@graphql-typed-document-node/core": "^3.1.1", - "@wry/caches": "^1.0.0", - "@wry/equality": "^0.5.6", - "@wry/trie": "^0.5.0", - "graphql-tag": "^2.12.6", - "hoist-non-react-statics": "^3.3.2", - "optimism": "^0.18.0", - "prop-types": "^15.7.2", - "rehackt": "^0.1.0", - "symbol-observable": "^4.0.0", - "ts-invariant": "^0.10.3", - "tslib": "^2.3.0", - "zen-observable-ts": "^1.2.5" - }, - "peerDependencies": { - "graphql": "^15.0.0 || ^16.0.0", - "graphql-ws": "^5.5.5 || ^6.0.3", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc", - "subscriptions-transport-ws": "^0.9.0 || ^0.11.0" - }, - "peerDependenciesMeta": { - "graphql-ws": { - "optional": true - }, - "react": { - "optional": true - }, - "react-dom": { - "optional": true - }, - "subscriptions-transport-ws": { - "optional": true - } - } - }, "node_modules/@babel/code-frame": { "version": "7.27.1", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", @@ -1180,15 +1136,6 @@ "react": "^16.3 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, - "node_modules/@graphql-typed-document-node/core": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.2.0.tgz", - "integrity": "sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==", - "license": "MIT", - "peerDependencies": { - "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" - } - }, "node_modules/@humanwhocodes/config-array": { "version": "0.13.0", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", @@ -1975,863 +1922,72 @@ ], "license": "MIT", "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-win32-x64-msvc": { - "version": "15.3.5", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.3.5.tgz", - "integrity": "sha512-5fhH6fccXxnX2KhllnGhkYMndhOiLOLEiVGYjP2nizqeGWkN10sA9taATlXwake2E2XMvYZjjz0Uj7T0y+z1yw==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "license": "MIT", - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "license": "MIT", - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "license": "MIT", - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nolyfill/is-core-module": { - "version": "1.0.39", - "resolved": "https://registry.npmjs.org/@nolyfill/is-core-module/-/is-core-module-1.0.39.tgz", - "integrity": "sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12.4.0" - } - }, - "node_modules/@pantheon-systems/pcc-react-sdk": { - "version": "3.13.0-beta.2", - "resolved": "https://registry.npmjs.org/@pantheon-systems/pcc-react-sdk/-/pcc-react-sdk-3.13.0-beta.2.tgz", - "integrity": "sha512-GgviGq5gxysaGcHW+0v3jmR+Q6Gkc89MkbLIrS5YW0X78pNix+JdT4TVAJ+wTa7xPpiBMjdW3Lis9hxgpVRHkA==", - "license": "MIT", - "dependencies": { - "@apollo/client": "^3.10.3", - "@pantheon-systems/pcc-sdk-core": "3.13.0-beta.2", - "graphql": "^16.8.1", - "lodash": "^4.17.21", - "markdown-to-txt": "^2.0.1", - "react-markdown": "^8.0.7", - "rehype-raw": "^6.1.1", - "remark-heading-id": "^1.0.1", - "unist-util-visit": "^5.0.0" - }, - "engines": { - "node": ">=18.10.0" - }, - "peerDependencies": { - "@types/react": ">=18", - "@types/react-dom": ">=18", - "react": ">=18", - "react-dom": ">=18" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/@types/hast": { - "version": "2.3.10", - "resolved": "https://registry.npmjs.org/@types/hast/-/hast-2.3.10.tgz", - "integrity": "sha512-McWspRw8xx8J9HurkVBfYj0xKoE25tOFlHGdx4MJ5xORQrMGZNqJhVQWaIbm6Oyla5kYOXtDiopzKRJzEOkwJw==", - "license": "MIT", - "dependencies": { - "@types/unist": "^2" - } - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/@types/mdast": { - "version": "3.0.15", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.15.tgz", - "integrity": "sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==", - "license": "MIT", - "dependencies": { - "@types/unist": "^2" - } - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/@types/unist": { - "version": "2.0.11", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz", - "integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==", - "license": "MIT" - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/hast-util-raw": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-7.2.3.tgz", - "integrity": "sha512-RujVQfVsOrxzPOPSzZFiwofMArbQke6DJjnFfceiEbFh7S05CbPt0cYN+A5YeD3pso0JQk6O1aHBnx9+Pm2uqg==", - "license": "MIT", - "dependencies": { - "@types/hast": "^2.0.0", - "@types/parse5": "^6.0.0", - "hast-util-from-parse5": "^7.0.0", - "hast-util-to-parse5": "^7.0.0", - "html-void-elements": "^2.0.0", - "parse5": "^6.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0", - "vfile": "^5.0.0", - "web-namespaces": "^2.0.0", - "zwitch": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/hast-util-raw/node_modules/unist-util-visit": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.2.tgz", - "integrity": "sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==", - "license": "MIT", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.1.1" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/mdast-util-from-markdown": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-1.3.1.tgz", - "integrity": "sha512-4xTO/M8c82qBcnQc1tgpNtubGUW/Y1tBQ1B0i5CtSoelOLKFYlElIr3bvgREYYO5iRqbMY1YuqZng0GVOI8Qww==", - "license": "MIT", - "dependencies": { - "@types/mdast": "^3.0.0", - "@types/unist": "^2.0.0", - "decode-named-character-reference": "^1.0.0", - "mdast-util-to-string": "^3.1.0", - "micromark": "^3.0.0", - "micromark-util-decode-numeric-character-reference": "^1.0.0", - "micromark-util-decode-string": "^1.0.0", - "micromark-util-normalize-identifier": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0", - "unist-util-stringify-position": "^3.0.0", - "uvu": "^0.5.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/mdast-util-to-hast": { - "version": "12.3.0", - "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-12.3.0.tgz", - "integrity": "sha512-pits93r8PhnIoU4Vy9bjW39M2jJ6/tdHyja9rrot9uujkN7UTU9SDnE6WNJz/IGyQk3XHX6yNNtrBH6cQzm8Hw==", - "license": "MIT", - "dependencies": { - "@types/hast": "^2.0.0", - "@types/mdast": "^3.0.0", - "mdast-util-definitions": "^5.0.0", - "micromark-util-sanitize-uri": "^1.1.0", - "trim-lines": "^3.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/mdast-util-to-hast/node_modules/unist-util-visit": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.2.tgz", - "integrity": "sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==", - "license": "MIT", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.1.1" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/micromark": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/micromark/-/micromark-3.2.0.tgz", - "integrity": "sha512-uD66tJj54JLYq0De10AhWycZWGQNUvDI55xPgk2sQM5kn1JYlhbCMTtEeT27+vAhW2FBQxLlOmS3pmA7/2z4aA==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "@types/debug": "^4.0.0", - "debug": "^4.0.0", - "decode-named-character-reference": "^1.0.0", - "micromark-core-commonmark": "^1.0.1", - "micromark-factory-space": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-chunked": "^1.0.0", - "micromark-util-combine-extensions": "^1.0.0", - "micromark-util-decode-numeric-character-reference": "^1.0.0", - "micromark-util-encode": "^1.0.0", - "micromark-util-normalize-identifier": "^1.0.0", - "micromark-util-resolve-all": "^1.0.0", - "micromark-util-sanitize-uri": "^1.0.0", - "micromark-util-subtokenize": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.1", - "uvu": "^0.5.0" - } - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/micromark-core-commonmark": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-1.1.0.tgz", - "integrity": "sha512-BgHO1aRbolh2hcrzL2d1La37V0Aoz73ymF8rAcKnohLy93titmv62E0gP8Hrx9PKcKrqCZ1BbLGbP3bEhoXYlw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "decode-named-character-reference": "^1.0.0", - "micromark-factory-destination": "^1.0.0", - "micromark-factory-label": "^1.0.0", - "micromark-factory-space": "^1.0.0", - "micromark-factory-title": "^1.0.0", - "micromark-factory-whitespace": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-chunked": "^1.0.0", - "micromark-util-classify-character": "^1.0.0", - "micromark-util-html-tag-name": "^1.0.0", - "micromark-util-normalize-identifier": "^1.0.0", - "micromark-util-resolve-all": "^1.0.0", - "micromark-util-subtokenize": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.1", - "uvu": "^0.5.0" - } - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/micromark-factory-destination": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-1.1.0.tgz", - "integrity": "sha512-XaNDROBgx9SgSChd69pjiGKbV+nfHGDPVYFs5dOoDd7ZnMAE+Cuu91BCpsY8RT2NP9vo/B8pds2VQNCLiu0zhg==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" - } - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/micromark-factory-label": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-1.1.0.tgz", - "integrity": "sha512-OLtyez4vZo/1NjxGhcpDSbHQ+m0IIGnT8BoPamh+7jVlzLJBH98zzuCoUeMxvM6WsNeh8wx8cKvqLiPHEACn0w==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0", - "uvu": "^0.5.0" - } - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/micromark-factory-space": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-1.1.0.tgz", - "integrity": "sha512-cRzEj7c0OL4Mw2v6nwzttyOZe8XY/Z8G0rzmWQZTBi/jjwyw/U4uqKtUORXQrR5bAZZnbTI/feRV/R7hc4jQYQ==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-character": "^1.0.0", - "micromark-util-types": "^1.0.0" - } - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/micromark-factory-title": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-1.1.0.tgz", - "integrity": "sha512-J7n9R3vMmgjDOCY8NPw55jiyaQnH5kBdV2/UXCtZIpnHH3P6nHUKaH7XXEYuWwx/xUJcawa8plLBEjMPU24HzQ==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-factory-space": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" - } - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/micromark-factory-whitespace": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-1.1.0.tgz", - "integrity": "sha512-v2WlmiymVSp5oMg+1Q0N1Lxmt6pMhIHD457whWM7/GUlEks1hI9xj5w3zbc4uuMKXGisksZk8DzP2UyGbGqNsQ==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-factory-space": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" - } - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/micromark-util-character": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-1.2.0.tgz", - "integrity": "sha512-lXraTwcX3yH/vMDaFWCQJP1uIszLVebzUa3ZHdrgxr7KEU/9mL4mVgCpGbyhvNLNlauROiNUq7WN5u7ndbY6xg==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" - } - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/micromark-util-chunked": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-1.1.0.tgz", - "integrity": "sha512-Ye01HXpkZPNcV6FiyoW2fGZDUw4Yc7vT0E9Sad83+bEDiCJ1uXu0S3mr8WLpsz3HaG3x2q0HM6CTuPdcZcluFQ==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-symbol": "^1.0.0" - } - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/micromark-util-classify-character": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-1.1.0.tgz", - "integrity": "sha512-SL0wLxtKSnklKSUplok1WQFoGhUdWYKggKUiqhX+Swala+BtptGCu5iPRc+xvzJ4PXE/hwM3FNXsfEVgoZsWbw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" - } - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/micromark-util-combine-extensions": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-1.1.0.tgz", - "integrity": "sha512-Q20sp4mfNf9yEqDL50WwuWZHUrCO4fEyeDCnMGmG5Pr0Cz15Uo7KBs6jq+dq0EgX4DPwwrh9m0X+zPV1ypFvUA==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-chunked": "^1.0.0", - "micromark-util-types": "^1.0.0" - } - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/micromark-util-decode-numeric-character-reference": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-1.1.0.tgz", - "integrity": "sha512-m9V0ExGv0jB1OT21mrWcuf4QhP46pH1KkfWy9ZEezqHKAxkj4mPCy3nIH1rkbdMlChLHX531eOrymlwyZIf2iw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-symbol": "^1.0.0" - } - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/micromark-util-decode-string": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-1.1.0.tgz", - "integrity": "sha512-YphLGCK8gM1tG1bd54azwyrQRjCFcmgj2S2GoJDNnh4vYtnL38JS8M4gpxzOPNyHdNEpheyWXCTnnTDY3N+NVQ==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "decode-named-character-reference": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-decode-numeric-character-reference": "^1.0.0", - "micromark-util-symbol": "^1.0.0" - } - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/micromark-util-encode": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-1.1.0.tgz", - "integrity": "sha512-EuEzTWSTAj9PA5GOAs992GzNh2dGQO52UvAbtSOMvXTxv3Criqb6IOzJUBCmEqrrXSblJIJBbFFv6zPxpreiJw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT" - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/micromark-util-html-tag-name": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-1.2.0.tgz", - "integrity": "sha512-VTQzcuQgFUD7yYztuQFKXT49KghjtETQ+Wv/zUjGSGBioZnkA4P1XXZPT1FHeJA6RwRXSF47yvJ1tsJdoxwO+Q==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT" - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/micromark-util-normalize-identifier": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-1.1.0.tgz", - "integrity": "sha512-N+w5vhqrBihhjdpM8+5Xsxy71QWqGn7HYNUvch71iV2PM7+E3uWGox1Qp90loa1ephtCxG2ftRV/Conitc6P2Q==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-symbol": "^1.0.0" - } - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/micromark-util-resolve-all": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-1.1.0.tgz", - "integrity": "sha512-b/G6BTMSg+bX+xVCshPTPyAu2tmA0E4X98NSR7eIbeC6ycCqCeE7wjfDIgzEbkzdEVJXRtOG4FbEm/uGbCRouA==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-types": "^1.0.0" - } - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/micromark-util-sanitize-uri": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-1.2.0.tgz", - "integrity": "sha512-QO4GXv0XZfWey4pYFndLUKEAktKkG5kZTdUNaTAkzbuJxn2tNBOr+QtxR2XpWaMhbImT2dPzyLrPXLlPhph34A==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-character": "^1.0.0", - "micromark-util-encode": "^1.0.0", - "micromark-util-symbol": "^1.0.0" - } - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/micromark-util-subtokenize": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-1.1.0.tgz", - "integrity": "sha512-kUQHyzRoxvZO2PuLzMt2P/dwVsTiivCK8icYTeR+3WgbuPqfHgPPy7nFKbeqRivBvn/3N3GBiNC+JRTMSxEC7A==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-chunked": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0", - "uvu": "^0.5.0" - } - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/micromark-util-symbol": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-1.1.0.tgz", - "integrity": "sha512-uEjpEYY6KMs1g7QfJ2eX1SQEV+ZT4rUD3UcF6l57acZvLNK7PBZL+ty82Z1qhK1/yXIY4bdx04FKMgR0g4IAag==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT" - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/micromark-util-types": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-1.1.0.tgz", - "integrity": "sha512-ukRBgie8TIAcacscVHSiddHjO4k/q3pnedmzMQ4iwDcK0FtFCohKOlFbaOL/mPgfnPsL3C1ZyxJa4sbWrBl3jg==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT" - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/react-markdown": { - "version": "8.0.7", - "resolved": "https://registry.npmjs.org/react-markdown/-/react-markdown-8.0.7.tgz", - "integrity": "sha512-bvWbzG4MtOU62XqBx3Xx+zB2raaFFsq4mYiAzfjXJMEz2sixgeAfraA3tvzULF02ZdOMUOKTBFFaZJDDrq+BJQ==", - "license": "MIT", - "dependencies": { - "@types/hast": "^2.0.0", - "@types/prop-types": "^15.0.0", - "@types/unist": "^2.0.0", - "comma-separated-tokens": "^2.0.0", - "hast-util-whitespace": "^2.0.0", - "prop-types": "^15.0.0", - "property-information": "^6.0.0", - "react-is": "^18.0.0", - "remark-parse": "^10.0.0", - "remark-rehype": "^10.0.0", - "space-separated-tokens": "^2.0.0", - "style-to-object": "^0.4.0", - "unified": "^10.0.0", - "unist-util-visit": "^4.0.0", - "vfile": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - }, - "peerDependencies": { - "@types/react": ">=16", - "react": ">=16" - } - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/react-markdown/node_modules/unist-util-visit": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.2.tgz", - "integrity": "sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==", - "license": "MIT", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.1.1" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/rehype-raw": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/rehype-raw/-/rehype-raw-6.1.1.tgz", - "integrity": "sha512-d6AKtisSRtDRX4aSPsJGTfnzrX2ZkHQLE5kiUuGOeEoLpbEulFF4hj0mLPbsa+7vmguDKOVVEQdHKDSwoaIDsQ==", - "license": "MIT", - "dependencies": { - "@types/hast": "^2.0.0", - "hast-util-raw": "^7.2.0", - "unified": "^10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/remark-parse": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-10.0.2.tgz", - "integrity": "sha512-3ydxgHa/ZQzG8LvC7jTXccARYDcRld3VfcgIIFs7bI6vbRSxJJmzgLEIIoYKyrfhaY+ujuWaf/PJiMZXoiCXgw==", - "license": "MIT", - "dependencies": { - "@types/mdast": "^3.0.0", - "mdast-util-from-markdown": "^1.0.0", - "unified": "^10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/remark-rehype": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-10.1.0.tgz", - "integrity": "sha512-EFmR5zppdBp0WQeDVZ/b66CWJipB2q2VLNFMabzDSGR66Z2fQii83G5gTBbgGEnEEA0QRussvrFHxk1HWGJskw==", - "license": "MIT", - "dependencies": { - "@types/hast": "^2.0.0", - "@types/mdast": "^3.0.0", - "mdast-util-to-hast": "^12.1.0", - "unified": "^10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/unified": { - "version": "10.1.2", - "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", - "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", - "license": "MIT", - "dependencies": { - "@types/unist": "^2.0.0", - "bail": "^2.0.0", - "extend": "^3.0.0", - "is-buffer": "^2.0.0", - "is-plain-obj": "^4.0.0", - "trough": "^2.0.0", - "vfile": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/unist-util-is": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", - "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==", - "license": "MIT", - "dependencies": { - "@types/unist": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" } }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/unist-util-stringify-position": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", - "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", + "node_modules/@next/swc-win32-x64-msvc": { + "version": "15.3.5", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.3.5.tgz", + "integrity": "sha512-5fhH6fccXxnX2KhllnGhkYMndhOiLOLEiVGYjP2nizqeGWkN10sA9taATlXwake2E2XMvYZjjz0Uj7T0y+z1yw==", + "cpu": [ + "x64" + ], "license": "MIT", - "dependencies": { - "@types/unist": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" } }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/unist-util-visit-parents": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz", - "integrity": "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==", + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "license": "MIT", "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "engines": { + "node": ">= 8" } }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/vfile": { - "version": "5.3.7", - "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", - "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "license": "MIT", - "dependencies": { - "@types/unist": "^2.0.0", - "is-buffer": "^2.0.0", - "unist-util-stringify-position": "^3.0.0", - "vfile-message": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "engines": { + "node": ">= 8" } }, - "node_modules/@pantheon-systems/pcc-react-sdk/node_modules/vfile-message": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", - "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "license": "MIT", "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-stringify-position": "^3.0.0" + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "engines": { + "node": ">= 8" } }, - "node_modules/@pantheon-systems/pcc-sdk-core": { - "version": "3.13.0-beta.2", - "resolved": "https://registry.npmjs.org/@pantheon-systems/pcc-sdk-core/-/pcc-sdk-core-3.13.0-beta.2.tgz", - "integrity": "sha512-jK+rpab9MOz2KixzTf6QNDotzDh/Q+wmCv1TQKP+V8jCx43PqrxNSYqHvauDmuiIOe+D7OwUNefata3tJiSSNg==", + "node_modules/@nolyfill/is-core-module": { + "version": "1.0.39", + "resolved": "https://registry.npmjs.org/@nolyfill/is-core-module/-/is-core-module-1.0.39.tgz", + "integrity": "sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA==", + "dev": true, "license": "MIT", - "dependencies": { - "@apollo/client": "^3.10.3", - "graphql": "^16.8.1", - "graphql-tag": "^2.12.6", - "graphql-ws": "^5.15.0", - "query-string": "^8.2.0", - "typescript": "^5.5.4", - "zod": "^3.22.4", - "zod-validation-error": "^1.5.0" + "engines": { + "node": ">=12.4.0" } }, "node_modules/@pantheon-systems/pds-design-tokens": { @@ -7120,54 +6276,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@wry/caches": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@wry/caches/-/caches-1.0.1.tgz", - "integrity": "sha512-bXuaUNLVVkD20wcGBWRyo7j9N3TxePEWFZj2Y+r9OoUzfqmavM84+mFykRicNsBqatba5JLay1t48wxaXaWnlA==", - "license": "MIT", - "dependencies": { - "tslib": "^2.3.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@wry/context": { - "version": "0.7.4", - "resolved": "https://registry.npmjs.org/@wry/context/-/context-0.7.4.tgz", - "integrity": "sha512-jmT7Sb4ZQWI5iyu3lobQxICu2nC/vbUhP0vIdd6tHC9PTfenmRmuIFqktc6GH9cgi+ZHnsLWPvfSvc4DrYmKiQ==", - "license": "MIT", - "dependencies": { - "tslib": "^2.3.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@wry/equality": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/@wry/equality/-/equality-0.5.7.tgz", - "integrity": "sha512-BRFORjsTuQv5gxcXsuDXx6oGRhuVsEGwZy6LOzRRfgu+eSfxbhUQ9L9YtSEIuIjY/o7g3iWFjrc5eSY1GXP2Dw==", - "license": "MIT", - "dependencies": { - "tslib": "^2.3.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@wry/trie": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@wry/trie/-/trie-0.5.0.tgz", - "integrity": "sha512-FNoYzHawTMk/6KMQoEG5O4PuioX19UbwdQKF44yw0nLfOypfQdjtfZzo/UIJWAJ23sNIFbD1Ug9lbaDGMwbqQA==", - "license": "MIT", - "dependencies": { - "tslib": "^2.3.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/@xobotyi/scrollbar-width": { "version": "1.9.5", "resolved": "https://registry.npmjs.org/@xobotyi/scrollbar-width/-/scrollbar-width-1.9.5.tgz", @@ -8595,15 +7703,6 @@ "integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==", "license": "Apache-2.0" }, - "node_modules/diff": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", - "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.3.1" - } - }, "node_modules/diff-sequences": { "version": "29.6.3", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", @@ -10194,42 +9293,6 @@ "dev": true, "license": "MIT" }, - "node_modules/graphql": { - "version": "16.11.0", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.11.0.tgz", - "integrity": "sha512-mS1lbMsxgQj6hge1XZ6p7GPhbrtFwUFYi3wRzXAC/FmYnyXMTvvI3td3rjmQ2u8ewXueaSvRPWaEcgVVOT9Jnw==", - "license": "MIT", - "engines": { - "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" - } - }, - "node_modules/graphql-tag": { - "version": "2.12.6", - "resolved": "https://registry.npmjs.org/graphql-tag/-/graphql-tag-2.12.6.tgz", - "integrity": "sha512-FdSNcu2QQcWnM2VNvSCCDCVS5PpPqpzgFT8+GXzqJuoDd0CBncxCY278u4mhRO7tMgo2JjgJA5aZ+nWSQ/Z+xg==", - "license": "MIT", - "dependencies": { - "tslib": "^2.1.0" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "graphql": "^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" - } - }, - "node_modules/graphql-ws": { - "version": "5.16.2", - "resolved": "https://registry.npmjs.org/graphql-ws/-/graphql-ws-5.16.2.tgz", - "integrity": "sha512-E1uccsZxt/96jH/OwmLPuXMACILs76pKF2i3W861LpKBCYtGIyPQGtWLuBLkND4ox1KHns70e83PS4te50nvPQ==", - "license": "MIT", - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "graphql": ">=0.11 <=16" - } - }, "node_modules/gray-matter": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/gray-matter/-/gray-matter-4.0.3.tgz", @@ -12231,15 +11294,6 @@ "node": ">=0.10.0" } }, - "node_modules/kleur": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", - "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/language-subtag-registry": { "version": "0.3.23", "resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.23.tgz", @@ -12358,12 +11412,6 @@ "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", "license": "MIT" }, - "node_modules/lodash.escape": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-4.0.1.tgz", - "integrity": "sha512-nXEOnb/jK9g0DYMr1/Xvq6l5xMD7GDG55+GSYIYmS0G4tBk/hURD4JR9WCavs04t33WmJx9kCyp9vJ+mr4BOUw==", - "license": "MIT" - }, "node_modules/lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", @@ -12389,12 +11437,6 @@ "integrity": "sha512-lsD+k73XztDsMBKPKvzHXRKFNMohTjoTKIIo4ADLn5dA65LZ1BqlAvSXhR2rPEC3BgAUQnzMnorqDtqn2z4IHA==", "license": "MIT" }, - "node_modules/lodash.unescape": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.unescape/-/lodash.unescape-4.0.1.tgz", - "integrity": "sha512-DhhGRshNS1aX6s5YdBE3njCCouPgnG29ebyHvImlZzXZf2SHgt+J08DHgytTPnpywNbO1Y8mNUFyQuIDBq2JZg==", - "license": "MIT" - }, "node_modules/longest-streak": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz", @@ -12517,17 +11559,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/markdown-to-txt": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/markdown-to-txt/-/markdown-to-txt-2.0.1.tgz", - "integrity": "sha512-Hsj7KTN8k1gutlLum3vosHwVZGnv8/cbYKWVkUyo/D1rzOYddbDesILebRfOsaVfjIBJank/AVOySBlHAYqfZw==", - "license": "MIT", - "dependencies": { - "lodash.escape": "^4.0.1", - "lodash.unescape": "^4.0.1", - "marked": "^4.0.14" - } - }, "node_modules/marked": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", @@ -13972,15 +13003,6 @@ } } }, - "node_modules/mri": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", - "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/mrmime": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.1.tgz", @@ -14692,18 +13714,6 @@ "opener": "bin/opener-bin.js" } }, - "node_modules/optimism": { - "version": "0.18.1", - "resolved": "https://registry.npmjs.org/optimism/-/optimism-0.18.1.tgz", - "integrity": "sha512-mLXNwWPa9dgFyDqkNi54sjDyNJ9/fTI6WGBLgnXku1vdKY/jovHfZT5r+aiVeFFLOz+foPNOm5YJ4mqgld2GBQ==", - "license": "MIT", - "dependencies": { - "@wry/caches": "^1.0.0", - "@wry/context": "^0.7.0", - "@wry/trie": "^0.5.0", - "tslib": "^2.3.0" - } - }, "node_modules/optionator": { "version": "0.9.4", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", @@ -15896,24 +14906,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/rehackt": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/rehackt/-/rehackt-0.1.0.tgz", - "integrity": "sha512-7kRDOuLHB87D/JESKxQoRwv4DzbIdwkAGQ7p6QKGdVlY1IZheUnVhlk/4UZlNUVxdAXpyxikE3URsG067ybVzw==", - "license": "MIT", - "peerDependencies": { - "@types/react": "*", - "react": "*" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "react": { - "optional": true - } - } - }, "node_modules/rehype-autolink-headings": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/rehype-autolink-headings/-/rehype-autolink-headings-7.1.0.tgz", @@ -16252,43 +15244,6 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-heading-id": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/remark-heading-id/-/remark-heading-id-1.0.1.tgz", - "integrity": "sha512-GmJjuCeEkYvwFlvn/Skjc/1Qafj71412gbQnrwUmP/tKskmAf1cMRlZRNoovV+aIvsSRkTb2rCmGv2b9RdoJbQ==", - "license": "MIT", - "dependencies": { - "lodash": "^4.17.21", - "unist-util-visit": "^1.4.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/remark-heading-id/node_modules/unist-util-is": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-3.0.0.tgz", - "integrity": "sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A==", - "license": "MIT" - }, - "node_modules/remark-heading-id/node_modules/unist-util-visit": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.1.tgz", - "integrity": "sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw==", - "license": "MIT", - "dependencies": { - "unist-util-visit-parents": "^2.0.0" - } - }, - "node_modules/remark-heading-id/node_modules/unist-util-visit-parents": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-2.1.2.tgz", - "integrity": "sha512-DyN5vD4NE3aSeB+PXYNKxzGsfocxp6asDc2XXE3b0ekO2BaRUpBicbbUygfSvYfUz1IkmjFR1YF7dPklraMZ2g==", - "license": "MIT", - "dependencies": { - "unist-util-is": "^3.0.0" - } - }, "node_modules/remark-mdx": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/remark-mdx/-/remark-mdx-3.1.0.tgz", @@ -16736,18 +15691,6 @@ "queue-microtask": "^1.2.2" } }, - "node_modules/sade": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz", - "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==", - "license": "MIT", - "dependencies": { - "mri": "^1.1.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/safe-array-concat": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.3.tgz", @@ -17961,15 +16904,6 @@ "react": "^16.11.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, - "node_modules/symbol-observable": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-4.0.0.tgz", - "integrity": "sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ==", - "license": "MIT", - "engines": { - "node": ">=0.10" - } - }, "node_modules/symbol-tree": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", @@ -18347,18 +17281,6 @@ "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", "license": "Apache-2.0" }, - "node_modules/ts-invariant": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.10.3.tgz", - "integrity": "sha512-uivwYcQaxAucv1CzRp2n/QdYPo4ILf9VXgH19zEIjFx2EJufV16P0JtJVpYHy89DItG6Kwj2oIUjrcK5au+4tQ==", - "license": "MIT", - "dependencies": { - "tslib": "^2.1.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/ts-keycode-enum": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/ts-keycode-enum/-/ts-keycode-enum-1.0.6.tgz", @@ -18563,6 +17485,7 @@ "version": "5.9.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.2.tgz", "integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==", + "dev": true, "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", @@ -19036,24 +17959,6 @@ "uuid": "dist/esm/bin/uuid" } }, - "node_modules/uvu": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/uvu/-/uvu-0.5.6.tgz", - "integrity": "sha512-+g8ENReyr8YsOc6fv/NVJs2vFdHBnBNdfE49rshrTzDWOlUx4Gq7KOS2GD8eqhy2j+Ejq29+SbKH8yjkAqXqoA==", - "license": "MIT", - "dependencies": { - "dequal": "^2.0.0", - "diff": "^5.0.0", - "kleur": "^4.0.3", - "sade": "^1.7.3" - }, - "bin": { - "uvu": "bin.js" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/v8-to-istanbul": { "version": "9.3.0", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", @@ -20978,42 +19883,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/zen-observable": { - "version": "0.8.15", - "resolved": "https://registry.npmjs.org/zen-observable/-/zen-observable-0.8.15.tgz", - "integrity": "sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==", - "license": "MIT" - }, - "node_modules/zen-observable-ts": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/zen-observable-ts/-/zen-observable-ts-1.2.5.tgz", - "integrity": "sha512-QZWQekv6iB72Naeake9hS1KxHlotfRpe+WGNbNx5/ta+R3DNjVO2bswf63gXlWDcs+EMd7XY8HfVQyP1X6T4Zg==", - "license": "MIT", - "dependencies": { - "zen-observable": "0.8.15" - } - }, - "node_modules/zod": { - "version": "3.25.76", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", - "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } - }, - "node_modules/zod-validation-error": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/zod-validation-error/-/zod-validation-error-1.5.0.tgz", - "integrity": "sha512-/7eFkAI4qV0tcxMBB/3+d2c1P6jzzZYdYSlBuAklzMuCrJu5bzJfHS0yVAS87dRHVlhftd6RFJDIvv03JgkSbw==", - "license": "MIT", - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "zod": "^3.18.0" - } - }, "node_modules/zustand": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/zustand/-/zustand-3.7.2.tgz", diff --git a/package.json b/package.json index cea9e65372..8efe16c6af 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,6 @@ "homepage": "https://docs.pantheon.io", "author": "@pantheon-systems", "scripts": { - "update": "tsx seed/update.ts", "build": "next build", "coverage": "vitest run --coverage", "dev": "next dev -p 3002", @@ -22,8 +21,6 @@ "@adobe/mdast-util-gridtables": "^4.0.13", "@adobe/remark-gridtables": "^3.0.14", "@next/bundle-analyzer": "^15.4.5", - "@pantheon-systems/pcc-react-sdk": "3.13.0-beta.2", - "@pantheon-systems/pcc-sdk-core": "3.13.0-beta.2", "@pantheon-systems/pds-toolkit-react": "1.0.0-dev.256", "@radix-ui/react-popover": "^1.1.14", "@radix-ui/react-slot": "^1.2.3", diff --git a/seed/create-content-structure.ts b/seed/create-content-structure.ts deleted file mode 100644 index 4e514151f0..0000000000 --- a/seed/create-content-structure.ts +++ /dev/null @@ -1,112 +0,0 @@ -import { getOmniItems } from "@/components/omni-components"; -import { OmniItem } from "@/components/omni-components/helpers"; -import { ContentStructureItem, updateContentStructure } from "@/lib/ingestion"; -import { fetchArticleBySlug, singleSlugForFetch } from "@/lib/page-utils"; -import { writeFileSync } from "fs"; -import { join } from "path"; - -let processed = 0; -const token = process.env.PCC_TOKEN || ""; -const siteId = process.env.PCC_SITE_ID || ""; -const managementToken = process.env.PCC_MANAGEMENT_TOKEN || ""; - -const processOmniItems = async ( - omniItem: OmniItem -): Promise => { - processed++; - console.log(`Processed: ${processed}`); - let { link, title, children } = omniItem; - - console.log(`Processing link:`, link); - - if (link.startsWith("/")) { - link = link.slice(1); - } - if (link.endsWith("/")) { - link = link.slice(0, -1); - } - - let slug = singleSlugForFetch(link); - - console.log(`Processing slug:`, slug); - - const article = await fetchArticleBySlug(slug, siteId, token, { - withContent: false, - withMetadata: false, - }); - - if (!article) { - return null; - } - - let updatedChildren: ContentStructureItem[] = []; - - if (children && children.length > 0) { - // process in batches of 20 - const batchSize = 20; - const batches = []; - for (let i = 0; i < children.length; i += batchSize) { - batches.push(children.slice(i, i + batchSize)); - } - - for (const batch of batches) { - let innerChilren: ContentStructureItem[] = []; - for (const child of batch) { - try { - const result = await processOmniItems(child); - if (result) { - innerChilren.push(result); - } - } catch (error) { - console.error(`Error processing child:`, error); - } - } - updatedChildren.push(...innerChilren); - // wait for 500ms - await new Promise((resolve) => setTimeout(resolve, 1_000)); - } - } - - console.log(`Updated children:`, updatedChildren); - - return { - children: updatedChildren, - id: article.id, - isHidden: false, - type: "article", - name: omniItem.title, - slug: singleSlugForFetch(omniItem.link), - published: true, - }; -}; - -const main = async () => { - const omniItems = await getOmniItems(); - - const active: ContentStructureItem[] = []; - - for (const omniItem of omniItems) { - const contentStructureItem = await processOmniItems(omniItem); - if (contentStructureItem) { - active.push(contentStructureItem); - } - } - - writeFileSync( - join(process.cwd(), "active.json"), - JSON.stringify(active, null, 2) - ); - - await updateContentStructure( - siteId, - { - contentStructure: { - active, - uncategorized: [], - }, - }, - managementToken - ); -}; - -main().then(console.log).catch(console.error); diff --git a/seed/helper.ts b/seed/helper.ts deleted file mode 100644 index 91406137ba..0000000000 --- a/seed/helper.ts +++ /dev/null @@ -1,648 +0,0 @@ -import { getGlossaryPageData } from "@/lib/glossary"; -import { - createArticle, - disconnectArticle, - ingestMarkdown, - updateMetadata, -} from "@/lib/ingestion"; -import { - BasePageDataWithoutComponent, - fetchArticleBySlug, - PageDataWithoutComponent, - singleSlugForFetch as normalizeSlug, - getAllReleaseNotes, -} from "@/lib/page-utils"; -import { getFilesByExtension } from "@/server/processor/helper"; -import { ProcessedJsonFile, processFile } from "@/server/processor/json"; -import { processDirectoryForMarkDown } from "@/server/processor/mdx"; -import { ProcessedYamlFile, processYamlFile } from "@/server/processor/yaml"; -import { writeFileSync } from "fs"; -import path, { join } from "path"; - -const getDateFromFilename = (filename: string): Date | null => { - // Extract date from filename like "2024-01-22-drupal-7-99-release-bug fixes-and-feature-enhancements.md" - const dateMatch = filename.match(/^(\d{4}-\d{2}-\d{2})-/); - - if (dateMatch) { - const dateString = dateMatch[1]; - const date = new Date(dateString); - - // Check if the date is valid - if (!isNaN(date.getTime())) { - return date; - } - } - - return null; -}; - -async function saveDataAfterPreProcessing( - content: string, - page: Omit, - article: { id: string }, - ingestDate: Date = new Date() -) { - const lines = content - .replaceAll("![", "__IMAGE_REPLACEMENT_MARKER__") - .split("\n"); - const batches: string[] = []; - for (let i = 0; i < lines.length; i += 10000) { - batches.push(lines.slice(i, i + 10000).join("\n")); - } - - let i = 0; - console.log("Processing. Ingest Markdown", page.uri); - - for (const batch of batches) { - i++; - if (i > 1) { - console.error("Breaking"); - break; - } - try { - await ingestMarkdown(article.id, { - content: JSON.stringify({ content: batch }), - publishLevel: "prod", - contentType: "markdown", - docName: page.title, - docRevisionDate: ingestDate.getTime(), - }); - console.log(i); - } catch (err) { - console.error(err); - throw err; - } - } -} - -export const processPage = async ( - page: PageDataWithoutComponent, - allowFetch: boolean = true, - siteId: string = process.env.PCC_SITE_ID || "", - token: string = process.env.PCC_TOKEN || "" -) => { - if (page.uri.startsWith("wordpress-known-issues")) { - return; - } - - if (page.uri.startsWith("terminus/commands")) { - return; - } - - if (!allowFetch) { - console.log({ - uri: page.uri, - type: page.type, - title: page.title, - normalized: normalizeSlug(page.uri), - }); - - if (page.type !== "doc") { - return; - } - - let article = await fetchArticleBySlug( - normalizeSlug(page.uri), - siteId, - token, - { - withContent: false, - withMetadata: true, - } - ); - - if (!article) { - return; - } - - if (article.title !== page.title) { - console.log("Updating metadata", article.id, page.title); - await updateMetadata(article.id, { - title: page.title, - metadataFields: { - ...article.metadata, - title: page.title, - description: page.description, - }, - }); - console.log("Updated metadata", article.id, page.title); - } - - return; - } - - console.log("processing", page.type, page.uri, page.relativeFilePath); - - if (page.type === "release-note") { - let article: { id: string } = await fetchArticleBySlug( - normalizeSlug(page.uri) - ); - - const { content, internal, ...doc } = page.data.node; - const date = getDateFromFilename( - doc.relativePath.split("releasenotes/")[1] - ); - - if (!date) { - console.log("No date found for release note", doc.relativePath); - throw new Error("No date found for release note" + page.uri); - } - - if (article) { - return; - } - - if (!article) { - console.log("article not found", page.uri); - article = await createArticle({ - title: page.title, - siteId: process.env.PCC_SITE_ID || "", - metadataFields: { - slug: page.uri, - type: page.type, - relativePath: doc.relativePath, - description: page.description, - title: page.title, - prev: page.data.prev, - next: page.data.next, - }, - tags: doc.frontmatter.tags ?? [], - contentType: "TEXT_MARKDOWN", - }); - console.log("Created article", article); - } - - console.log("saving data", page.uri); - - await saveDataAfterPreProcessing( - page.rawFileData, - page, - article, - getDateFromFilename(doc.relativePath) ?? new Date() - ); - } - - if (page.type === "guide") { - let article: { id: string } = await fetchArticleBySlug( - normalizeSlug(page.uri) - ); - - if (article) { - return; - } - const { content, frontmatter, internal, ...doc } = page.data.guide; - - if (!article) { - console.log("article not found", page.uri); - article = await createArticle({ - title: page.title, - siteId: process.env.PCC_SITE_ID || "", - metadataFields: { - slug: page.uri, - type: page.type, - relativePath: doc.relativePath, - description: page.description, - title: page.title, - prev: page.data.prev, - next: page.data.next, - }, - tags: frontmatter.tags ?? [], - contentType: "TEXT_MARKDOWN", - }); - console.log("Created article", article); - } - - console.log("saving data", page.uri); - - await saveDataAfterPreProcessing(page.rawFileData, page, article); - } - - if (page.type === "doc") { - let article: { id: string } = await fetchArticleBySlug( - normalizeSlug(page.uri) - ); - if (article) { - return; - } - - const { content, frontmatter, internal, ...doc } = page.data.doc; - - if (!article) { - console.log("article not found", page.uri); - article = await createArticle({ - title: page.title, - siteId: process.env.PCC_SITE_ID || "", - metadataFields: { - slug: page.uri, - type: page.type, - relativePath: doc.relativePath, - description: page.description, - title: page.title, - }, - tags: frontmatter.tags ?? [], - contentType: "TEXT_MARKDOWN", - }); - console.log("Created article", article); - } - - await saveDataAfterPreProcessing(page.rawFileData, page, article); - } - - if (page.type === "landing") { - let article: { id: string } = await fetchArticleBySlug( - normalizeSlug(page.uri) - ); - console.log(page); - - if (article) { - return; - } - - console.log(article); - - const landing = page.data.landing; - - if (!article) { - console.log("article not found", page.uri); - article = await createArticle({ - title: page.title, - siteId: process.env.PCC_SITE_ID || "", - metadataFields: { - slug: page.uri, - type: page.type, - description: page.description, - }, - tags: [], - contentType: "TEXT_MARKDOWN", - }); - console.log("Created article", article); - } - - await saveDataAfterPreProcessing(JSON.stringify(landing), page, article); - } - - if (page.type === "iframe-embed") { - let article: { id: string } = await fetchArticleBySlug( - normalizeSlug(page.uri) - ); - - if (article) { - return; - } - const { content, frontmatter, internal, ...doc } = page.data.iframeEmbed; - - if (!article) { - console.log("article not found", page.uri); - article = await createArticle({ - title: page.title, - siteId: process.env.PCC_SITE_ID || "", - metadataFields: { - slug: page.uri, - type: page.type, - relativePath: doc.relativePath, - description: page.description, - title: page.title, - }, - tags: frontmatter.tags ?? [], - contentType: "TEXT_MARKDOWN", - }); - console.log("Created article", article); - } - - console.log("saving data", page.uri); - - await saveDataAfterPreProcessing(page.rawFileData, page, article); - } -}; - -export const updatePartials = async ( - allowFetch: boolean = true, - filter: (filePath: string) => boolean = (filePath) => { - return filePath.endsWith(".md") || filePath.endsWith(".mdx"); - } -) => { - if (!allowFetch) { - return; - } - - const files = processDirectoryForMarkDown("source/content/partials", { - filter, - }); - - for (const file of files) { - const slug = normalizeSlug( - file.relativePath.split("source/content/partials/")[1] - ); - console.log({ slug }); - let article = await fetchArticleBySlug(slug); - if (article) { - continue; - } - - if (!article) { - article = await createArticle({ - title: file.frontmatter.title ?? "partial-file", - contentType: "TEXT_MARKDOWN", - siteId: process.env.PCC_SITE_ID || "", - metadataFields: { - slug: slug, - type: "partial", - relativePath: file.relativePath, - }, - tags: [], - }); - console.log("Created article", article); - } - - await saveDataAfterPreProcessing( - file.internal.content, - { - uri: slug, - title: file.frontmatter.title ?? "partial-file", - description: file.frontmatter.description ?? "partial-file", - rawFileData: file.content, - }, - article - ); - - console.log("Updated article", article); - } -}; - -export const updateGlossary = async (allowFetch: boolean = true) => { - if (!allowFetch) { - return; - } - - const { allDefs, letters } = await getGlossaryPageData(); - - const slug = "glossary"; - let article = await fetchArticleBySlug(slug); - - if (!article) { - article = await createArticle({ - title: "Glossary", - siteId: process.env.PCC_SITE_ID || "", - metadataFields: { - slug: slug, - type: "glossary", - relativePath: "glossary.md", - }, - tags: [], - contentType: "TEXT_MARKDOWN", - }); - console.log("Created article", article); - } - - await saveDataAfterPreProcessing( - JSON.stringify({ allDefs, letters }), - { - uri: slug, - title: "Glossary", - description: "Glossary", - rawFileData: JSON.stringify({ allDefs, letters }), - }, - article - ); -}; -export const updateJSONFiles = async ( - allowFetch = true, - filter: (filePath: string) => boolean = (filePath) => { - return filePath.endsWith(".json"); - } -) => { - if (!allowFetch) { - return; - } - - const files = getFilesByExtension( - join(path.resolve(process.cwd(), "src"), "source"), - [".json"] - ); - - const filteredFiles = files.filter(filter); - - const jsonFiles = filteredFiles - .map(processFile) - .filter((file): file is ProcessedJsonFile => file !== null); - - for (const file of jsonFiles) { - if (file.fileName.startsWith(".")) { - continue; - } - - console.log("fetching", normalizeSlug(`${file.fileName}-json-file`)); - let article = await fetchArticleBySlug( - normalizeSlug(`${file.fileName}-json-file`) - ); - if (article) { - continue; - } - - if (!article) { - console.log("article not found", file.fileName); - article = await createArticle({ - title: `${file.fileName}-json-file`, - siteId: process.env.PCC_SITE_ID || "", - metadataFields: { - title: file.fileName, - slug: `${file.fileName}-json-file`, - type: "json", - relativePath: file.relativePath, - }, - tags: [], - contentType: "TEXT_MARKDOWN", - }); - } - - try { - await saveDataAfterPreProcessing( - JSON.stringify({ content: file.content }), - { - uri: file.fileName, - title: file.fileName, - description: file.fileName, - rawFileData: JSON.stringify({ content: file.content }), - }, - article - ); - } catch (err) { - try { - await disconnectArticle(article.id); - } catch {} - console.log("disconnected article", article.id); - continue; - } - } -}; - -export const updateYamlFiles = async ( - allowFetch = true, - filter: (filePath: string) => boolean = (filePath) => { - return filePath.endsWith(".yaml"); - } -) => { - if (!allowFetch) { - return; - } - - const files = getFilesByExtension( - join(path.resolve(process.cwd(), "src"), "source"), - [".yaml", ".yml"] - ); - - const filteredFiles = files.filter(filter); - - const yamlFiles = filteredFiles - .map(processYamlFile) - .filter((file): file is ProcessedYamlFile => file !== null); - - for (const file of yamlFiles) { - if (file.fileName.startsWith(".")) { - continue; - } - - console.log("fetching", normalizeSlug(`${file.fileName}-yaml-file`)); - let article = await fetchArticleBySlug( - normalizeSlug(`${file.fileName}-yaml-file`) - ); - if (article) { - continue; - } - - if (!article) { - console.log("article not found", file.fileName); - article = await createArticle({ - title: `${file.fileName}-yaml-file`, - siteId: process.env.PCC_SITE_ID || "", - metadataFields: { - title: file.fileName, - slug: `${file.fileName}-yaml-file`, - type: "yaml", - relativePath: file.relativePath, - }, - tags: [], - contentType: "TEXT_MARKDOWN", - }); - } - - try { - await saveDataAfterPreProcessing( - JSON.stringify({ content: file.content }), - { - uri: file.fileName, - title: file.fileName, - description: file.fileName, - rawFileData: JSON.stringify({ content: file.content }), - }, - article - ); - } catch (err) { - try { - await disconnectArticle(article.id); - } catch {} - console.log("disconnected article", article.id); - continue; - } - } -}; - -export const updateReleaseNotesListing = async (allowFetch = true) => { - if (!allowFetch) { - return; - } - - const allReleaseNotes = getAllReleaseNotes(); - const categories = allReleaseNotes.map((releaseNote) => { - return { - node: { - frontmatter: { - categories: releaseNote.frontmatter.categories ?? [], - }, - }, - }; - }); - const releaseNotes = getAllReleaseNotes().map((releaseNote) => { - const { content, internal, ...doc } = releaseNote; - return { slug: doc.fields.slug }; - }); - const allCategories = Array.from( - new Set(categories.map((c) => c.node.frontmatter.categories).flat()) - ); - - const slug = "release-notes-listing"; - - let article = await fetchArticleBySlug(slug); - - if (!article) { - article = await createArticle({ - title: "Release Notes Listing", - siteId: process.env.PCC_SITE_ID || "", - metadataFields: { - slug: slug, - }, - tags: [], - contentType: "TEXT_MARKDOWN", - }); - console.log("Created article", article); - } - - console.log(article); - - const content = JSON.stringify({ releaseNotes, categories: allCategories }); - - console.log(content); - - writeFileSync("release-notes-listing.json", content); - - await saveDataAfterPreProcessing( - content, - { - uri: slug, - title: "Release Notes Listing", - description: "Release Notes Listing", - rawFileData: content, - }, - article - ); - - // map categories to release note slugs - { - const categoryToReleaseNoteSlugs: Record = {}; - allReleaseNotes.map((e) => { - e.frontmatter.categories?.map((category) => { - if (!categoryToReleaseNoteSlugs[category]) { - categoryToReleaseNoteSlugs[category] = []; - } - categoryToReleaseNoteSlugs[category].push(e.fields.slug); - }); - }); - - const slug = "release-notes-listing-with-categories"; - - let article = await fetchArticleBySlug(slug); - - if (!article) { - article = await createArticle({ - title: "Release Notes Listing with Categories", - siteId: process.env.PCC_SITE_ID || "", - metadataFields: { - slug: slug, - }, - tags: [], - contentType: "TEXT_MARKDOWN", - }); - } - - await saveDataAfterPreProcessing( - JSON.stringify({ categoryToReleaseNoteSlugs }), - { - uri: slug, - title: "Release Notes Listing with Categories", - description: "Release Notes Listing with Categories", - rawFileData: JSON.stringify({ categoryToReleaseNoteSlugs }), - }, - article - ); - } -}; diff --git a/seed/initial-without-stringify.ts b/seed/initial-without-stringify.ts deleted file mode 100644 index 584f7792e9..0000000000 --- a/seed/initial-without-stringify.ts +++ /dev/null @@ -1,616 +0,0 @@ -import { - BasePageDataWithoutComponent, - fetchArticleBySlug, - getAllPages, - getAllReleaseNotes, - PageDataWithoutComponent, - singleSlugForFetch as normalizeSlug, -} from "@/lib/page-utils"; -import { - createArticle, - disconnectArticle, - ingestMarkdown, - updateMetadata, -} from "../src/lib/ingestion"; -import { ProcessedJsonFile, processFile } from "@/server/processor/json"; -import { getFilesByExtension } from "@/server/processor/helper"; -import path from "path"; -import { join } from "path"; -import { getGlossaryPageData } from "@/lib/glossary"; -import { processDirectoryForMarkDown } from "@/server/processor/mdx"; - -const allowFetch = true; -process.env.SERVE_LOCAL = "true"; - -const token = process.env.PCC_TOKEN || ""; -const siteId = process.env.PCC_SITE_ID || ""; -const managementToken = process.env.PCC_MANAGEMENT_TOKEN || ""; - -const getDateFromFilename = (filename: string): Date | null => { - // Extract date from filename like "2024-01-22-drupal-7-99-release-bug fixes-and-feature-enhancements.md" - const dateMatch = filename.match(/^(\d{4}-\d{2}-\d{2})-/); - - if (dateMatch) { - const dateString = dateMatch[1]; - const date = new Date(dateString); - - // Check if the date is valid - if (!isNaN(date.getTime())) { - return date; - } - } - - return null; -}; - -const processPage = async (page: PageDataWithoutComponent) => { - if (page.uri.startsWith("wordpress-known-issues")) { - return; - } - - if (page.uri.startsWith("terminus/commands")) { - return; - } - - if (!allowFetch) { - console.log({ - uri: page.uri, - type: page.type, - title: page.title, - normalized: normalizeSlug(page.uri), - }); - - if (page.type === "doc") { - console.log("Skipping doc", page.uri); - return; - } - - let article = await fetchArticleBySlug( - normalizeSlug(page.uri), - siteId, - token, - { - withContent: false, - withMetadata: true, - } - ); - - if (!article) { - return; - } - - if (article.title !== page.title) { - console.log("Updating metadata", article.id, page.title); - await updateMetadata( - article.id, - { - title: page.title, - metadataFields: { - ...article.metadata, - title: page.title, - description: page.description, - }, - }, - managementToken - ); - console.log("Updated metadata", article.id, page.title); - } - - return; - } - - if (page.type === "release-note") { - let article: { id: string } = await fetchArticleBySlug( - normalizeSlug(page.uri) - ); - - const { content, internal, ...doc } = page.data.node; - const date = getDateFromFilename( - doc.relativePath.split("releasenotes/")[1] - ); - - if (!date) { - console.log("No date found for release note", doc.relativePath); - throw new Error("No date found for release note" + page.uri); - } - - if (article) { - return; - } - - if (!article) { - console.log("article not found", page.uri); - article = await createArticle( - { - title: page.title, - siteId: siteId, - metadataFields: { - slug: page.uri, - type: page.type, - relativePath: doc.relativePath, - description: page.description, - title: page.title, - prev: page.data.prev, - next: page.data.next, - }, - tags: doc.frontmatter.tags ?? [], - contentType: "TEXT_MARKDOWN", - }, - managementToken - ); - console.log("Created article", article); - } - - console.log("saving data", page.uri); - - await saveDataAfterPreProcessing( - page.rawFileData, - page, - article, - getDateFromFilename(doc.relativePath) ?? new Date() - ); - } - - if (page.type === "guide") { - let article: { id: string } = await fetchArticleBySlug( - normalizeSlug(page.uri) - ); - - if (article) { - return; - } - const { content, frontmatter, internal, ...doc } = page.data.guide; - - if (!article) { - console.log("article not found", page.uri); - article = await createArticle( - { - title: page.title, - siteId: siteId, - metadataFields: { - slug: page.uri, - type: page.type, - relativePath: doc.relativePath, - description: page.description, - title: page.title, - prev: page.data.prev, - next: page.data.next, - }, - tags: frontmatter.tags ?? [], - contentType: "TEXT_MARKDOWN", - }, - managementToken - ); - console.log("Created article", article); - } - - console.log("saving data", page.uri); - - await saveDataAfterPreProcessing(page.rawFileData, page, article); - } - - if (page.type === "doc") { - let article: { id: string } = await fetchArticleBySlug( - normalizeSlug(page.uri) - ); - if (article) { - return; - } - - const { content, frontmatter, internal, ...doc } = page.data.doc; - - if (!article) { - console.log("article not found", page.uri); - article = await createArticle( - { - title: page.title, - siteId: siteId, - metadataFields: { - slug: page.uri, - type: page.type, - relativePath: doc.relativePath, - description: page.description, - title: page.title, - }, - tags: frontmatter.tags ?? [], - contentType: "TEXT_MARKDOWN", - }, - managementToken - ); - console.log("Created article", article); - } - - await saveDataAfterPreProcessing(page.rawFileData, page, article); - } - - if (page.type === "landing") { - let article: { id: string } = await fetchArticleBySlug( - normalizeSlug(page.uri) - ); - console.log(page); - - if (article) { - return; - } - - console.log(article); - - const landing = page.data.landing; - - if (!article) { - console.log("article not found", page.uri); - article = await createArticle( - { - title: page.title, - siteId: siteId, - metadataFields: { - slug: page.uri, - type: page.type, - description: page.description, - }, - tags: [], - contentType: "TEXT_MARKDOWN", - }, - managementToken - ); - console.log("Created article", article); - } - - await saveDataAfterPreProcessing(JSON.stringify(landing), page, article); - } - - if (page.type === "iframe-embed") { - let article: { id: string } = await fetchArticleBySlug( - normalizeSlug(page.uri) - ); - - if (article) { - return; - } - const { content, frontmatter, internal, ...doc } = page.data.iframeEmbed; - - if (!article) { - console.log("article not found", page.uri); - article = await createArticle( - { - title: page.title, - siteId: siteId, - metadataFields: { - slug: page.uri, - type: page.type, - relativePath: doc.relativePath, - description: page.description, - title: page.title, - }, - tags: frontmatter.tags ?? [], - contentType: "TEXT_MARKDOWN", - }, - managementToken - ); - console.log("Created article", article); - } - - console.log("saving data", page.uri); - - await saveDataAfterPreProcessing(page.rawFileData, page, article); - } -}; - -const updateReleaseNotesListing = async () => { - if (!allowFetch) { - return; - } - - const allReleaseNotes = getAllReleaseNotes(); - const categories = allReleaseNotes.map((releaseNote) => { - return { - node: { - frontmatter: { - categories: releaseNote.frontmatter.categories ?? [], - }, - }, - }; - }); - const releaseNotes = getAllReleaseNotes().map((releaseNote) => { - const { content, internal, ...doc } = releaseNote; - return { slug: doc.fields.slug }; - }); - const allCategories = Array.from( - new Set(categories.map((c) => c.node.frontmatter.categories).flat()) - ); - - const slug = "release-notes-listing"; - let article = await fetchArticleBySlug(slug); - - if (!article) { - article = await createArticle( - { - title: "Release Notes Listing", - siteId: siteId, - metadataFields: { - slug: slug, - }, - tags: [], - contentType: "TEXT_MARKDOWN", - }, - managementToken - ); - console.log("Created article", article); - } - - console.log(article); - - const content = JSON.stringify({ releaseNotes, categories: allCategories }); - - console.log(content); - - // writeFileSync("release-notes-listing.json", content); - - await saveDataAfterPreProcessing( - content, - { - uri: slug, - title: "Release Notes Listing", - description: "Release Notes Listing", - rawFileData: content, - }, - article - ); -}; - -const updateAllJSON = async () => { - if (!allowFetch) { - return; - } - - const files = getFilesByExtension( - join(path.resolve(process.cwd(), "src"), "source"), - [".json"] - ); - - const jsonFiles = files - .map(processFile) - .filter((file): file is ProcessedJsonFile => file !== null); - - for (const file of jsonFiles) { - if (file.fileName.startsWith(".")) { - continue; - } - - console.log("fetching", normalizeSlug(`${file.fileName}-json-file`)); - let article = await fetchArticleBySlug( - normalizeSlug(`${file.fileName}-json-file`) - ); - if (article) { - continue; - } - - if (!article) { - console.log("article not found", file.fileName); - article = await createArticle( - { - title: `${file.fileName}-json-file`, - siteId: siteId, - metadataFields: { - title: file.fileName, - slug: `${file.fileName}-json-file`, - type: "json", - relativePath: file.relativePath, - }, - tags: [], - contentType: "TEXT_MARKDOWN", - }, - managementToken - ); - } - - try { - await saveDataAfterPreProcessing( - JSON.stringify({ content: file.content }), - { - uri: file.fileName, - title: file.fileName, - description: file.fileName, - rawFileData: JSON.stringify({ content: file.content }), - }, - article - ); - } catch (err) { - try { - await disconnectArticle(article.id, managementToken); - } catch {} - console.log("disconnected article", article.id); - continue; - } - } -}; - -const updateGlossary = async () => { - if (!allowFetch) { - return; - } - - const { allDefs, letters } = await getGlossaryPageData(); - - const slug = "glossary"; - let article = await fetchArticleBySlug(slug); - - if (!article) { - article = await createArticle( - { - title: "Glossary", - siteId: siteId, - metadataFields: { - slug: slug, - type: "glossary", - relativePath: "glossary.md", - }, - tags: [], - contentType: "TEXT_MARKDOWN", - }, - managementToken - ); - console.log("Created article", article); - } - - await saveDataAfterPreProcessing( - JSON.stringify({ allDefs, letters }), - { - uri: slug, - title: "Glossary", - description: "Glossary", - rawFileData: JSON.stringify({ allDefs, letters }), - }, - article - ); -}; - -const updatePartials = async () => { - if (!allowFetch) { - return; - } - - const files = processDirectoryForMarkDown("source/content/partials", {}); - - if (files.length > 0) { - // Process files in batches of 25 - const batchSize = 25; - for (let i = 0; i < files.length; i += batchSize) { - const batch = files.slice(i, i + batchSize); - if (allowFetch) { - console.log( - `Processing partials batch ${Math.floor(i / batchSize) + 1} of ${Math.ceil(files.length / batchSize)}` - ); - } - - // Process batch in parallel - await Promise.all( - batch.map(async (file) => { - const slug = normalizeSlug( - file.relativePath.split("source/content/partials/")[1] - ); - console.log(slug); - let article = await fetchArticleBySlug(slug); - if (article) { - return; - } - - if (!article) { - article = await createArticle( - { - title: file.frontmatter.title ?? "partial-file", - contentType: "TEXT_MARKDOWN", - siteId: siteId, - metadataFields: { - slug: slug, - type: "partial", - relativePath: file.relativePath, - }, - tags: [], - }, - managementToken - ); - console.log("Created article", article); - } - - await saveDataAfterPreProcessing( - file.internal.content, - { - uri: slug, - title: file.frontmatter.title ?? "partial-file", - description: file.frontmatter.description ?? "partial-file", - rawFileData: file.content, - }, - article - ); - }) - ); - } - } -}; - -const main = async () => { - await updatePartials(); - await updateGlossary(); - await updateAllJSON(); - await updateReleaseNotesListing(); - - let pages: PageDataWithoutComponent[] = await getAllPages(); - pages = pages.slice(60); - if (pages.length > 0) { - // Process pages in batches of 8 - const batchSize = 8; - for (let i = 0; i < pages.length; i += batchSize) { - const batch = pages.slice(i, i + batchSize); - if (allowFetch) { - console.log( - `Processing batch ${Math.floor(i / batchSize) + 1} of ${Math.ceil(pages.length / batchSize)}` - ); - } - - // Process batch in parallel - await Promise.all(batch.map((page) => processPage(page))); - } - } - - // store JSON and YAML files -}; - -main().catch(console.error); - -async function saveDataAfterPreProcessing( - content: string, - page: Omit, - article: { id: string }, - ingestDate: Date = new Date() -) { - const lines = content - .replaceAll("![", "__IMAGE_REPLACEMENT_MARKER__") - .split("\n"); - const batches: string[] = []; - for (let i = 0; i < lines.length; i += 10000) { - batches.push(lines.slice(i, i + 10000).join("\n")); - } - - let i = 0; - console.log("Processing. Ingest Markdown", page.uri); - - for (const batch of batches) { - i++; - if (i > 1) { - console.error("Breaking"); - break; - } - try { - const processedContent = (() => { - let stringContent = JSON.stringify({ - __PATHEON_SEPARATOR_CONTENT__: batch, - }); - // remove {"__PATHEON_SEPARATOR_CONTENT__": - stringContent = stringContent.replace( - `{"__PATHEON_SEPARATOR_CONTENT__":"`, - "" - ); - //remove last "}" - stringContent = stringContent.replace(`"}`, ""); - return stringContent; - })(); - - await ingestMarkdown( - article.id, - { - content: processedContent, - publishLevel: "prod", - contentType: "markdown", - docName: page.title, - docRevisionDate: ingestDate.getTime(), - }, - managementToken - ); - console.log(i); - } catch (err) { - console.error(err); - throw err; - } - } -} diff --git a/seed/initial.ts b/seed/initial.ts deleted file mode 100644 index 9140c1cd80..0000000000 --- a/seed/initial.ts +++ /dev/null @@ -1,341 +0,0 @@ -import { - BasePageDataWithoutComponent, - fetchArticleBySlug, - getAllPages, - PageDataWithoutComponent, - singleSlugForFetch as normalizeSlug, -} from "@/lib/page-utils"; -import { - createArticle, - ingestMarkdown, - updateMetadata, -} from "../src/lib/ingestion"; -import { - updateGlossary, - updateJSONFiles, - updatePartials, - updateReleaseNotesListing, -} from "./helper"; - -const allowFetch = false; -process.env.SERVE_LOCAL = "true"; - -const token = process.env.PCC_TOKEN || ""; -const siteId = process.env.PCC_SITE_ID || ""; - -const getDateFromFilename = (filename: string): Date | null => { - // Extract date from filename like "2024-01-22-drupal-7-99-release-bug fixes-and-feature-enhancements.md" - const dateMatch = filename.match(/^(\d{4}-\d{2}-\d{2})-/); - - if (dateMatch) { - const dateString = dateMatch[1]; - const date = new Date(dateString); - - // Check if the date is valid - if (!isNaN(date.getTime())) { - return date; - } - } - - return null; -}; - -const processPage = async (page: PageDataWithoutComponent) => { - if (page.uri.startsWith("wordpress-known-issues")) { - return; - } - - if (page.uri.startsWith("terminus/commands")) { - return; - } - - if (!allowFetch) { - console.log({ - uri: page.uri, - type: page.type, - title: page.title, - normalized: normalizeSlug(page.uri), - }); - - if (page.type !== "doc") { - return; - } - - let article = await fetchArticleBySlug( - normalizeSlug(page.uri), - siteId, - token, - { - withContent: false, - withMetadata: true, - } - ); - - if (!article) { - return; - } - - if (article.title !== page.title) { - console.log("Updating metadata", article.id, page.title); - await updateMetadata(article.id, { - title: page.title, - metadataFields: { - ...article.metadata, - title: page.title, - description: page.description, - }, - }); - console.log("Updated metadata", article.id, page.title); - } - - return; - } - - if (page.type === "release-note") { - let article: { id: string } = await fetchArticleBySlug( - normalizeSlug(page.uri) - ); - - const { content, internal, ...doc } = page.data.node; - const date = getDateFromFilename( - doc.relativePath.split("releasenotes/")[1] - ); - - if (!date) { - console.log("No date found for release note", doc.relativePath); - throw new Error("No date found for release note" + page.uri); - } - - if (article) { - return; - } - - if (!article) { - console.log("article not found", page.uri); - article = await createArticle({ - title: page.title, - siteId: process.env.PCC_SITE_ID || "", - metadataFields: { - slug: page.uri, - type: page.type, - relativePath: doc.relativePath, - description: page.description, - title: page.title, - prev: page.data.prev, - next: page.data.next, - }, - tags: doc.frontmatter.tags ?? [], - contentType: "TEXT_MARKDOWN", - }); - console.log("Created article", article); - } - - console.log("saving data", page.uri); - - await saveDataAfterPreProcessing( - page.rawFileData, - page, - article, - getDateFromFilename(doc.relativePath) ?? new Date() - ); - } - - if (page.type === "guide") { - let article: { id: string } = await fetchArticleBySlug( - normalizeSlug(page.uri) - ); - - if (article) { - return; - } - const { content, frontmatter, internal, ...doc } = page.data.guide; - - if (!article) { - console.log("article not found", page.uri); - article = await createArticle({ - title: page.title, - siteId: process.env.PCC_SITE_ID || "", - metadataFields: { - slug: page.uri, - type: page.type, - relativePath: doc.relativePath, - description: page.description, - title: page.title, - prev: page.data.prev, - next: page.data.next, - }, - tags: frontmatter.tags ?? [], - contentType: "TEXT_MARKDOWN", - }); - console.log("Created article", article); - } - - console.log("saving data", page.uri); - - await saveDataAfterPreProcessing(page.rawFileData, page, article); - } - - if (page.type === "doc") { - let article: { id: string } = await fetchArticleBySlug( - normalizeSlug(page.uri) - ); - if (article) { - return; - } - - const { content, frontmatter, internal, ...doc } = page.data.doc; - - if (!article) { - console.log("article not found", page.uri); - article = await createArticle({ - title: page.title, - siteId: process.env.PCC_SITE_ID || "", - metadataFields: { - slug: page.uri, - type: page.type, - relativePath: doc.relativePath, - description: page.description, - title: page.title, - }, - tags: frontmatter.tags ?? [], - contentType: "TEXT_MARKDOWN", - }); - console.log("Created article", article); - } - - await saveDataAfterPreProcessing(page.rawFileData, page, article); - } - - if (page.type === "landing") { - let article: { id: string } = await fetchArticleBySlug( - normalizeSlug(page.uri) - ); - console.log(page); - - if (article) { - return; - } - - console.log(article); - - const landing = page.data.landing; - - if (!article) { - console.log("article not found", page.uri); - article = await createArticle({ - title: page.title, - siteId: process.env.PCC_SITE_ID || "", - metadataFields: { - slug: page.uri, - type: page.type, - description: page.description, - }, - tags: [], - contentType: "TEXT_MARKDOWN", - }); - console.log("Created article", article); - } - - await saveDataAfterPreProcessing(JSON.stringify(landing), page, article); - } - - if (page.type === "iframe-embed") { - let article: { id: string } = await fetchArticleBySlug( - normalizeSlug(page.uri) - ); - - if (article) { - return; - } - const { content, frontmatter, internal, ...doc } = page.data.iframeEmbed; - - if (!article) { - console.log("article not found", page.uri); - article = await createArticle({ - title: page.title, - siteId: process.env.PCC_SITE_ID || "", - metadataFields: { - slug: page.uri, - type: page.type, - relativePath: doc.relativePath, - description: page.description, - title: page.title, - }, - tags: frontmatter.tags ?? [], - contentType: "TEXT_MARKDOWN", - }); - console.log("Created article", article); - } - - console.log("saving data", page.uri); - - await saveDataAfterPreProcessing(page.rawFileData, page, article); - } -}; - -const main = async () => { - await updatePartials(allowFetch); - await updateGlossary(allowFetch); - await updateJSONFiles(allowFetch); - await updateReleaseNotesListing(allowFetch); - - const pages: PageDataWithoutComponent[] = await getAllPages(); - if (pages.length > 0) { - // Process pages in batches of 8 - const batchSize = 8; - for (let i = 0; i < pages.length; i += batchSize) { - const batch = pages.slice(i, i + batchSize); - if (allowFetch) { - console.log( - `Processing batch ${Math.floor(i / batchSize) + 1} of ${Math.ceil(pages.length / batchSize)}` - ); - } - - // Process batch in parallel - await Promise.all(batch.map((page) => processPage(page))); - } - } - - // store JSON and YAML files -}; - -main().catch(console.error); - -async function saveDataAfterPreProcessing( - content: string, - page: Omit, - article: { id: string }, - ingestDate: Date = new Date() -) { - const lines = content - .replaceAll("![", "__IMAGE_REPLACEMENT_MARKER__") - .split("\n"); - const batches: string[] = []; - for (let i = 0; i < lines.length; i += 10000) { - batches.push(lines.slice(i, i + 10000).join("\n")); - } - - let i = 0; - console.log("Processing. Ingest Markdown", page.uri); - - for (const batch of batches) { - i++; - if (i > 1) { - console.error("Breaking"); - break; - } - try { - await ingestMarkdown(article.id, { - content: JSON.stringify({ content: batch }), - publishLevel: "prod", - contentType: "markdown", - docName: page.title, - docRevisionDate: ingestDate.getTime(), - }); - console.log(i); - } catch (err) { - console.error(err); - throw err; - } - } -} diff --git a/seed/update.ts b/seed/update.ts deleted file mode 100644 index 32fb6801e3..0000000000 --- a/seed/update.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { getAllPages } from "@/lib/page-utils"; -import { readFileSync } from "node:fs"; -import { - processPage, - updateGlossary, - updateJSONFiles, - updatePartials, - updateReleaseNotesListing, - updateYamlFiles, -} from "./helper"; - -process.env.SERVE_LOCAL = "true"; - -if (!process.env.PCC_SITE_ID) { - throw new Error("PCC_SITE_ID is not set"); -} - -if (!process.env.PCC_TOKEN) { - throw new Error("PCC_TOKEN is not set"); -} - -if (!process.env.PCC_MANAGEMENT_TOKEN) { - throw new Error("PCC_MANAGEMENT_TOKEN is not set"); -} - -const files = readFileSync("/tmp/changed_files.txt", "utf-8") - .toString() - .split("\n"); - -const filteredFiles = files.filter((e) => e.startsWith("src/source")); - -const main = async () => { - const mdxFiles = filteredFiles.filter( - (e) => e.endsWith(".md") || e.endsWith(".mdx") - ); - - console.log({ mdxFiles }); - // if mdx, then we need to update the page - const pages = await getAllPages(); - const pagesToUpdate = pages.filter((page) => - mdxFiles.includes(page.relativeFilePath) - ); - - console.log({ pagesToUpdate: pagesToUpdate.map((e) => e.relativeFilePath) }); - - const batchSize = 8; - - for (let i = 0; i < pagesToUpdate.length / batchSize; i++) { - const batch = pagesToUpdate.slice(i * batchSize, (i + 1) * batchSize); - await Promise.all(batch.map((page) => processPage(page))); - console.log( - `Processed batch ${i + 1} of ${pagesToUpdate.length / batchSize}` - ); - } - - // if partials encountered, then we need to update the partials - await updatePartials(true, (page) => { - const splitPage = page.split("/src/source/"); - return mdxFiles.includes(`src/source/${splitPage[1]}`); - }); - - // if glossary encountered, then we need to update the glossary - // always update glossary - await updateGlossary(true); - - // if .json encountered, then we need to update the .json - const jsonFiles = filteredFiles.filter((e) => e.endsWith(".json")); - await updateJSONFiles(true, (page) => { - const splitPage = page.split("/src/source"); - - return jsonFiles.includes(`src/source${splitPage[1]}`); - }); - - // if .yaml encountered, then we need to update the .yaml - const yamlFiles = filteredFiles.filter( - (e) => e.endsWith(".yaml") || e.endsWith(".yml") - ); - - await updateYamlFiles(true, (page) => { - const splitPage = page.split("/src/source"); - const result = yamlFiles.includes(`src/source${splitPage[1]}`); - return result; - }); - - // if release-notes/ updated, then we need to update release-notes listing - if (mdxFiles.some((e) => e.includes("src/source/releasenotes/"))) { - await updateReleaseNotesListing(true); - } -}; - -main().catch(console.error); diff --git a/src/app/[...uri]/page.tsx b/src/app/[...uri]/page.tsx index 6e753a9337..5174dd5211 100644 --- a/src/app/[...uri]/page.tsx +++ b/src/app/[...uri]/page.tsx @@ -1,14 +1,7 @@ "use server"; import { notFound } from "next/navigation"; -import { - fetchArticleBySlug, - getAllPages, - singleSlugForFetch, -} from "@/lib/page-utils"; -import { resolveComponent, serveLocalAsync } from "@/lib/resolve-component"; -import { LandingTemplate } from "@/templates/landing"; -import { getMdxProcessed } from "@/server/processor/mdx"; -import { basename, join } from "path"; +import { getAllPages } from "@/lib/page-utils"; +import { resolveComponent } from "@/lib/resolve-component"; import { generateMetadataFromUri, GenerateMetadataParams, @@ -16,11 +9,6 @@ import { export interface DynamicViewProps { params: { uri: string[] }; - searchParams: { - publishingLevel: "PRODUCTION" | "REALTIME"; - pccGrant: string | undefined; - local: "true" | "false" | undefined; - }; } const getPages = async ( @@ -90,7 +78,6 @@ const getPages = async ( export default async function Page(props: { params: Promise; - searchParams: Promise; }) { // create landing pages for each of the pages in the data/landings.yaml file @@ -100,10 +87,7 @@ export default async function Page(props: { return notFound(); } - const { Component } = await getPages( - uri, - // await serveLocalAsync(props.searchParams) - ); + const { Component } = await getPages(uri); if (Component === null) { return notFound(); @@ -114,7 +98,6 @@ export default async function Page(props: { export async function generateMetadata(props: { params: Promise; - searchParams: Promise; }) { const { uri } = await props.params; @@ -125,10 +108,7 @@ export async function generateMetadata(props: { }; } - const { seoMetadata } = await getPages( - uri, - // await serveLocalAsync(props.searchParams) - ); + const { seoMetadata } = await getPages(uri); const { authors, ...returnData } = generateMetadataFromUri({ ...seoMetadata, diff --git a/src/app/glossary/page.tsx b/src/app/glossary/page.tsx index e1c0838393..b47f6ae8c6 100644 --- a/src/app/glossary/page.tsx +++ b/src/app/glossary/page.tsx @@ -8,41 +8,13 @@ import { DocsSidebarLayout } from "@/components/pds-middleware/docs-sidebar-layo import { MOBILE_MENU_BREAKPOINT } from "@/constants"; import HeaderBody from "@/components/common/header-body"; import { TOC } from "@/components/common/toc"; -import { AllDefs, getGlossaryPageData } from "@/lib/glossary"; -import { serveLocalAsync } from "@/lib/resolve-component"; -import { fetchArticleBySlug } from "@/lib/page-utils"; +import { getGlossaryPageData } from "@/lib/glossary"; import { generateMetadataFromUri } from "@/lib/site-metadata"; const converter = new showdown.Converter(); -const getPageData = async (useLocal: boolean) => { - if (!useLocal) { - try { - const article = await fetchArticleBySlug("glossary"); - const parsedContent = JSON.parse(JSON.parse(article.content).content); - - const { allDefs, letters } = parsedContent; - return { allDefs, letters } as { allDefs: AllDefs; letters: string[] }; - } catch (error) { - console.error("Error fetching glossary page data", error); - return { allDefs: [], letters: [] }; - } - } +export default async function GlossaryPage() { const { allDefs, letters } = await getGlossaryPageData(); - return { allDefs, letters }; -}; - -export default async function GlossaryPage(props: { - searchParams: Promise<{ - local: "true" | "false" | undefined; - }>; -}) { - // @todo, consider un-hardcoding this value. - // See https://github.com/pantheon-systems/documentation-in-nextjs/issues/32 - //const useLocal = await serveLocalAsync(props.searchParams); - const useLocal = true; - - const { allDefs, letters } = await getPageData(useLocal); return ( diff --git a/src/app/page.tsx b/src/app/page.tsx index 2d87dfb934..bc38fcc295 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -10,14 +10,6 @@ import { generateMetadataFromUri } from "@/lib/site-metadata"; const containerWidth = "standard"; export default async function Home() { - // Fetch the articles and site in parallel - // const [{ data: articles }, site] = await Promise.all([ - // PCCConvenienceFunctions.getPaginatedArticles({ - // pageSize: 3, - // }), - // PCCConvenienceFunctions.getSite(), - // ]); - const homeYaml = processDirectoryForYaml("source/data", { filter: (filePath) => filePath.includes("home.yaml"), })[0].content[0]; diff --git a/src/app/release-notes/[...uri]/page.tsx b/src/app/release-notes/[...uri]/page.tsx index 152450ba64..af4ed6f457 100644 --- a/src/app/release-notes/[...uri]/page.tsx +++ b/src/app/release-notes/[...uri]/page.tsx @@ -1,35 +1,19 @@ "use server"; -import { - fetchArticleBySlug, - getAllPages, - singleSlugForFetch, -} from "@/lib/page-utils"; -import { serveLocalAsync } from "@/lib/resolve-component"; +import { getAllPages } from "@/lib/page-utils"; import { generateMetadataFromUri } from "@/lib/site-metadata"; -import { getMdxProcessed } from "@/server/processor/mdx"; import { ReleaseNoteTemplate } from "@/templates/release-note"; import { ReleaseNoteListingTemplate } from "@/templates/release-note-listing"; -import { - getArticleBySlugOrId, - PCCConvenienceFunctions, -} from "@pantheon-systems/pcc-react-sdk/server"; import { notFound } from "next/navigation"; -import { basename, join } from "path"; export interface DynamicViewProps { params: Promise<{ uri: string[] }>; searchParams: Promise<{ - local: "true" | "false" | undefined; category?: string[]; }>; } -const getPage = async ( - uri: string[], - useLocal: boolean, - category?: string[] -) => { +const getPage = async (uri: string[], category?: string[]) => { if (uri.length === 1 && !Number.isNaN(parseInt(uri[0]))) { // list of articles @@ -80,7 +64,7 @@ export default async function Page(props: DynamicViewProps) { const { category } = await props.searchParams; - const { Component } = await getPage(uri, false, category); + const { Component } = await getPage(uri, category); if (Component === null) { return notFound(); diff --git a/src/components/grid.tsx b/src/components/grid.tsx deleted file mode 100644 index 2d8a7dffbe..0000000000 --- a/src/components/grid.tsx +++ /dev/null @@ -1,154 +0,0 @@ -"use client"; - -import type { - ArticleWithoutContent, - Site, -} from "@pantheon-systems/pcc-react-sdk"; -import { getArticleURLFromSite } from "@pantheon-systems/pcc-react-sdk/server"; -import Link from "next/link"; -import { useState } from "react"; -import { cn } from "@/lib/utils"; -import { Button } from "./ui/button"; - -export function HomepageArticleGrid({ - articles, - site, -}: { - articles: ArticleWithoutContent[]; - site: Site; -}) { - return ( -
- {articles.map((article, index) => ( - 2 && index === 2)} - site={site} - /> - ))} -
- ); -} - -export function ArticleGrid({ - articles, - basePath = "/articles", - site, -}: { - articles: ArticleWithoutContent[]; - basePath?: string; - site: Site; -}) { - return ( -
- {articles.map((article) => ( - - ))} -
- ); -} - -interface ArticleGridCardProps { - article: ArticleWithoutContent; - basePath?: string; - imageAltText?: string; - isWide?: boolean; - site: Site; -} - -export function ArticleGridCard({ - article, - basePath = "/articles", - imageAltText, - isWide = false, - site, -}: ArticleGridCardProps) { - const targetHref = getArticleURLFromSite(article, site, basePath); - const imageSrc = (article.metadata?.["image"] as string) || null; - - return ( -
-
- -
-
-
-

- {article.title} -

- {article.metadata?.["Description"] ? ( -

- {article.metadata?.["Description"]?.toString() || ""} -

- ) : null} -
- - - -
-
- ); -} - -function GridItemCoverImage({ - imageSrc, - imageAltText, -}: { - imageSrc: string | null; - imageAltText?: string | null | undefined; -}) { - const [hasLoaded, setHasLoaded] = useState(false); - - return ( - <> - {imageSrc != null ? ( - // eslint-disable-next-line @next/next/no-img-element - {imageAltText setHasLoaded(true)} - className={cn("h-full w-full object-cover", { - block: hasLoaded, - hidden: !hasLoaded, - })} - /> - ) : null} - - {imageSrc == null || !hasLoaded ? ( -
- ) : null} - - ); -} diff --git a/src/components/omniSideBarNav.tsx b/src/components/omniSideBarNav.tsx index 7d4f8e35fc..66950239f2 100644 --- a/src/components/omniSideBarNav.tsx +++ b/src/components/omniSideBarNav.tsx @@ -1,58 +1,21 @@ "use server"; -import { - findSubMenuItemsToUse, - getOmniSidebarActiveSection, -} from "./omni-components/helpers"; +import { getOmniSidebarActiveSection } from "./omni-components/helpers"; import { SideNavCompact } from "./ui/pds-re-export"; -import { Navbar } from "./common/navbar"; import { MOBILE_MENU_BREAKPOINT } from "@/constants"; import { getOmniItems } from "./omni-components"; import { turnItemsIntoLinks } from "./omni-components/client-helper"; export const OmniSidebarNav = async ({ activePage, - fallbackItems = null, - fallbackTitle = "", - submenuPathToUse = "", - slot = "", }: { activePage: string; - fallbackItems?: any[] | null; - fallbackTitle: string; - submenuPathToUse: string; - slot?: string; }) => { const OmniItems = await getOmniItems(); - /* Reporting debug code - const flattenedOmniItems = flattenOmniItems(OmniItems); - const results = CalculateFilteredPathsInMenu( - filteredWrittenPaths, - flattenedOmniItems, -); - console.log(results); - */ - const menuItems = getOmniSidebarActiveSection(activePage, OmniItems); - // If the caller is asking for a specific submenu, use that directly. - if (submenuPathToUse.length > 0) { - const submenuItems = findSubMenuItemsToUse(submenuPathToUse, OmniItems); - if (!submenuItems) { - return null; - } - const submenuLinks = turnItemsIntoLinks(submenuItems, activePage); - return ( - - ); - } else if (menuItems) { + if (menuItems) { const OmniLinks = turnItemsIntoLinks(menuItems, activePage); return ( ); - } else if (fallbackItems && fallbackItems.length > 0) { - return ( - <> - - - ); } else { return
; } diff --git a/src/components/ui/mdx-wrapper/default-components.tsx b/src/components/ui/mdx-wrapper/default-components.tsx index 66cddf1f3c..84a517d02b 100644 --- a/src/components/ui/mdx-wrapper/default-components.tsx +++ b/src/components/ui/mdx-wrapper/default-components.tsx @@ -1,5 +1,4 @@ -import { ComponentProps } from "react"; -import { ArticleRenderer } from "../pds-re-export"; +import { ReactNode } from "react"; import { Alert } from "@/components/common/alert"; import { Callout } from "@/components/common/callout"; import { Accordion } from "@/components/common/accordion"; @@ -29,7 +28,14 @@ import { Popover } from "@/components/common/popover"; import { Wistia } from "@/components/common/wistia"; import Enablement from "@/components/common/enablement"; -export type MdxWrapperProps = ComponentProps; +export interface MdxWrapperArticle { + content?: string; +} + +export interface MdxWrapperProps { + article: MdxWrapperArticle; + componentMap?: Record>; +} const ImageRenderer = async ({ src = "", alt }: any) => { let resolvedSrc = path.join(process.cwd(), "src", "source", "images", src); diff --git a/src/components/ui/pds-re-export.ts b/src/components/ui/pds-re-export.ts index f28b0ce980..3f468d8cdd 100644 --- a/src/components/ui/pds-re-export.ts +++ b/src/components/ui/pds-re-export.ts @@ -1,3 +1,2 @@ "use client"; export * from "@pantheon-systems/pds-toolkit-react"; -export * from "@pantheon-systems/pcc-react-sdk/components"; diff --git a/src/hooks/usePagination.ts b/src/hooks/usePagination.ts deleted file mode 100644 index 84b5c1f12a..0000000000 --- a/src/hooks/usePagination.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { - ArticleWithoutContent, - PaginatedArticle, -} from "@pantheon-systems/pcc-react-sdk"; -import { useEffect, useState } from "react"; - -interface Props { - cursor?: string; - initialArticles?: PaginatedArticle[] | ArticleWithoutContent[]; - fetcher: (cursor: string | null | undefined) => Promise<{ - data: PaginatedArticle[] | ArticleWithoutContent[]; - newCursor: string; - }>; -} - -export function usePagination({ cursor, initialArticles, fetcher }: Props) { - const [currentCursor, setCurrentCursor] = useState(cursor); - const [articlePages, setArticlePages] = useState( - initialArticles ? [initialArticles] : [], - ); - const [fetching, setFetching] = useState(false); - const [currentPage, setCurrentPage] = useState(0); - - useEffect(() => { - (async () => { - if (articlePages[currentPage]) return; - - setFetching(true); - const { data, newCursor } = await fetcher(currentCursor); - setFetching(false); - setArticlePages((prev) => { - const result = [...prev]; - result[currentPage] = data; - return result; - }); - setCurrentCursor(newCursor); - })(); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [currentPage]); - - return { - // Return last page if current page doesn't exist - data: articlePages[currentPage] || articlePages[articlePages.length - 1], - fetching, - onPageChange: setCurrentPage, - currentPage, - }; -} diff --git a/src/lib/ingestion.ts b/src/lib/ingestion.ts deleted file mode 100644 index 150c67b976..0000000000 --- a/src/lib/ingestion.ts +++ /dev/null @@ -1,242 +0,0 @@ -// Types for article creation -export type CreateArticleRequest = { - title: string; - siteId: string; - metadataFields: { - slug: string; - [key: string]: any; - }; - tags: string[]; - contentType: string; -}; - -export type CreateArticleResponse = { - id: string; -}; - -// Types for markdown ingestion -export type IngestMarkdownRequest = { - content: string; - publishLevel: "prod" | "realtime"; - contentType: "html" | "markdown"; - docName: string; - docRevisionDate: number; -}; - -export type IngestMarkdownResponse = { - success: boolean; - message?: string; -}; - -/** - * Creates an article using the Pantheon Content Cloud API - * @param articleData - The article data to create - * @returns Promise - The response containing the created article ID - */ -export const createArticle = async ( - articleData: CreateArticleRequest, - bearerToken: string = process.env.PCC_MANAGEMENT_TOKEN || "" -): Promise => { - const url = "https://addonapi-gfttxsojwq-uc.a.run.app/articles/create"; - - console.log( - "Creating article", - articleData.title, - articleData.metadataFields?.slug, - articleData.metadataFields?.uri - ); - try { - const response = await fetch(url, { - method: "POST", - headers: { - Authorization: `Bearer ${bearerToken}`, - "Content-Type": "application/json", - }, - body: JSON.stringify(articleData), - }); - - if (!response.ok) { - console.error(await response.text()); - - throw new Error( - `HTTP error! status: ${response.status} ${JSON.stringify( - articleData.metadataFields - )}` - ); - } - - const data: CreateArticleResponse = await response.json(); - return data; - } catch (error) { - console.error("Error creating article:", error); - throw error; - } -}; - -/** - * Ingests markdown content using the Pantheon Content Cloud API - * @param articleId - The ID of the article to ingest content into - * @param ingestData - The markdown content and metadata to ingest - * @returns Promise - The response from the ingestion API - */ -export const ingestMarkdown = async ( - articleId: string, - ingestData: IngestMarkdownRequest, - token: string = process.env.PCC_MANAGEMENT_TOKEN || "" -): Promise => { - const url = `https://addonapi-gfttxsojwq-uc.a.run.app/articles/${articleId}/ingest`; - - try { - const response = await fetch(url, { - method: "POST", - headers: { - Authorization: `Bearer ${token}`, - "Content-Type": "application/json", - }, - body: JSON.stringify(ingestData), - }); - - if (!response.ok) { - console.error("Error ingesting markdown:", await response.text()); - throw new Error( - `HTTP failed to ingest markdown: ${response.status} ${response.statusText}` - ); - } - - const data: IngestMarkdownResponse = await response.json(); - return data; - } catch (error) { - console.error("Error ingesting markdown:", error); - throw error; - } -}; - -/** - * Disconnects an article from the content structure - * @param articleId - The ID of the article to disconnect - * @param bearerToken - The bearer token for the API - * @returns Promise - The response from the disconnect API - */ -export async function disconnectArticle( - articleId: string, - bearerToken: string = process.env.PCC_MANAGEMENT_TOKEN || "" -): Promise { - const baseUrl = "https://addonapi-gfttxsojwq-uc.a.run.app"; - - try { - const response = await fetch( - `${baseUrl}/articles/${articleId}/disconnect`, - { - method: "POST", - headers: { - Authorization: `Bearer ${bearerToken}`, - "Content-Type": "application/json", - }, - } - ); - - if (!response.ok) { - console.log(await response.text()); - throw new Error(`HTTP error! status: ${response.status}`); - } - - console.log(`Successfully disconnected article: ${articleId}`); - } catch (error) { - console.error(`Error disconnecting article ${articleId}:`, error); - throw error; - } -} - -export type ContentStructureItem = { - id: string; - hidden?: boolean; - isHidden?: boolean; - children: ContentStructureItem[]; -} & ( - | { - type: "article"; - name: string; - published: boolean; - slug: string; - } - | { - type: "category"; - name: string; - } -); - -export interface PantheonSite { - contentStructure: { - active: ContentStructureItem[]; - uncategorized: ContentStructureItem[]; - }; -} - -/** - * Updates the content structure for a site - * @param siteId - The ID of the site to update - * @param contentStructure - The content structure to update - * @param bearerToken - The bearer token for the API - * @returns Promise - The response from the update API - */ -export async function updateContentStructure( - siteId: string, - contentStructure: PantheonSite, - bearerToken: string = process.env.PCC_MANAGEMENT_TOKEN || "" -) { - const url = `https://addonapi-gfttxsojwq-uc.a.run.app/sites/${siteId}/contentStructure`; - - try { - const response = await fetch(url, { - method: "PATCH", - headers: { - Authorization: `Bearer ${bearerToken}`, - "Content-Type": "application/json", - }, - body: JSON.stringify(contentStructure), - }); - - if (!response.ok) { - console.error("Error updating content structure:", await response.text()); - throw new Error(`HTTP error! status: ${response.status}`); - } - - console.log(`Successfully updated content structure for site: ${siteId}`); - - return response.text(); - } catch (error) { - console.error("Error updating content structure:", error); - throw error; - } -} - -export async function updateMetadata( - articleId: string, - metadata: any, - bearerToken: string = process.env.PCC_MANAGEMENT_TOKEN || "" -) { - const url = `https://addonapi-gfttxsojwq-uc.a.run.app/articles/${articleId}`; - - try { - const response = await fetch(url, { - method: "PATCH", - headers: { - Authorization: `Bearer ${bearerToken}`, - "Content-Type": "application/json", - }, - body: JSON.stringify(metadata), - }); - - if (!response.ok) { - console.error("Error updating metadata:", await response.text()); - throw new Error(`HTTP error! status: ${response.status}`); - } - - console.log(`Successfully updated metadata for article: ${articleId}`); - - return response.text(); - } catch (error) { - console.error("Error updating metadata:", error); - throw error; - } -} diff --git a/src/lib/page-utils.ts b/src/lib/page-utils.ts index 7e02fed419..cd6f576925 100644 --- a/src/lib/page-utils.ts +++ b/src/lib/page-utils.ts @@ -143,21 +143,6 @@ export type PageData = PageDataWithoutComponent & { Component: React.ReactNode; }; -/* This helper function helps determine which template should be applied to a piece of content */ -export const calculateTemplate = ( - node: ProcessedFile, - defaultTemplate: "doc" | "terminuspage" | "certificationpage" | "video" -) => { - if ( - node.frontmatter && - node.frontmatter.layout && - node.frontmatter.layout !== null - ) { - return node.frontmatter.layout; - } - return defaultTemplate; -}; - export const normalizeSlug = (slug: string): string => { let normalizedSlug = slug; if (normalizedSlug.startsWith("/")) { @@ -622,154 +607,3 @@ export const getAllPages = async ( ...landingPages, ]; }; - -export const fetchArticleById = async (id: string) => { - const query = ` - query GetArticle($id: String, $contentType: ContentType, $publishingLevel: PublishingLevel) { - article(id: $id, contentType: $contentType, publishingLevel: $publishingLevel) { - id - title - content - slug - tags - siteId - metadata - publishedDate - publishingLevel - contentType - updatedAt - previewActiveUntil - } - } - `; - - const variables = { - id: id, - contentType: "TEXT_MARKDOWN", - publishingLevel: "PRODUCTION", - }; - - try { - const response = await fetch( - `${process.env.PCC_HOST || "https://gql.prod.pcc.pantheon.io"}/sites/${process.env.PCC_SITE_ID}/query`, - { - method: "POST", - headers: { - "Content-Type": "application/json", - "PCC-TOKEN": process.env.PCC_TOKEN || "", - }, - body: JSON.stringify({ - query, - variables, - }), - } - ); - - if (!response.ok) { - const error = await response.text(); - throw new Error(`HTTP error! status: ${response.status} ${error} ${id}`); - } - - const data = await response.json(); - return data.data.article; - } catch (error) { - console.error("Fetch error:", error); - throw error; - } -}; - -// Using fetch with the same GraphQL query -export const fetchArticleBySlug = async ( - slug: string, - siteId: string = process.env.PCC_SITE_ID || "", - token: string = process.env.PCC_TOKEN || "", - options: { withContent: boolean; withMetadata: boolean } = { - withContent: true, - withMetadata: true, - }, - tries: number = 2 -) => { - console.debug("fetching article by slug", slug); - - const query = ` - query GetArticle($slug: String, $contentType: ContentType, $publishingLevel: PublishingLevel) { - article(slug: $slug, contentType: $contentType, publishingLevel: $publishingLevel) { - id - title - ${options.withContent === true ? "content" : ""} - slug - tags - siteId - ${options.withMetadata === true ? "metadata" : ""} - publishedDate - publishingLevel - contentType - updatedAt - previewActiveUntil - } - } - `; - - const variables = { - slug: slug, - contentType: "TEXT_MARKDOWN", - publishingLevel: "PRODUCTION", - }; - - while (tries > 0) { - tries -= 1; - try { - const response = await fetch( - `${process.env.PCC_HOST || "https://gql.prod.pcc.pantheon.io"}/sites/${siteId}/query`, - { - method: "POST", - headers: { - "Content-Type": "application/json", - "PCC-TOKEN": token, - }, - body: JSON.stringify({ - query, - variables, - }), - } - ); - - if (!response.ok) { - if (response.status === 404) { - return null; - } - - const error = await response.text(); - throw new Error( - `HTTP error! status: ${response.status} ${error} ${slug}` - ); - } - - const data = await response.json(); - return data.data.article; - } catch (error) { - console.error("Fetch error:", error, { tries }); - if (tries === 0) { - throw error; - } - } - } -}; - -export const singleSlugForFetch = (slug: string) => { - if (slug.startsWith("_")) { - slug = slug.slice(1); - } - - return slug - .replaceAll("/", "-") - .replaceAll("_", "-") - .replaceAll(".", "-") - .replaceAll(" ", "-") - .replaceAll("-&-", "-") - .replaceAll(",-", "-") - .replaceAll("!", "") - .replaceAll("(", "") - .replaceAll(")", "") - .toLowerCase(); -}; diff --git a/src/lib/resolve-component.tsx b/src/lib/resolve-component.tsx index a3c49ec160..6751fe2587 100644 --- a/src/lib/resolve-component.tsx +++ b/src/lib/resolve-component.tsx @@ -1,96 +1,26 @@ -import { PageDataWithoutComponent, calculateTemplate } from "./page-utils"; - -export const serveLocal = (search?: { local?: "true" | "false" }) => { - let useLocal = false; - if (process.env.SERVE_LOCAL === "false") { - return false; - } - - if (process.env.SERVE_LOCAL === "true") { - return true; - } - - if (process.env.NODE_ENV === "development") { - useLocal = true; - if (search?.local === "false") { - useLocal = false; - } - } - - return useLocal; -}; - -export const serveLocalAsync = async ( - searchParams?: Promise<{ - local?: "true" | "false"; - }> -) => { - const search = await searchParams; - - // @todo, don't hard code this to true - // https://github.com/pantheon-systems/documentation-in-nextjs/issues/84 - return true; - // return serveLocal(search); -}; +import { PageDataWithoutComponent } from "./page-utils"; export const resolveComponent = async ( pageData: PageDataWithoutComponent & { relativeFilePath?: string } ): Promise<{ Component: React.ReactNode; template: string }> => { switch (pageData.type) { case "doc": { - const template = calculateTemplate(pageData.data.doc, "doc"); - - if (template === "doc") { - const Doc = await import(`@/templates/doc`); - return { - Component: , - template: "doc", - }; - } else if (template === "terminuspage") { - const Terminus = await import(`@/templates/terminus`); - return { - Component: , - template: "terminuspage", - }; - } else if (template === "certificationpage") { - const Certification = await import(`@/templates/certification`); - return { - Component: ( - - ), - template: "certification", - }; - } else if (template === "video") { - const Video = await import(`@/templates/guide`); - return { - Component: ( - - ), - template: "video", - }; - } else { - const Doc = await import(`@/templates/doc`); - return { - Component: , - template: "doc", - }; - } + const Doc = await import(`@/templates/doc`); + return { + Component: , + template: "doc", + }; } case "guide": { - const Guide = await import(`@/templates/guide`); + const Doc = await import(`@/templates/doc`); return { Component: ( - ), template: "guide", diff --git a/src/lib/utils.ts b/src/lib/utils.ts index b4dfcf451c..74ddcabd5f 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -1,9 +1,4 @@ -import { - Article, - ArticleWithoutContent, -} from "@pantheon-systems/pcc-react-sdk"; import { clsx, type ClassValue } from "clsx"; -import { Metadata } from "next"; import { twMerge } from "tailwind-merge"; export function cn(...inputs: ClassValue[]) { @@ -19,70 +14,6 @@ export function formatDate(input: string | number): string { }); } -export function getSeoMetadata( - article: ArticleWithoutContent | null -): Metadata { - if (article == null) { - return { - openGraph: { - type: "website", - }, - }; - } - - const tags: string[] = - article.tags && article.tags.length > 0 ? article.tags : []; - const imageProperties = [ - article.metadata?.image, - article.metadata?.["image"], - // Extend as needed - ] - .filter((url): url is string => typeof url === "string") - .map((url) => ({ url })); - const description = article.metadata?.description - ? String(article.metadata?.description) - : "Article hosted using Pantheon Content Cloud"; - - const authors: Metadata["authors"] = []; - - // Collecting data from metadata fields - Object.entries(article.metadata || {}).forEach(([k, v]) => { - const key = k.toLowerCase().trim(); - - switch (key) { - case "author": { - if (typeof v === "string") { - authors.push({ name: v }); - } - break; - } - case "complex-author": { - if (typeof v === "string") { - const authorName = undefined; - - if (authorName) { - authors.push({ name: v }); - } - } - break; - } - } - }); - - return { - title: article.title, - description, - keywords: tags, - authors, - openGraph: { - type: "website", - title: article.title || undefined, - images: imageProperties, - description, - }, - }; -} - export const isExternalLink = (url: string) => { // Empty URLs if (!url) { diff --git a/src/server/processor/json.tsx b/src/server/processor/json.tsx index ff5912f357..3bdc2ed08e 100644 --- a/src/server/processor/json.tsx +++ b/src/server/processor/json.tsx @@ -1,5 +1,5 @@ import fs from "fs"; -import path, { join } from "path"; +import path from "path"; import { BaseFields, BaseInternal, @@ -19,8 +19,6 @@ import { safeProcessFile, getFileInfo, } from "./helper"; -import { serveLocal, serveLocalAsync } from "@/lib/resolve-component"; -import { fetchArticleBySlug, singleSlugForFetch } from "@/lib/page-utils"; export type JsonFileContent = Record; @@ -75,47 +73,6 @@ export const processDirectoryForJson = async ( fileName: string | null, baseDirectory = path.resolve(process.cwd(), "src") ): Promise => { - const useLocal = serveLocal(); - - if (useLocal === false && fileName) { - fileName = fileName.split(".")[0]; - - const article = await fetchArticleBySlug( - singleSlugForFetch(`${fileName}-json-file`), - undefined, - undefined, - undefined, - 1 - ); - - if (article) { - const content = JSON.parse(article.content); - const parsedContent = JSON.parse(content.content).content; - - const relativePath = article.metadata.relativePath; - - return [ - { - id: generateId(join(process.cwd(), relativePath)), - fileAbsolutePath: join(process.cwd(), relativePath), - relativePath: relativePath, - fileName: article.fileName, - content: parsedContent, - fields: generateBaseFields( - join(process.cwd(), relativePath), - article.fileName, - parsedContent - ), - internal: { - type: "Json", - content: parsedContent, - contentDigest: generateContentDigest(content.content), - }, - }, - ]; - } - } - const options = { extensions: [".json"], filter: (filePath: string) => { diff --git a/src/source/content/cache.md b/src/source/content/cache.md index 3a0b73f668..bdf4ce7c01 100644 --- a/src/source/content/cache.md +++ b/src/source/content/cache.md @@ -4,9 +4,7 @@ description: Understand frontend and backend caching on our platform. contributors: [dwayne] permalink: docs/cache tags: [cache] -layout: video searchboost: 50 -type: video contenttype: [doc] innav: [true] categories: [cache] diff --git a/src/source/content/certification/about.md b/src/source/content/certification/about.md index f79249e3d0..2398aeb280 100644 --- a/src/source/content/certification/about.md +++ b/src/source/content/certification/about.md @@ -1,9 +1,6 @@ --- title: "Benefits of Becoming WebOps Certified" subtitle: "Learn about the Pantheon WebOps Certification program" -showtoc: true -contributors: [] -layout: certificationpage permalink: docs/certification/about --- diff --git a/src/source/content/certification/exam.md b/src/source/content/certification/exam.md index 9181270e34..b5639e7a9a 100644 --- a/src/source/content/certification/exam.md +++ b/src/source/content/certification/exam.md @@ -1,9 +1,6 @@ --- title: "WebOps Certification: Exam Overview" subtitle: "Pantheon WebOps Certification Exam Overview" -contributors: [] -showtoc: true -layout: certificationpage permalink: docs/certification/exam --- ## Exam Instructions diff --git a/src/source/content/certification/study-guide-cms/00-intro.md b/src/source/content/certification/study-guide-cms/00-intro.md index 437ca3b87a..47792cbbf1 100644 --- a/src/source/content/certification/study-guide-cms/00-intro.md +++ b/src/source/content/certification/study-guide-cms/00-intro.md @@ -2,19 +2,8 @@ title: WebOps Certification subtitle: Study Guide Introduction description: Learn about the three failure modes of website operations. -certificationpage: true -type: certificationpage -layout: certificationpage -showtoc: true -tags: [] permalink: docs/certification/study-guide -contenttype: [guide] -innav: [false] -categories: [] cms: [drupal, wordpress] -audience: [] -product: [] -integration: [--] nexturl: /certification/study-guide/webops --- diff --git a/src/source/content/certification/study-guide-cms/01-webops.md b/src/source/content/certification/study-guide-cms/01-webops.md index 186a20f423..9caf7ad08b 100644 --- a/src/source/content/certification/study-guide-cms/01-webops.md +++ b/src/source/content/certification/study-guide-cms/01-webops.md @@ -2,19 +2,8 @@ title: WebOps Certification subtitle: "Chapter 1: WebOps" description: Learn about the principles and benefits of WebOps. -certificationpage: true -showtoc: true -type: certificationpage -layout: certificationpage -tags: [] permalink: docs/certification/study-guide/webops -contenttype: [guide] -innav: [false] -categories: [] cms: [drupal, wordpress] -audience: [] -product: [] -integration: [--] previousurl: /certification/study-guide nexturl: /certification/study-guide/platform --- diff --git a/src/source/content/certification/study-guide-cms/02-platform.md b/src/source/content/certification/study-guide-cms/02-platform.md index 4fefe124a0..2bbfce97dc 100644 --- a/src/source/content/certification/study-guide-cms/02-platform.md +++ b/src/source/content/certification/study-guide-cms/02-platform.md @@ -2,19 +2,8 @@ title: WebOps Certification subtitle: "Chapter 2: Pantheon Platform" description: Understand the layers of Pantheon's platform and how it can be used to solve problems using WebOps best practicies. -certificationpage: true -showtoc: true -type: certificationpage -layout: certificationpage -tags: [] permalink: docs/certification/study-guide/platform -contenttype: [guide] -innav: [false] -categories: [] cms: [drupal, wordpress] -audience: [] -product: [] -integration: [--] previousurl: /certification/study-guide/webops nexturl: /certification/study-guide/create --- diff --git a/src/source/content/certification/study-guide-cms/03-create.md b/src/source/content/certification/study-guide-cms/03-create.md index 882a5fe414..be311c875e 100644 --- a/src/source/content/certification/study-guide-cms/03-create.md +++ b/src/source/content/certification/study-guide-cms/03-create.md @@ -2,19 +2,8 @@ title: WebOps Certification subtitle: "Chapter 3: Site Creation" description: Learn how to create a site on Pantheon. -certificationpage: true -showtoc: true -type: certificationpage -layout: certificationpage -tags: [] permalink: docs/certification/study-guide/create -contenttype: [guide] -innav: [false] -categories: [] cms: [drupal, wordpress] -audience: [] -product: [] -integration: [--] previousurl: /certification/study-guide/platform nexturl: /certification/study-guide/cdn --- diff --git a/src/source/content/certification/study-guide-cms/04-cdn.md b/src/source/content/certification/study-guide-cms/04-cdn.md index 0659fb2083..978c534b78 100644 --- a/src/source/content/certification/study-guide-cms/04-cdn.md +++ b/src/source/content/certification/study-guide-cms/04-cdn.md @@ -2,19 +2,8 @@ title: WebOps Certification subtitle: "Chapter 4: Content Delivery Network" description: Pantheon's edge layer increases the speed and scalability of all sites on the platform. The Advanced Global CDN can be customized for tailored usage. -certificationpage: true -type: certificationpage -layout: certificationpage -showtoc: true -tags: [] permalink: docs/certification/study-guide/cdn -contenttype: [guide] -innav: [false] -categories: [] cms: [drupal, wordpress] -audience: [] -product: [] -integration: [--] previousurl: /certification/study-guide/create nexturl: /certification/study-guide/cms --- diff --git a/src/source/content/certification/study-guide-cms/05-cms.md b/src/source/content/certification/study-guide-cms/05-cms.md index af2cee8cde..71256688b9 100644 --- a/src/source/content/certification/study-guide-cms/05-cms.md +++ b/src/source/content/certification/study-guide-cms/05-cms.md @@ -2,19 +2,8 @@ title: WebOps Certification subtitle: "Chapter 5: CMS Infrastructure" description: Pantheon's containerized infrastructure makes CMS applications faster, more scalable, and more secure. -certificationpage: true -type: certificationpage -layout: certificationpage -showtoc: true -tags: [] permalink: docs/certification/study-guide/cms -contenttype: [guide] -innav: [false] -categories: [] cms: [drupal, wordpress] -audience: [] -product: [] -integration: [--] previousurl: /certification/study-guide/cdn nexturl: /certification/study-guide/deploy --- diff --git a/src/source/content/certification/study-guide-cms/06-deploy.md b/src/source/content/certification/study-guide-cms/06-deploy.md index ecf2268a48..55b84533a9 100644 --- a/src/source/content/certification/study-guide-cms/06-deploy.md +++ b/src/source/content/certification/study-guide-cms/06-deploy.md @@ -2,19 +2,8 @@ title: WebOps Certification subtitle: "Chapter 6: The Deployment Pipeline" description: Learn about the deployment pipeline for CMS Sites on Pantheon as it relates to code, files, and databases. -certificationpage: true -type: certificationpage -layout: certificationpage -showtoc: true -tags: [] permalink: docs/certification/study-guide/deploy -contenttype: [guide] -innav: [false] -categories: [] cms: [drupal, wordpress] -audience: [] -product: [] -integration: [--] previousurl: /certification/study-guide/cms nexturl: /certification/study-guide/people --- diff --git a/src/source/content/certification/study-guide-cms/07-people.md b/src/source/content/certification/study-guide-cms/07-people.md index 900f8fcd3b..08474300c4 100644 --- a/src/source/content/certification/study-guide-cms/07-people.md +++ b/src/source/content/certification/study-guide-cms/07-people.md @@ -2,19 +2,8 @@ title: WebOps Certification subtitle: "Chapter 7: Connecting People" description: Learn how to manage teams, workspaces and permissions before connecting DNS. -certificationpage: true -type: certificationpage -layout: certificationpage -showtoc: true -tags: [] permalink: docs/certification/study-guide/people -contenttype: [guide] -innav: [false] -categories: [] cms: [drupal, wordpress] -audience: [] -product: [] -integration: [--] previousurl: /certification/study-guide/deploy nexturl: /certification/study-guide/extend --- diff --git a/src/source/content/certification/study-guide-cms/08-extend.md b/src/source/content/certification/study-guide-cms/08-extend.md index b62a124b48..ecffee8436 100644 --- a/src/source/content/certification/study-guide-cms/08-extend.md +++ b/src/source/content/certification/study-guide-cms/08-extend.md @@ -2,19 +2,8 @@ title: WebOps Certification subtitle: "Chapter 8: Extend with CLI and Hooks" description: "Terminus and Quicksilver can work together to help facilitate complex WebOps workflows" -certificationpage: true -type: certificationpage -layout: certificationpage -showtoc: true -tags: [] permalink: docs/certification/study-guide/extend -contenttype: [guide] -innav: [false] -categories: [] cms: [drupal, wordpress] -audience: [] -product: [] -integration: [--] previousurl: /certification/study-guide/people nexturl: /certification/study-guide/automate --- diff --git a/src/source/content/certification/study-guide-cms/09-automate.md b/src/source/content/certification/study-guide-cms/09-automate.md index 7e7dc30773..1052c8bc90 100644 --- a/src/source/content/certification/study-guide-cms/09-automate.md +++ b/src/source/content/certification/study-guide-cms/09-automate.md @@ -2,19 +2,8 @@ title: WebOps Certification subtitle: "Chapter 9: Additional Automation" description: "Learn how to leverage Integrated Composer and Autopilot" -certificationpage: true -type: certificationpage -layout: certificationpage -showtoc: true -tags: [] permalink: docs/certification/study-guide/automate -contenttype: [guide] -innav: [false] -categories: [] cms: [drupal, wordpress] -audience: [] -product: [] -integration: [--] previousurl: /certification/study-guide/extend nexturl: /certification/study-guide/custom-upstreams --- diff --git a/src/source/content/certification/study-guide-cms/10-custom-upstreams.md b/src/source/content/certification/study-guide-cms/10-custom-upstreams.md index a9591517f8..acaeadba66 100644 --- a/src/source/content/certification/study-guide-cms/10-custom-upstreams.md +++ b/src/source/content/certification/study-guide-cms/10-custom-upstreams.md @@ -1,20 +1,9 @@ --- title: WebOps Certification subtitle: "Chapter 10: Custom Upstreams" -description: "Understand the relationship between Pantheon’s Core Upstreams, Custom Upstreams, and individual site repositories." -certificationpage: true -type: certificationpage -layout: certificationpage -showtoc: true -tags: [] +description: "Understand the relationship between Pantheon's Core Upstreams, Custom Upstreams, and individual site repositories." permalink: docs/certification/study-guide/custom-upstreams -contenttype: [guide] -innav: [false] -categories: [] cms: [drupal, wordpress] -audience: [] -product: [] -integration: [--] previousurl: /certification/study-guide/automate --- diff --git a/src/source/content/guides/launch/02-create-site-launch.md b/src/source/content/guides/launch/02-create-site-launch.md index 8be48f69e6..75434bfe42 100644 --- a/src/source/content/guides/launch/02-create-site-launch.md +++ b/src/source/content/guides/launch/02-create-site-launch.md @@ -4,7 +4,6 @@ subtitle: Create Your Site on Pantheon description: Learn how to create your site on Pantheon. tags: [cms,] contributors: [whitneymeredith] -showtoc: true permalink: docs/guides/launch/create-site-launch contenttype: [guide] innav: [false] @@ -16,7 +15,7 @@ integration: [--] image: launchGuide-twitterLarge.png --- -This section provides information on how to create your Live environment. +This section provides information on how to create your Live environment. 1. [Create a New Site](/guides/getstarted/addsite/). diff --git a/src/source/content/terminus/01-introduction.md b/src/source/content/terminus/01-introduction.md index 6f33a4773a..b2d5578016 100644 --- a/src/source/content/terminus/01-introduction.md +++ b/src/source/content/terminus/01-introduction.md @@ -2,20 +2,15 @@ title: Terminus Guide subtitle: Introduction description: Learn about Terminus, the command line interface for advanced interaction with the Pantheon platform. -terminuspage: true -type: terminuspage -layout: terminuspage contributors: [whitneymeredith] -contenttype: [guide] -innav: [true] categories: [cli] cms: [drupal, wordpress] audience: [development] product: [terminus] -integration: [--] tags: [reference, cli, local, terminus, workflow] permalink: docs/terminus reviewed: "2020-02-05" +showtoc: false --- Terminus is a command line interface that provides advanced interaction with Pantheon. Terminus enables you to do almost everything in a terminal that you can do in the Dashboard, as well as scripting and much more. diff --git a/src/source/content/terminus/02-install.md b/src/source/content/terminus/02-install.md index 8a6397e416..ea411e37ce 100644 --- a/src/source/content/terminus/02-install.md +++ b/src/source/content/terminus/02-install.md @@ -2,19 +2,13 @@ title: Terminus Guide subtitle: Install and Update Terminus description: Learn how to install and update Terminus to your local computer. -terminuspage: true -type: terminuspage -layout: terminuspage contributors: [whitneymeredith,jazzsequence] tags: [reference, cli, local, terminus, workflow] permalink: docs/terminus/install -contenttype: [guide] -innav: [false] categories: [cli] cms: [drupal, wordpress] audience: [development] product: [terminus] -integration: [--] showtoc: true reviewed: "2025-07-22" --- diff --git a/src/source/content/terminus/03-examples.md b/src/source/content/terminus/03-examples.md index 935a179d42..5e25894789 100644 --- a/src/source/content/terminus/03-examples.md +++ b/src/source/content/terminus/03-examples.md @@ -2,19 +2,14 @@ title: Terminus Guide subtitle: Get Started description: Learn how to apply updates, deploy code, switch upstreams, and install Drush and WP-CLI with Terminus. -terminuspage: true -type: terminuspage -layout: terminuspage tags: [reference, cli, local, terminus, workflow] permalink: docs/terminus/examples -contenttype: [guide] -innav: [false] categories: [cli] cms: [drupal, wordpress] audience: [development] product: [terminus] -integration: [--] reviewed: "2025-01-23" +showtoc: false --- This section provides information on how to apply updates, deploy code, switch upstreams, and install Drush and WP-CLI with Terminus, as well as information on command structure and automatic site and environment detection. diff --git a/src/source/content/terminus/04-commands.md b/src/source/content/terminus/04-commands.md index ca751d68f3..dad5cfe41c 100644 --- a/src/source/content/terminus/04-commands.md +++ b/src/source/content/terminus/04-commands.md @@ -2,18 +2,13 @@ title: Terminus Guide subtitle: Command Directory description: Review a complete list of Terminus commands. -terminuspage: true -type: terminuspage -layout: terminuspage tags: [reference, cli, local, terminus, workflow] permalink: docs/terminus/commands -contenttype: [guide] -innav: [false] categories: [cli] cms: [drupal, wordpress] audience: [development] product: [terminus] -integration: [--] +showtoc: false --- This section provides a comprehensive list of Terminus commands. diff --git a/src/source/content/terminus/05-scripting.md b/src/source/content/terminus/05-scripting.md index b319df9470..22cb2f6aa7 100644 --- a/src/source/content/terminus/05-scripting.md +++ b/src/source/content/terminus/05-scripting.md @@ -2,18 +2,13 @@ title: Terminus Guide subtitle: Scripting with Terminus description: Automate your workflow with scripting via Terminus. -terminuspage: true -type: terminuspage -layout: terminuspage tags: [reference, cli, local, terminus, workflow] permalink: docs/terminus/scripting -contenttype: [guide] -innav: [false] categories: [cli] cms: [drupal, wordpress] audience: [development] product: [terminus] -integration: [--] +showtoc: false --- This section provides information on how to automate your workflow with Terminus scripting. diff --git a/src/source/content/terminus/06-plugins.md b/src/source/content/terminus/06-plugins.md index b219337936..82671c1506 100644 --- a/src/source/content/terminus/06-plugins.md +++ b/src/source/content/terminus/06-plugins.md @@ -2,18 +2,13 @@ title: Terminus Guide subtitle: Install Plugins description: Learn how to install plugins with Terminus. -terminuspage: true -type: terminuspage -layout: terminuspage -contenttype: [guide] -innav: [false] categories: [cli] cms: [drupal, wordpress] audience: [development] product: [terminus] -integration: [--] tags: [reference, cli, local, terminus, workflow] permalink: docs/terminus/plugins +showtoc: false --- This section provides information on how to install plugins with Terminus, and how to add new commands through third-party plugins. diff --git a/src/source/content/terminus/07-create.md b/src/source/content/terminus/07-create.md index 410f75bc9d..8612c809f6 100644 --- a/src/source/content/terminus/07-create.md +++ b/src/source/content/terminus/07-create.md @@ -2,18 +2,13 @@ title: Terminus Guide subtitle: Create Terminus Plugins description: Learn how to create your own Terminus plugins. -terminuspage: true -type: terminuspage -layout: terminuspage tags: [reference, cli, local, terminus, workflow] permalink: docs/terminus/create -contenttype: [guide] -innav: [false] categories: [cli] cms: [drupal, wordpress] audience: [development] product: [terminus] -integration: [--] +showtoc: false --- This section provides information on how to create Terminus plugins. diff --git a/src/source/content/terminus/08-directory.md b/src/source/content/terminus/08-directory.md index 1fc26c3a1c..0b97e9fd91 100644 --- a/src/source/content/terminus/08-directory.md +++ b/src/source/content/terminus/08-directory.md @@ -2,18 +2,13 @@ title: Terminus Guide subtitle: Plugin Directory description: A non-exclusive directory of plugins to extend Terminus features. -terminuspage: true -type: terminuspage -layout: terminuspage tags: [reference, cli, local, terminus, workflow] permalink: docs/terminus/directory -contenttype: [guide] -innav: [false] categories: [cli] cms: [drupal, wordpress] audience: [development] product: [terminus] -integration: [--] +showtoc: false --- You can extend Terminus functionality and add commands by installing [third-party plugins](https://github.com/terminus-plugin-project) or by [creating your own plugins](/terminus/create). diff --git a/src/source/content/terminus/09-configuration.md b/src/source/content/terminus/09-configuration.md index f44bc1ac9f..89f27263e5 100644 --- a/src/source/content/terminus/09-configuration.md +++ b/src/source/content/terminus/09-configuration.md @@ -2,18 +2,13 @@ title: Terminus Guide subtitle: Terminus Configuration File description: Learn how to configure your local Terminus configuration file. -terminuspage: true -type: terminuspage -layout: terminuspage tags: [reference, cli, local, terminus, workflow] permalink: docs/terminus/configuration -contenttype: [guide] -innav: [false] categories: [cli] cms: [drupal, wordpress] audience: [development] product: [terminus] -integration: [--] +showtoc: false --- This section provides information on how to configure your local Terminus configuration file. diff --git a/src/source/content/terminus/10-supported-terminus.md b/src/source/content/terminus/10-supported-terminus.md index 87da7efe3e..81d00a991b 100644 --- a/src/source/content/terminus/10-supported-terminus.md +++ b/src/source/content/terminus/10-supported-terminus.md @@ -2,19 +2,14 @@ title: Terminus Guide subtitle: Supported Terminus and PHP Versions description: Learn which versions of Terminus and PHP are currently supported. -terminuspage: true -type: terminuspage -layout: terminuspage contributors: [wordsmither] tags: [reference, cli, local, terminus, workflow] permalink: docs/terminus/supported-terminus -contenttype: [guide] -innav: [false] categories: [git] cms: [drupal, wordpress] audience: [development] product: [terminus] -integration: [--] +showtoc: false --- Each major and minor version of Terminus is fully supported for one year from the release of the subsequent version. During the supported period, serious bugs and security issues that have been reported are fixed in patch releases. Refer to the documentation on [Semantic Versioning](https://semver.org/) for more information on versioning. diff --git a/src/source/content/terminus/11-updates.md b/src/source/content/terminus/11-updates.md index 52f74a1607..2139e771f3 100644 --- a/src/source/content/terminus/11-updates.md +++ b/src/source/content/terminus/11-updates.md @@ -2,18 +2,13 @@ title: Terminus Guide subtitle: Terminus Changelog description: Stay up to date on the latest Terminus version. -terminuspage: true -type: terminuspage -layout: terminuspage tags: [reference, cli, local, terminus, workflow] permalink: docs/terminus/updates -contenttype: [guide] -innav: [false] categories: [cli] cms: [drupal, wordpress] audience: [development] product: [terminus] -integration: [--] +showtoc: false --- ## Changelog diff --git a/src/source/content/terminus/12-terminus-3-0.md b/src/source/content/terminus/12-terminus-3-0.md index ac039bb701..88a35ece52 100644 --- a/src/source/content/terminus/12-terminus-3-0.md +++ b/src/source/content/terminus/12-terminus-3-0.md @@ -2,19 +2,14 @@ title: Terminus Guide subtitle: Terminus 3 description: Learn what's new with the latest Terminus major version upgrade. -terminuspage: true -type: terminuspage -layout: terminuspage contributors: [greg-1-anderson] tags: [reference, cli, local, terminus, workflow] permalink: docs/terminus/terminus-3-0 -contenttype: [guide] -innav: [false] categories: [cli] cms: [drupal, wordpress] audience: [development] product: [terminus] -integration: [--] +showtoc: false --- This section provides information about Terminus 3.0. Terminus 3.0 is the most recent major version of Terminus and is recommended in place of Terminus 2.0. diff --git a/src/source/content/terminus/13-terminus-4-0.md b/src/source/content/terminus/13-terminus-4-0.md index 94b6a034a8..5412508d17 100644 --- a/src/source/content/terminus/13-terminus-4-0.md +++ b/src/source/content/terminus/13-terminus-4-0.md @@ -2,19 +2,14 @@ title: Terminus Guide subtitle: Terminus 4 description: Learn what's new with the latest Terminus major version upgrade. -terminuspage: true -type: terminuspage -layout: terminuspage contributors: [kporras07] tags: [reference, cli, local, terminus, workflow] permalink: docs/terminus/terminus-4-0 -contenttype: [guide] -innav: [false] categories: [cli] cms: [drupal, wordpress] audience: [development] product: [terminus] -integration: [--] +showtoc: false --- This section provides information about Terminus 4.0. Terminus 4.0 is the most recent major version of Terminus and is recommended in place of Terminus 3.x. diff --git a/src/source/content/terminus/ci/bitbucket.md b/src/source/content/terminus/ci/bitbucket.md index ea087b8690..95f3f448d4 100644 --- a/src/source/content/terminus/ci/bitbucket.md +++ b/src/source/content/terminus/ci/bitbucket.md @@ -4,18 +4,13 @@ subtitle: Authenticate Terminus in a Bitbucket CI Pipeline description: Learn how to authenticate Terminus in a Bitbucket CI pipeline without receiving errors. permalink: docs/terminus/ci/bitbucket contributors: [stovak] -terminuspage: true -type: terminuspage -layout: terminuspage tags: [reference, cli, local, terminus, workflow] -contenttype: [guide] -innav: [false] categories: [automate] cms: [drupal, wordpress] audience: [development] product: [terminus] -integration: [--] reviewed: "2023-06-08" +showtoc: false --- This section provides information on how to to authenticate Terminus in a Bitbucket CI pipeline without receiving errors and avoiding authentication rate limits. diff --git a/src/source/content/terminus/ci/circleci.md b/src/source/content/terminus/ci/circleci.md index 9e429d815b..cc8e110cda 100644 --- a/src/source/content/terminus/ci/circleci.md +++ b/src/source/content/terminus/ci/circleci.md @@ -3,19 +3,14 @@ title: Terminus Guide subtitle: Authenticate Terminus in a CircleCI Pipeline description: Learn how to authenticate Terminus in a CircleCI pipeline without errors. contributors: [stovak] -terminuspage: true -type: terminuspage -layout: terminuspage tags: [reference, cli, local, terminus, workflow] permalink: docs/terminus/ci/circleci -contenttype: [guide] -innav: [false] categories: [automate] cms: [drupal, wordpress] audience: [development] product: [terminus] -integration: [--] reviewed: "2023-06-08" +showtoc: false --- This section provides information on how to authenticate Terminus in a CircleCI pipeline without receiving errors and avoiding authentication rate limits. diff --git a/src/source/content/terminus/ci/github-actions.md b/src/source/content/terminus/ci/github-actions.md index 0420fac3ea..89378d524f 100644 --- a/src/source/content/terminus/ci/github-actions.md +++ b/src/source/content/terminus/ci/github-actions.md @@ -4,18 +4,13 @@ subtitle: Authenticate Terminus in a GitHub Actions Pipeline description: Learn how to authenticate Terminus in a GitHub Actions CI pipeline without receiving errors. permalink: docs/terminus/ci/github-actions contributors: [stovak] -terminuspage: true -type: terminuspage -layout: terminuspage tags: [reference, cli, local, terminus, workflow] -contenttype: [guide] -innav: [false] categories: [automate] cms: [drupal, wordpress] audience: [development] product: [terminus] -integration: [--] reviewed: "2025-12-10" +showtoc: false --- This section provides information on how to to authenticate Terminus in a GitHub Actions CI pipeline without receiving errors and avoiding authentication rate limits. diff --git a/src/source/content/terminus/ci/gitlab.md b/src/source/content/terminus/ci/gitlab.md index d1499798e9..84c0374340 100644 --- a/src/source/content/terminus/ci/gitlab.md +++ b/src/source/content/terminus/ci/gitlab.md @@ -4,18 +4,13 @@ subtitle: Authenticate Terminus in a GitLab Pipeline description: Learn how to authenticate Terminus in a GitLab CI pipeline without receiving errors. permalink: docs/terminus/ci/gitlab contributors: [stovak] -terminuspage: true -type: terminuspage -layout: terminuspage tags: [reference, cli, local, terminus, workflow] -contenttype: [guide] -innav: [false] categories: [automate] cms: [drupal, wordpress] audience: [development] product: [terminus] -integration: [--] reviewed: "2023-06-08" +showtoc: false --- This section provides information on how to to authenticate Terminus in a GitLab CI pipeline without receiving errors and avoiding authentication rate limits. diff --git a/src/templates/certification.tsx b/src/templates/certification.tsx deleted file mode 100644 index 4a95d799b8..0000000000 --- a/src/templates/certification.tsx +++ /dev/null @@ -1,125 +0,0 @@ -import Layout from "@/components/layout"; -import { OmniSidebarNav } from "@/components/omniSideBarNav"; -import { DocsSidebarLayout } from "@/components/pds-middleware/docs-sidebar-layout"; -import { ProcessedFile } from "@/server/processor/mdx"; -import SearchBar from "@/components/header/search-bar"; -import { MdxWrapper } from "@/components/ui/mdx-wrapper"; -import HeaderBody from "@/components/common/header-body"; -import NavButtons from "@/components/common/nav-buttons"; -import { TOC } from "@/components/common/toc"; - -const ContainerDiv = ({ children }: { children: React.ReactNode }) => ( -
{children}
-); - -const ContentLayoutType = ({ - children, - hasTOC, -}: { - children: React.ReactNode; - hasTOC: boolean; -}) => { - if (hasTOC) { - return ( - - {children} - - ); - } - - return {children}; -}; - -export const CertificationTemplate = ({ - certification, -}: { - certification: ProcessedFile; -}) => { - const items: any[] = []; // todo: add items @aniketbiprojit - - const hasTOC = certification.frontmatter.showtoc ?? false; - - let image = "/images/" + certification.frontmatter.image; - if (image === "/images/null") { - image = "/images/default-thumb-guides.png"; - } - - return ( - - -
- -
- -
- -
- -
-
-
-
- - - -
-
-
- {hasTOC && ( -
- -
- )} -
-
-
-
- ); -}; diff --git a/src/templates/doc.tsx b/src/templates/doc.tsx index c79fd0c31c..7858013144 100644 --- a/src/templates/doc.tsx +++ b/src/templates/doc.tsx @@ -5,20 +5,55 @@ import { ProcessedFile } from "@/server/processor/mdx"; import SearchBar from "@/components/header/search-bar"; import { MdxWrapper } from "@/components/ui/mdx-wrapper"; import HeaderBody from "@/components/common/header-body"; +import NavButtons from "@/components/common/nav-buttons"; import { TOC } from "@/components/common/toc"; const ContainerDiv = ({ children }: { children: React.ReactNode }) => (
{children}
); -export const DocTemplate = ({ doc }: { doc: ProcessedFile }) => { - const items: any[] = []; // todo: add items @aniketbiprojit - - let image = "/images/" + doc.frontmatter.image; - if (image === "/images/null") { - image = "/images/default-thumb-guides.png"; +const ContentLayoutType = ({ + children, + hasTOC, +}: { + children: React.ReactNode; + hasTOC: boolean; +}) => { + if (hasTOC) { + return ( + + {children} + + ); } + return {children}; +}; + +export const DocTemplate = ({ + doc, + prev, + next, + tocDefault = true, +}: { + doc: ProcessedFile; + prev?: { fields: { slug: string } } | null; + next?: { fields: { slug: string } } | null; + tocDefault?: boolean; +}) => { + // Use props if provided, otherwise fall back to frontmatter + const prevUrl = prev?.fields.slug ?? doc.frontmatter.previousurl ?? ""; + const nextUrl = next?.fields.slug ?? doc.frontmatter.nexturl ?? ""; + + // Use frontmatter if set, otherwise use the default for this content type + const hasTOC = doc.frontmatter.showtoc ?? tocDefault; + return ( { >
- +
@@ -64,27 +89,21 @@ export const DocTemplate = ({ doc }: { doc: ProcessedFile }) => { // isoDate={guide.frontmatter.reviewed} /> + {(prevUrl || nextUrl) && ( + + )}
-
- -
-
+ {hasTOC && ( +
+ +
+ )} +
diff --git a/src/templates/guide.tsx b/src/templates/guide.tsx deleted file mode 100644 index 9e0df04cbd..0000000000 --- a/src/templates/guide.tsx +++ /dev/null @@ -1,127 +0,0 @@ -import Layout from "@/components/layout"; -import { OmniSidebarNav } from "@/components/omniSideBarNav"; -import { DocsSidebarLayout } from "@/components/pds-middleware/docs-sidebar-layout"; -import { ProcessedFile } from "@/server/processor/mdx"; -import SearchBar from "@/components/header/search-bar"; -import { MdxWrapper } from "@/components/ui/mdx-wrapper"; -import HeaderBody from "@/components/common/header-body"; -import NavButtons from "@/components/common/nav-buttons"; -import { TOC } from "@/components/common/toc"; - -const ContainerDiv = ({ children }: { children: React.ReactNode }) => ( -
{children}
-); - -const ContentLayoutType = ({ - children, - hasTOC, -}: { - children: React.ReactNode; - hasTOC: boolean; -}) => { - if (hasTOC) { - return ( - - {children} - - ); - } - - return {children}; -}; - -export const GuideTemplate = ({ - guide, - prev, - next, -}: { - prev: null | { fields: { slug: string; guide_directory: string } }; - guide: ProcessedFile; - next: null | { fields: { slug: string; guide_directory: string } }; -}) => { - const items: any[] = []; // todo: add items @aniketbiprojit - - const hasTOC = guide.frontmatter.showtoc ?? false; - - let image = "/images/" + guide.frontmatter.image; - if (image === "/images/null") { - image = "/images/default-thumb-guides.png"; - } - - return ( - - -
- -
- -
- -
- -
-
-
-
- - - -
-
-
- {hasTOC && ( -
- -
- )} -
-
-
-
- ); -}; diff --git a/src/templates/landing.tsx b/src/templates/landing.tsx index 439083869d..94e03fcb92 100644 --- a/src/templates/landing.tsx +++ b/src/templates/landing.tsx @@ -90,11 +90,7 @@ export const LandingTemplate = ({ topic }: { topic: Landing }) => { >
diff --git a/src/templates/release-note-listing/index.tsx b/src/templates/release-note-listing/index.tsx index e20fc6ba41..6348732357 100644 --- a/src/templates/release-note-listing/index.tsx +++ b/src/templates/release-note-listing/index.tsx @@ -147,18 +147,7 @@ export const ReleaseNoteListingTemplate = async ({ /> */} (
{children}
@@ -37,75 +37,6 @@ const ContentLayoutType = ({ return {children}; }; -// @TODO relocate this list -// - To a YAML file and use GraphQL to pull data. -// - To a GraphQL query order by frontmatter weight/order/index field. -const items = [ - { - id: "docs-terminus", - link: "/terminus", - title: "Introduction", - }, - { - id: "docs-terminus-install", - link: "/terminus/install", - title: "Install Terminus", - }, - { - id: "docs-terminus-examples", - link: "/terminus/examples", - title: "Get Started", - }, - { - id: "docs-terminus-commands", - link: "/terminus/commands", - title: "Command Directory", - }, - { - id: "docs-terminus-scripting", - link: "/terminus/scripting", - title: "Scripting with Terminus", - }, - { - id: "docs-terminus-plugins", - link: "/terminus/plugins", - title: "Install Plugins", - }, - { - id: "docs-terminus-directory", - link: "/terminus/directory", - title: "Plugin Directory", - }, - { - id: "docs-terminus-create", - link: "/terminus/create", - title: "Create Terminus Plugins", - }, - { - id: "docs-terminus-configuration", - link: "/terminus/configuration", - title: "Terminus Configuration File", - }, - - { - id: "docs-supported-terminus", - link: "/terminus/supported-terminus", - title: "Supported Terminus and PHP Versions", - }, - - { - id: "docs-terminus-updates", - link: "/terminus/updates", - title: "Terminus Changelog", - }, - - { - id: "docs-terminus-terminus-4-0", - link: "/terminus/terminus-4-0", - title: "Terminus 4", - }, -]; - export const TerminusCommandTemplate = ({ command, slug, @@ -137,9 +68,7 @@ export const TerminusCommandTemplate = ({ className="pds-container pds-container--x-wide" >
-
diff --git a/src/templates/terminus.tsx b/src/templates/terminus.tsx deleted file mode 100644 index 7d8fde5698..0000000000 --- a/src/templates/terminus.tsx +++ /dev/null @@ -1,114 +0,0 @@ -import Layout from "@/components/layout"; -import { OmniSidebarNav } from "@/components/omniSideBarNav"; -import { DocsSidebarLayout } from "@/components/pds-middleware/docs-sidebar-layout"; -import { ProcessedFile } from "@/server/processor/mdx"; -import SearchBar from "@/components/header/search-bar"; -import { MdxWrapper } from "@/components/ui/mdx-wrapper"; -import HeaderBody from "@/components/common/header-body"; -import { TOC } from "@/components/common/toc"; - -const ContainerDiv = ({ children }: { children: React.ReactNode }) => ( -
{children}
-); - -const ContentLayoutType = ({ - children, - hasTOC, -}: { - children: React.ReactNode; - hasTOC: boolean; -}) => { - if (hasTOC) { - return ( - - {children} - - ); - } - - return {children}; -}; - -export const TerminusTemplate = ({ terminus }: { terminus: ProcessedFile }) => { - const items: any[] = []; // todo: add items @aniketbiprojit - - const hasTOC = terminus.frontmatter.showtoc ?? false; - - let image = "/images/" + terminus.frontmatter.image; - if (image === "/images/null") { - image = "/images/default-thumb-guides.png"; - } - - return ( - - -
- -
- -
- -
- -
-
-
-
- - -
-
-
- {hasTOC && ( -
- -
- )} -
-
-
-
- ); -};