diff --git a/.github/workflows/deploy.yml b/.github/workflows/gh-pages-deploy.yml similarity index 74% rename from .github/workflows/deploy.yml rename to .github/workflows/gh-pages-deploy.yml index 5440660f..bb32fa3b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/gh-pages-deploy.yml @@ -1,11 +1,12 @@ -# workflow for deploying astro project to GitHub Pages name: Build & Deploy docs-next to Github Pages on: - # Runs on pull requests and manual invocations for targeted bran + # Runs only when a pull request targets deploy-to-github-pages pull_request: + branches: + - deploy-to-github-pages - # Allows you to run this workflow manually from the Actions tab + # Allows manual run workflow_dispatch: inputs: target_branch: @@ -13,27 +14,20 @@ on: required: false default: '' - # Runs on pushes targeting the default branch + # Runs only on pushes to deploy-to-github-pages push: - branches: ["main"] + branches: + - deploy-to-github-pages -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: contents: read pages: write id-token: write -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. -# However, do not cancel in-progress runs as we want to allow these production deployments to complete. concurrency: group: "pages" cancel-in-progress: false -# Application is built using 2 jobs which focuses on different content files. -# build-main is built using every content except en/api and build-api only build with en/api content. -# Both build jobs clones 3 repos - SuperOfficeDocs/docs-next, SuperOfficeDocs/superoffice-docs, SuperOfficeDocs/contribution -# Both build jobs outputs respective artifacts - artifact-main and artifact-api - jobs: build-main: runs-on: ubuntu-latest @@ -48,29 +42,33 @@ jobs: with: fetch-depth: 1 repository: SuperOfficeDocs/contribution - path: external-content/contribution + path: ClientApp/external-content/contribution + - name: Checkout SuperOfficeDocs repo uses: actions/checkout@v4 with: fetch-depth: 1 repository: SuperOfficeDocs/superoffice-docs - path: external-content/superoffice-docs + path: ClientApp/external-content/superoffice-docs - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: 22 cache: 'npm' + cache-dependency-path: ClientApp/package-lock.json - run: npm ci + working-directory: ClientApp - name: Build Astro excluding API + working-directory: ClientApp env: API_ONLY: 'false' run: | npm run build - mkdir -p dist-out - cp -r dist/* dist-out/ + mkdir -p ../dist-out + cp -r dist/* ../dist-out/ - name: Upload main artifact uses: actions/upload-artifact@v4 @@ -93,30 +91,33 @@ jobs: with: fetch-depth: 1 repository: SuperOfficeDocs/contribution - path: external-content/contribution + path: ClientApp/external-content/contribution - name: Checkout SuperOfficeDocs repo uses: actions/checkout@v4 with: fetch-depth: 1 repository: SuperOfficeDocs/superoffice-docs - path: external-content/superoffice-docs + path: ClientApp/external-content/superoffice-docs - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: 22 cache: 'npm' + cache-dependency-path: ClientApp/package-lock.json - run: npm ci + working-directory: ClientApp - name: Build Astro API only + working-directory: ClientApp env: API_ONLY: 'true' run: | npm run build - mkdir -p dist-out - cp -r dist/* dist-out/ + mkdir -p ../dist-out + cp -r dist/* ../dist-out/ - name: Upload API artifact uses: actions/upload-artifact@v4 @@ -124,7 +125,6 @@ jobs: name: artifact-api path: dist-out - # deploy job downloads artifacts from build jobs, merge them in to one directory, create search index, and deploy to github pages deploy: needs: [build-main, build-api] runs-on: ubuntu-latest @@ -163,7 +163,7 @@ jobs: - name: Index pages using Pagefind run: npx pagefind --site final-dist - + - name: Check if the PR originates from source repo id: check_pr_source run: | @@ -188,4 +188,4 @@ jobs: - name: Deploy to GitHub Pages if: steps.check_pr_source.outputs.skip_deploy == 'false' id: deployment - uses: actions/deploy-pages@v4 \ No newline at end of file + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/main_docs-next.yml b/.github/workflows/main_docs-next.yml index dab07fd8..332a2b09 100644 --- a/.github/workflows/main_docs-next.yml +++ b/.github/workflows/main_docs-next.yml @@ -1,65 +1,92 @@ -# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy -# More GitHub Actions for Azure: https://github.com/Azure/actions - -name: Build and deploy ASP.Net Core app to Azure Web App - docs-next - -on: - push: - branches: - - main - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - permissions: - contents: read #This is required for actions/checkout - - steps: - - uses: actions/checkout@v4 - - - name: Set up .NET Core - uses: actions/setup-dotnet@v4 - with: - dotnet-version: '8.x' - - - name: Build with dotnet - run: dotnet build --configuration Release - - - name: dotnet publish - run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp - - - name: Upload artifact for deployment job - uses: actions/upload-artifact@v4 - with: - name: .net-app - path: ${{env.DOTNET_ROOT}}/myapp - - deploy: - runs-on: ubuntu-latest - needs: build +name: Build and deploy ASP.Net Core app to Azure Web App - docs-next +on: + push: + branches: + - main + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest permissions: - id-token: write #This is required for requesting the JWT - contents: read #This is required for actions/checkout - - steps: - - name: Download artifact from build job - uses: actions/download-artifact@v4 - with: - name: .net-app + id-token: write + contents: read - - name: Login to Azure + + steps: + - name: Checkout docs-next + uses: actions/checkout@v4 + + - name: Checkout contribution repo + uses: actions/checkout@v4 + with: + fetch-depth: 1 + repository: SuperOfficeDocs/contribution + path: ClientApp/external-content/contribution + + - name: Checkout SuperOfficeDocs repo + uses: actions/checkout@v4 + with: + fetch-depth: 1 + repository: SuperOfficeDocs/superoffice-docs + path: ClientApp/external-content/superoffice-docs + + # Set up .NET + - name: Set up .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.x' + + # Set up Node.js (for Astro build) + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '22.x' + cache: 'npm' + cache-dependency-path: 'ClientApp/package-lock.json' + + - name: Publish project (runs npm + copies frontend via MSBuild target) + working-directory: ./Server + run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/out + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: dotnet-artifact + path: ${{env.DOTNET_ROOT}}/out + + deploy: + runs-on: ubuntu-latest + needs: build + permissions: + id-token: write + contents: read + + steps: + - name: Download build artifact + uses: actions/download-artifact@v4 + with: + name: dotnet-artifact + path: ./publish + + - name: Create deployment ZIP + run: | + cd publish + zip -r ../app.zip . + cd .. + + - name: Azure Login (OIDC) uses: azure/login@v2 with: client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_7D6201BE9CBA4102A67082079FA9D045 }} tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_E5F979726F2140149EE71D82B31CE225 }} subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_3F73E186A6F2462480840A28C77242B0 }} - - - name: Deploy to Azure Web App - id: deploy-to-webapp - uses: azure/webapps-deploy@v3 - with: - app-name: 'docs-next' - slot-name: 'Production' - package: . - \ No newline at end of file + + - name: Deploy ZIP to Azure Web App + uses: azure/webapps-deploy@v3 + with: + app-name: 'docs-next' + package: ./app.zip diff --git a/.gitignore b/.gitignore index 9b80b5ba..566f1e29 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,31 @@ +.vs +.vscode/ + # build output -dist/ +out + +ClientApp/dist/ -.distA/ -.distB/ +ClientApp/.distA/ +ClientApp/.distB/ # generated types -.astro/ +ClientApp/.astro/ # dependencies -node_modules/ +ClientApp/node_modules/ + +# Build Log +ClientApp/build.log + + +# .NET +Server/bin/ +Server/obj/ +Server/wwwroot/ +Server/publish/ + # logs npm-debug.log* @@ -19,8 +35,8 @@ pnpm-debug.log* # environment variables -.env -.env.production +ClientApp/.env +ClientApp/.env.production # macOS-specific files .DS_Store @@ -32,12 +48,12 @@ pnpm-debug.log* .vscode/settings.json # Playwright -e2e-tests/test-results/ -e2e-tests/playwright-report/ -e2e-tests/blob-report/ -e2e-tests/playwright/.cache/ +ClientApp/e2e-tests/test-results/ +ClientApp/e2e-tests/playwright-report/ +ClientApp/e2e-tests/blob-report/ +ClientApp/e2e-tests/playwright/.cache/ # External content (other GitHub repos) -external-content/ -public/downloads/ \ No newline at end of file +ClientApp/external-content/ +ClientApp/public/downloads/ \ No newline at end of file diff --git a/LICENSE b/ClientApp/LICENSE similarity index 100% rename from LICENSE rename to ClientApp/LICENSE diff --git a/ClientApp/README.md b/ClientApp/README.md new file mode 100644 index 00000000..03df3f5a --- /dev/null +++ b/ClientApp/README.md @@ -0,0 +1,157 @@ +# The Expanse + +## πŸš€ Project structure + +Inside of your Astro project, you'll see the following folders and files: + +```text +/ +β”œβ”€β”€ external-content +β”œβ”€β”€ public/ +β”œβ”€β”€ build/ +β”œβ”€β”€ src/ +β”‚ └── content.config.ts +β”‚ └── content.schema.ts +β”‚ └── assets/ +β”‚ └── components/ +β”‚ └── content/ (deprecated) +β”‚ └── layouts/ +β”‚ └── media/ +β”‚ └── pages/ +β”‚ └── index.astro +β”‚ └── plugins +β”‚ └── reuse/ +β”‚ └── scripts/ +β”‚ └── styles/ +β”‚ └── types/ +β”‚ └── utils/ +β”œβ”€β”€ astro.config.mjs +└── package.json +``` + +Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name. + +Put any Astro/React/Vue/Svelte/Preact components in `src/components/`. + +Any static assets can be placed in the `public/` directory. Put images referenced by content in `media/`. + +## Getting started + +### One-time setup + +1. Clone docs-next +1. cd docs-next +1. mkdir external-content +1. cd external-content +1. Clone superoffice-docs and contribution +1. cd ../public +1. Clone downloads +1. cd .. + +### Set up local build environment + +1. Install Node.js - v18.20.8 or v20.3.0, v22.0.0 or higher. ( v19 and v21 are not supported.) +1. Install Astro: `npm install astro`. +1. Install/update dependencies: `npm install`. + +NOTE: We're running on a beta release of astro_redirect_from, because the creator generously implemented a fix for us. Eventually, we'll switch to the official version. + +To install just the fix: `npm i astro-redirect-from@1.4.0-beta.0` + +I've requested additional modifications, so keep an eye out for updates. + +### Increase memory + +For some content collections, Astro needs more memory than the default settings. + +We have modified the scripts in *package.json* like this (12GB): + +```json +"build": "cross-env NODE_OPTIONS=\"--max-old-space-size=12288\" astro check && astro build", +``` + +Other ways to increase memory: + +* `npm run build --max-old-space-size=12288` +* `set NODE_OPTIONS="--max-old-space-size=12288"` (before builds) +* `export NODE_OPTIONS="--max-old-space-size=12288"` (restart cli required) +* `setx NODE_OPTIONS "--max-old-space-size=12288"` (for/in VSCode) + +## Build the site + +### Partial builds + +At the time of writing, the build is split in 2 and controlled with `process.env.API_ONLY`. + +Locally, you can choose one or the other: +* API only: crmscript and netserver-scripting references from automation (`$env:API_ONLY = "true"`) +* Main: everything else (`$env:API_ONLY = "false"`) - this is the default! + +To see what gets built in each split, check src/content.config.ts + +### Full build + +1. `npm run build:local` + +1. Preview the build: `npm run preview` + +Uses script build/local-build-script.mjs to build the site using 2 splits controlled with `process.env.API_ONLY`. +After building 2 splits seperately, output gets merged and pagefind indexing gets run on the final output. + +### Deployment build + +The GitHub deployment runs both builds and stitch the files together before re-running pagefind (search index). This is orchestrated in .github/workflows/deploy.yml + +### Optionally check memory usage while building + +```cmd +Get-Process node | Sort-Object WS -Descending | Select-Object -First 1 +``` + +## Look and feel + +This project uses Tailwind CSS. SuperOffice colors are specified in tailwind.config.mjs. + +## Internalization + +TK + +## Dependencies + +See `package.json`. + +## 🧞 Commands + +All commands are run from the root of the project, from a terminal: + +| Command | Action | +| :------------------------ | :-------------------------------------------------------- | +| `npm install` | Installs dependencies | +| `npm run dev` | Starts local dev server at `localhost:4321` | +| `npm run build:default` | Build production site to `./dist/` | +| `npm run build` | Build production site using increased memory | +| `npm run build:local` | Build production site using build/local-build-script.mjs` | +| `npm run preview` | Preview built site locally | +| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` | +| `npm run astro -- --help` | Get help using the Astro CLI | +| `npm run test:e2e` | Run end to end tests | + +## Other Scripts + +### Detect duplicate frontmatter keys + +- The script build/detect-duplicate-frontmatter.js can be used to detect duplicate frontmatter keys in .md files +- It Uses NodeJS and already available npm packages in the repo, such as 'yaml'. So no need to install additional npm packages. +- To run the script, use command `node build/detect-duplicate-frontmatter.js. +- It will create a txt file if it finds any duplicate frontmatter properties. +- It is configured look for files in external-content/superoffice-docs/docs and it can be changed in line 12 of the script. + +## External content + +The **external-content** folder serves as a grafting point for content residing outside the docs-next repo. + +To get up and running, `mkdir external-content` and clone superoffice-docs and contribution into this folder. + +Remember to pull periodically to make sure you have the latest content. + +Todo: create a small script that pulls both superoffice-docs, contribution, and downloads. diff --git a/astro.config.mjs b/ClientApp/astro.config.mjs similarity index 99% rename from astro.config.mjs rename to ClientApp/astro.config.mjs index df572459..49a6fc1f 100644 --- a/astro.config.mjs +++ b/ClientApp/astro.config.mjs @@ -130,6 +130,6 @@ export default defineConfig({ }, logLevel: process.env.CI ? 'error' : 'info', site: "https://superofficedocs.github.io", - base: "/docs-next", + // base: "/", trailingSlash: "never", }); diff --git a/build/detect-duplicate-frontmatter.js b/ClientApp/build/detect-duplicate-frontmatter.js similarity index 100% rename from build/detect-duplicate-frontmatter.js rename to ClientApp/build/detect-duplicate-frontmatter.js diff --git a/build/local-build-script.mjs b/ClientApp/build/local-build-script.mjs similarity index 60% rename from build/local-build-script.mjs rename to ClientApp/build/local-build-script.mjs index 210d346e..af2a9b99 100644 --- a/build/local-build-script.mjs +++ b/ClientApp/build/local-build-script.mjs @@ -1,6 +1,15 @@ import { execSync } from "child_process"; import { cpSync, rmSync, existsSync } from "fs"; import path from "path"; +import { fileURLToPath } from "url"; + +// Work out project root +const __dirname = path.dirname(fileURLToPath(import.meta.url)); +const clientRoot = path.resolve(__dirname, ".."); + +// Paths to local binaries +const astroBin = path.join(clientRoot, "node_modules", ".bin", "astro"); +const pagefindBin = path.join(clientRoot, "node_modules", ".bin", "pagefind"); // Paths const distDir = path.resolve("dist"); @@ -14,12 +23,18 @@ const distB = path.resolve(".distB"); // First build with API_ONLY=true console.log("Building with API_ONLY=true"); -execSync("cross-env API_ONLY=false astro build", { stdio: "inherit" }); +execSync(`"${astroBin}" build`, { + stdio: "inherit", + env: { ...process.env, API_ONLY: "true" }, +}); cpSync(distDir, distA, { recursive: true }); // Second build with API_ONLY=false console.log("Building with API_ONLY=false"); -execSync("cross-env API_ONLY=false astro build", { stdio: "inherit" }); +execSync(`"${astroBin}" build`, { + stdio: "inherit", + env: { ...process.env, API_ONLY: "false" }, +}); cpSync(distDir, distB, { recursive: true }); // Merge outputs @@ -27,13 +42,13 @@ console.log("Merging distA and distB into dist..."); cpSync(distA, distDir, { recursive: true }); cpSync(distB, distDir, { recursive: true }); -// Cleanup tempory dir adter merging +// Cleanup temporary dirs after merging [distA, distB].forEach((dir) => { if (existsSync(dir)) rmSync(dir, { recursive: true, force: true }); }); // Pagefind Indexing console.log("Indexing with Pagefind"); -execSync("npx pagefind --site dist", { stdio: "inherit" }); +execSync(`"${pagefindBin}" --site dist`, { stdio: "inherit" }); console.log("Completed. Final merged build is in dist/"); diff --git a/e2e-tests/package-lock.json b/ClientApp/e2e-tests/package-lock.json similarity index 100% rename from e2e-tests/package-lock.json rename to ClientApp/e2e-tests/package-lock.json diff --git a/e2e-tests/package.json b/ClientApp/e2e-tests/package.json similarity index 100% rename from e2e-tests/package.json rename to ClientApp/e2e-tests/package.json diff --git a/e2e-tests/playwright.config.ts b/ClientApp/e2e-tests/playwright.config.ts similarity index 100% rename from e2e-tests/playwright.config.ts rename to ClientApp/e2e-tests/playwright.config.ts diff --git a/e2e-tests/tests/index.spec.ts b/ClientApp/e2e-tests/tests/index.spec.ts similarity index 100% rename from e2e-tests/tests/index.spec.ts rename to ClientApp/e2e-tests/tests/index.spec.ts diff --git a/e2e-tests/tests/index.spec.ts-snapshots/Index-page-snapshot-test-1-chromium-win32.png b/ClientApp/e2e-tests/tests/index.spec.ts-snapshots/Index-page-snapshot-test-1-chromium-win32.png similarity index 100% rename from e2e-tests/tests/index.spec.ts-snapshots/Index-page-snapshot-test-1-chromium-win32.png rename to ClientApp/e2e-tests/tests/index.spec.ts-snapshots/Index-page-snapshot-test-1-chromium-win32.png diff --git a/e2e-tests/tests/index.spec.ts-snapshots/Index-page-snapshot-test-1-firefox-win32.png b/ClientApp/e2e-tests/tests/index.spec.ts-snapshots/Index-page-snapshot-test-1-firefox-win32.png similarity index 100% rename from e2e-tests/tests/index.spec.ts-snapshots/Index-page-snapshot-test-1-firefox-win32.png rename to ClientApp/e2e-tests/tests/index.spec.ts-snapshots/Index-page-snapshot-test-1-firefox-win32.png diff --git a/e2e-tests/tests/index.spec.ts-snapshots/Index-page-snapshot-test-1-webkit-win32.png b/ClientApp/e2e-tests/tests/index.spec.ts-snapshots/Index-page-snapshot-test-1-webkit-win32.png similarity index 100% rename from e2e-tests/tests/index.spec.ts-snapshots/Index-page-snapshot-test-1-webkit-win32.png rename to ClientApp/e2e-tests/tests/index.spec.ts-snapshots/Index-page-snapshot-test-1-webkit-win32.png diff --git a/package-lock.json b/ClientApp/package-lock.json similarity index 100% rename from package-lock.json rename to ClientApp/package-lock.json diff --git a/package.json b/ClientApp/package.json similarity index 100% rename from package.json rename to ClientApp/package.json diff --git a/public/favicon.ico b/ClientApp/public/favicon.ico similarity index 100% rename from public/favicon.ico rename to ClientApp/public/favicon.ico diff --git a/src/assets/404_Hugo.svg b/ClientApp/src/assets/404_Hugo.svg similarity index 100% rename from src/assets/404_Hugo.svg rename to ClientApp/src/assets/404_Hugo.svg diff --git a/src/assets/favicon.ico b/ClientApp/src/assets/favicon.ico similarity index 100% rename from src/assets/favicon.ico rename to ClientApp/src/assets/favicon.ico diff --git a/src/assets/logo.svg b/ClientApp/src/assets/logo.svg similarity index 99% rename from src/assets/logo.svg rename to ClientApp/src/assets/logo.svg index be0fc35e..4fe2cd63 100644 --- a/src/assets/logo.svg +++ b/ClientApp/src/assets/logo.svg @@ -1,8 +1,8 @@ -

