From 2ada2b2ea6f629e0524b80a9822cbe576f19e5c2 Mon Sep 17 00:00:00 2001 From: StarFleetCPTN Date: Sat, 12 Apr 2025 13:36:00 -0700 Subject: [PATCH] chore: Update Docusaurus deployment workflow and documentation structure - Added a step to copy screenshots to the static directory during deployment. - Updated .gitignore to keep the README file in the screenshots directory. - Added a new README file in the screenshots directory to explain its purpose and usage. - Introduced a new npm script to prepare screenshots for the documentation site. --- .github/workflows/docusaurus-deploy.yml | 3 +++ docs/.gitignore | 3 +++ docs/docusaurus.config.ts | 4 ++-- docs/package.json | 3 ++- docs/static/screenshots/README.md | 7 +++++++ 5 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 docs/static/screenshots/README.md diff --git a/.github/workflows/docusaurus-deploy.yml b/.github/workflows/docusaurus-deploy.yml index 4b6b46f..85ae655 100644 --- a/.github/workflows/docusaurus-deploy.yml +++ b/.github/workflows/docusaurus-deploy.yml @@ -39,6 +39,9 @@ jobs: - name: Install dependencies run: npm ci + - name: Copy screenshots to static directory + run: npm run prepare-screenshots + - name: Build run: npm run build diff --git a/docs/.gitignore b/docs/.gitignore index b2d6de3..c19b929 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -18,3 +18,6 @@ npm-debug.log* yarn-debug.log* yarn-error.log* + +# Keep the screenshots directory README +!/static/screenshots/README.md diff --git a/docs/docusaurus.config.ts b/docs/docusaurus.config.ts index 62da13d..9a2ceee 100644 --- a/docs/docusaurus.config.ts +++ b/docs/docusaurus.config.ts @@ -41,13 +41,13 @@ const config: Config = { sidebarPath: './sidebars.ts', // Please change this to your repo. editUrl: - 'https://github.com/StarFleetCPTN/GoMFT/tree/main/documentation', + 'https://github.com/StarFleetCPTN/GoMFT/tree/main/docs', }, blog: { showReadingTime: true, // Please change this to your repo. editUrl: - 'https://github.com/StarFleetCPTN/GoMFT/tree/main/documentation', + 'https://github.com/StarFleetCPTN/GoMFT/tree/main/docs', }, theme: { customCss: './src/css/custom.css', diff --git a/docs/package.json b/docs/package.json index 7ed2586..c9ff8e8 100644 --- a/docs/package.json +++ b/docs/package.json @@ -13,7 +13,8 @@ "write-translations": "docusaurus write-translations", "write-heading-ids": "docusaurus write-heading-ids", "typecheck": "tsc", - "deploy-gh-pages": "GIT_USER=StarFleetCPTN USE_SSH=true yarn deploy" + "deploy-gh-pages": "GIT_USER=StarFleetCPTN USE_SSH=true yarn deploy", + "prepare-screenshots": "node -e \"const fs = require('fs'); if (!fs.existsSync('./static/screenshots')) { fs.mkdirSync('./static/screenshots', { recursive: true }); fs.readdirSync('../screenshots').forEach(file => { if (!fs.existsSync('./static/screenshots/' + file)) { fs.copyFileSync('../screenshots/' + file, './static/screenshots/' + file); } }); }\"" }, "dependencies": { "@docusaurus/core": "3.7.0", diff --git a/docs/static/screenshots/README.md b/docs/static/screenshots/README.md new file mode 100644 index 0000000..ff49887 --- /dev/null +++ b/docs/static/screenshots/README.md @@ -0,0 +1,7 @@ +# Screenshots directory + +This directory contains copies of the screenshots from the main repository root. These are used in the documentation site. + +The contents of this directory are automatically updated by the `prepare-screenshots` script in the package.json file. + +Do not manually add files to this directory as they will be overwritten by the scripts. \ No newline at end of file