{heading}

-
- { - links?.length - ? links.map(({ href, text }) => ( - -

{text}

-
- )) - : "" - } -
- +--- +interface Link { + text?: string; + href?: string; +} + +export interface Props { + links: Array; + heading: String; +} + +const { links = [], heading } = Astro.props; +const base = import.meta.env.BASE_URL; +--- + +
+

{heading}

+
+ { + links?.length + ? links.map(({ href, text }) => ( + +

{text}

+
+ )) + : "" + } +
+
diff --git a/src/components/Audience.astro b/ClientApp/src/components/Audience.astro similarity index 97% rename from src/components/Audience.astro rename to ClientApp/src/components/Audience.astro index 5820f994..61d6fb42 100644 --- a/src/components/Audience.astro +++ b/ClientApp/src/components/Audience.astro @@ -1,30 +1,30 @@ ---- -import { audienceTypes } from "../data/audience"; - -const { audience = [] } = audienceTypes; -const { heading } = Astro.props; ---- - -
-

{heading}

-
- { - audience?.length - ? audience.map(({ href, title, description, color }) => ( -
-
-

{title}

-

{description}

- -
-
-
- )) - : "" - } -
-
+--- +import { audienceTypes } from "../data/audience"; + +const { audience = [] } = audienceTypes; +const { heading } = Astro.props; +--- + +
+

{heading}

+
+ { + audience?.length + ? audience.map(({ href, title, description, color }) => ( +
+
+

{title}

+

{description}

+ +
+
+
+ )) + : "" + } +
+
diff --git a/src/components/CategoryLandingAdditionalContentCard.astro b/ClientApp/src/components/CategoryLandingAdditionalContentCard.astro similarity index 100% rename from src/components/CategoryLandingAdditionalContentCard.astro rename to ClientApp/src/components/CategoryLandingAdditionalContentCard.astro diff --git a/src/components/CategoryLandingCard.astro b/ClientApp/src/components/CategoryLandingCard.astro similarity index 100% rename from src/components/CategoryLandingCard.astro rename to ClientApp/src/components/CategoryLandingCard.astro diff --git a/src/components/CheckBox.tsx b/ClientApp/src/components/CheckBox.tsx similarity index 100% rename from src/components/CheckBox.tsx rename to ClientApp/src/components/CheckBox.tsx diff --git a/src/components/EditPage.astro b/ClientApp/src/components/EditPage.astro similarity index 95% rename from src/components/EditPage.astro rename to ClientApp/src/components/EditPage.astro index 54a7dd26..bf31ebc4 100644 --- a/src/components/EditPage.astro +++ b/ClientApp/src/components/EditPage.astro @@ -1,12 +1,12 @@ ---- -import { getEditHref } from "@utils/headerUtils"; - -export interface Props { - docurl: string; -} - -const { docurl } = Astro.props; -const href = getEditHref(docurl); ---- - - Edit +--- +import { getEditHref } from "@utils/headerUtils"; + +export interface Props { + docurl: string; +} + +const { docurl } = Astro.props; +const href = getEditHref(docurl); +--- + + Edit diff --git a/src/components/Feedback.astro b/ClientApp/src/components/Feedback.astro similarity index 95% rename from src/components/Feedback.astro rename to ClientApp/src/components/Feedback.astro index 9e495c8b..3fb0f740 100644 --- a/src/components/Feedback.astro +++ b/ClientApp/src/components/Feedback.astro @@ -1,14 +1,14 @@ ---- -import { getFeedbackHref } from "@utils/headerUtils"; - -export interface Props { - docurl: string; - title: string; - uid: string; -} - -const { docurl, title, uid } = Astro.props; -const href = getFeedbackHref(docurl, title, uid); ---- - - Feedback +--- +import { getFeedbackHref } from "@utils/headerUtils"; + +export interface Props { + docurl: string; + title: string; + uid: string; +} + +const { docurl, title, uid } = Astro.props; +const href = getFeedbackHref(docurl, title, uid); +--- + + Feedback diff --git a/src/components/Footer.tsx b/ClientApp/src/components/Footer.tsx similarity index 100% rename from src/components/Footer.tsx rename to ClientApp/src/components/Footer.tsx diff --git a/src/components/GradientBanner.astro b/ClientApp/src/components/GradientBanner.astro similarity index 96% rename from src/components/GradientBanner.astro rename to ClientApp/src/components/GradientBanner.astro index 7db01993..38c8397c 100644 --- a/src/components/GradientBanner.astro +++ b/ClientApp/src/components/GradientBanner.astro @@ -1,19 +1,19 @@ ---- -const tagline = - "The official documentation site for the SuperOffice Platform - the leading CRM & Customer Service available."; - ---- - -
-
-

docs.superoffice.com

-

{tagline}

-
-
- - +--- +const tagline = + "The official documentation site for the SuperOffice Platform - the leading CRM & Customer Service available."; + +--- + +
+
+

docs.superoffice.com

+

{tagline}

+
+
+ + diff --git a/src/components/Hamburger.astro b/ClientApp/src/components/Hamburger.astro similarity index 95% rename from src/components/Hamburger.astro rename to ClientApp/src/components/Hamburger.astro index a6ffcd09..5b701cc3 100644 --- a/src/components/Hamburger.astro +++ b/ClientApp/src/components/Hamburger.astro @@ -1,23 +1,23 @@ ---- - ---- - +--- + +--- + diff --git a/src/components/Header.astro b/ClientApp/src/components/Header.astro similarity index 96% rename from src/components/Header.astro rename to ClientApp/src/components/Header.astro index 38a08faf..421fc22c 100644 --- a/src/components/Header.astro +++ b/ClientApp/src/components/Header.astro @@ -1,170 +1,170 @@ ---- -import { Icon } from "astro-icon/components"; -import Hamburger from "./Hamburger.astro"; -import logo from "@assets/logo.svg"; -import { trimSlash } from "@utils/headerUtils"; - -const base = import.meta.env.BASE_URL; - -interface Link { - text?: string; - href?: string; - ariaLabel?: string; - icon?: string; - links?: Link[]; -} - -export interface Props { - links?: Link[]; -} - -const { links = [] } = Astro.props; -const currentPath = `/${trimSlash(new URL(Astro.url).pathname)}`; ---- - - - - - - +--- +import { Icon } from "astro-icon/components"; +import Hamburger from "./Hamburger.astro"; +import logo from "@assets/logo.svg"; +import { trimSlash } from "@utils/headerUtils"; + +const base = import.meta.env.BASE_URL; + +interface Link { + text?: string; + href?: string; + ariaLabel?: string; + icon?: string; + links?: Link[]; +} + +export interface Props { + links?: Link[]; +} + +const { links = [] } = Astro.props; +const currentPath = `/${trimSlash(new URL(Astro.url).pathname)}`; +--- + + + + + + diff --git a/src/components/Hero.astro b/ClientApp/src/components/Hero.astro similarity index 96% rename from src/components/Hero.astro rename to ClientApp/src/components/Hero.astro index f8c0a60f..8521fd0e 100644 --- a/src/components/Hero.astro +++ b/ClientApp/src/components/Hero.astro @@ -1,41 +1,41 @@ ---- -import { Icon } from "astro-icon/components"; -import { heroItems } from "../data/navigation"; -import GradientBanner from "./GradientBanner.astro"; -const { links = [] } = heroItems; -const base = import.meta.env.BASE_URL; ---- - -
- - - -
+--- +import { Icon } from "astro-icon/components"; +import { heroItems } from "../data/navigation"; +import GradientBanner from "./GradientBanner.astro"; +const { links = [] } = heroItems; +const base = import.meta.env.BASE_URL; +--- + +
+ + + +
diff --git a/src/components/IconSelection.tsx b/ClientApp/src/components/IconSelection.tsx similarity index 100% rename from src/components/IconSelection.tsx rename to ClientApp/src/components/IconSelection.tsx diff --git a/src/components/LanguageSelect.tsx b/ClientApp/src/components/LanguageSelect.tsx similarity index 100% rename from src/components/LanguageSelect.tsx rename to ClientApp/src/components/LanguageSelect.tsx diff --git a/src/components/Link.astro b/ClientApp/src/components/Link.astro similarity index 100% rename from src/components/Link.astro rename to ClientApp/src/components/Link.astro diff --git a/src/components/OnThisArticle.tsx b/ClientApp/src/components/OnThisArticle.tsx similarity index 100% rename from src/components/OnThisArticle.tsx rename to ClientApp/src/components/OnThisArticle.tsx diff --git a/src/components/OnThisPage.astro b/ClientApp/src/components/OnThisPage.astro similarity index 96% rename from src/components/OnThisPage.astro rename to ClientApp/src/components/OnThisPage.astro index f2e0bcab..6ea6ff36 100644 --- a/src/components/OnThisPage.astro +++ b/ClientApp/src/components/OnThisPage.astro @@ -1,157 +1,157 @@ - + diff --git a/src/components/PageHeader.astro b/ClientApp/src/components/PageHeader.astro similarity index 96% rename from src/components/PageHeader.astro rename to ClientApp/src/components/PageHeader.astro index 407807a0..e550f9e1 100644 --- a/src/components/PageHeader.astro +++ b/ClientApp/src/components/PageHeader.astro @@ -1,77 +1,77 @@ ---- -import { Breadcrumbs } from "astro-breadcrumbs"; -import Feedback from "./Feedback.astro"; -import Edit from "./EditPage.astro"; -import Share from "./Share.astro"; -import LanguageSelect from "./LanguageSelect"; -const currentLocale = Astro.currentLocale; -const liveUrl = Astro.url.pathname; - -import "astro-breadcrumbs/breadcrumbs.css"; -const ariaLabel = "Breadcrumb navigation and social links"; - -export interface Props { - filePath?: string; - metadata?: { - title?: string; - description?: string; - uid?: string; - }; - isLearnCategoryPage: boolean; -} - -const { filePath, metadata, isLearnCategoryPage } = Astro.props; -const { title, description, uid } = metadata ?? {}; -const isHelp = uid?.split("-")[0] == "help"; -const filePathUrl = filePath?.replace("external-content/superoffice-docs/",""); - ---- - -
-
-
- - - - -
- -
-
+--- +import { Breadcrumbs } from "astro-breadcrumbs"; +import Feedback from "./Feedback.astro"; +import Edit from "./EditPage.astro"; +import Share from "./Share.astro"; +import LanguageSelect from "./LanguageSelect"; +const currentLocale = Astro.currentLocale; +const liveUrl = Astro.url.pathname; + +import "astro-breadcrumbs/breadcrumbs.css"; +const ariaLabel = "Breadcrumb navigation and social links"; + +export interface Props { + filePath?: string; + metadata?: { + title?: string; + description?: string; + uid?: string; + }; + isLearnCategoryPage: boolean; +} + +const { filePath, metadata, isLearnCategoryPage } = Astro.props; +const { title, description, uid } = metadata ?? {}; +const isHelp = uid?.split("-")[0] == "help"; +const filePathUrl = filePath?.replace("external-content/superoffice-docs/",""); + +--- + +
+
+
+ + + + +
+ +
+
diff --git a/src/components/QuickAccessShortcuts.astro b/ClientApp/src/components/QuickAccessShortcuts.astro similarity index 100% rename from src/components/QuickAccessShortcuts.astro rename to ClientApp/src/components/QuickAccessShortcuts.astro diff --git a/src/components/Search.astro b/ClientApp/src/components/Search.astro similarity index 96% rename from src/components/Search.astro rename to ClientApp/src/components/Search.astro index 47924eaa..be7b924e 100644 --- a/src/components/Search.astro +++ b/ClientApp/src/components/Search.astro @@ -9,7 +9,7 @@ export interface Props { } const { id, className, query, uiOptions = {} } = Astro.props; -const bundlePath = `${import.meta.env.BASE_URL}/pagefind/`; +const bundlePath = `pagefind/`; ---