diff --git a/ClientApp/src/layouts/ContentLayout.astro b/Source/SuperOffice.DocsNext/ClientApp/src/layouts/ContentLayout.astro
similarity index 100%
rename from ClientApp/src/layouts/ContentLayout.astro
rename to Source/SuperOffice.DocsNext/ClientApp/src/layouts/ContentLayout.astro
diff --git a/ClientApp/src/layouts/SubCategoryLandingLayout.astro b/Source/SuperOffice.DocsNext/ClientApp/src/layouts/SubCategoryLandingLayout.astro
similarity index 100%
rename from ClientApp/src/layouts/SubCategoryLandingLayout.astro
rename to Source/SuperOffice.DocsNext/ClientApp/src/layouts/SubCategoryLandingLayout.astro
diff --git a/ClientApp/src/layouts/YamlLayoutPage.astro b/Source/SuperOffice.DocsNext/ClientApp/src/layouts/YamlLayoutPage.astro
similarity index 76%
rename from ClientApp/src/layouts/YamlLayoutPage.astro
rename to Source/SuperOffice.DocsNext/ClientApp/src/layouts/YamlLayoutPage.astro
index 1bfaa572..370233e8 100644
--- a/ClientApp/src/layouts/YamlLayoutPage.astro
+++ b/Source/SuperOffice.DocsNext/ClientApp/src/layouts/YamlLayoutPage.astro
@@ -1,5 +1,7 @@
---
-import { getEntry, type CollectionEntry } from "astro:content";
+import { readFile } from "fs/promises";
+import path from "path";
+import yaml from "js-yaml";
import type {
headingsListProps,
namespaceClassifiedDataProps,
@@ -10,21 +12,16 @@ import YamlClass from "@components/YamlClass.astro";
import type { TocData } from "~/types/TableOfContentTypes";
import ContentLayout from "@layouts/ContentLayout.astro";
-import type { CollectionKey } from "astro:content";
-
interface Props {
- entry: CollectionEntry<
- "webapi" | "crmscript" | "web" | "netserver-core" | "netserver-services"
- >;
+ entry: any;
tocData: TocData;
- collection: CollectionKey;
+ collection: string;
}
const { entry, tocData, collection } = Astro.props;
const pageTitle = entry.data.items[0].type + " " + entry.data.items[0].id;
-// Use to get the plural forms of the name
export const conversionList = {
Class: "Classes",
Constructor: "Constructors",
@@ -36,7 +33,6 @@ export const conversionList = {
Enum: "Enums",
};
-// Generate heading from yml data
const headingList: headingsListProps = {};
const namespaceData: namespaceClassifiedDataProps = {};
@@ -57,14 +53,25 @@ function appendIntoHeadingList(key: keyof headingsListProps, dataItem: Item) {
}
const documentType = entry.data.items[0].type;
-if (documentType == "Namespace") {
+
+if (documentType === "Namespace") {
const promises = entry.data.items[0].children?.map(
async (childName: string) => {
- const formattedItem = childName.replaceAll(".", "").toLowerCase();
- const childrenItemEntry = await getEntry(collection, formattedItem);
- if (childrenItemEntry) {
- const dataItem = childrenItemEntry?.data.items[0];
+ // Build absolute path for the child YAML file
+ const baseContentPath = "external-content";
+ const childFilePath = path.join(
+ baseContentPath,
+ "superoffice-docs/docs/en/api/reference",
+ collection,
+ `${childName}.yml`
+ );
+
+ try {
+ const raw = await readFile(childFilePath, "utf8");
+ const parsed: any = yaml.load(raw);
+ const dataItem = parsed.items[0];
const key = dataItem.type as keyof namespaceClassifiedDataProps;
+
if (!namespaceData[key]) {
namespaceData[key] = [];
}
@@ -73,25 +80,28 @@ if (documentType == "Namespace") {
id: dataItem.id,
summary: dataItem.summary,
});
+
appendIntoHeadingList(key, dataItem);
+ } catch (e: any) {
+ if (e.code === "ENOENT") {
+ console.warn(`Skipped missing file: ${childFilePath}`);
+ } else {
+ console.warn(`[warn] Problem loading ${childFilePath}: ${e.message}`);
+ }
}
}
);
await Promise.all(promises || []);
} else if (["Class", "Interface", "Enum"].includes(documentType)) {
- // Append headings of every other item except parent item to headingsList
- const otherItemsExceptParentItem = entry.data.items.slice(1);
- otherItemsExceptParentItem.forEach((dataItem: Item) => {
+ const otherItems = entry.data.items.slice(1);
+ otherItems.forEach((dataItem: Item) => {
const key = dataItem.type as keyof headingsListProps;
appendIntoHeadingList(key, dataItem);
});
// Check if implements exist and add them to headingList
- if (
- entry.data.items[0].implements &&
- entry.data.items[0].implements.length > 0
- ) {
+ if (entry.data.items[0].implements?.length > 0) {
const key = "Implement" as keyof headingsListProps;
entry.data.items[0].implements.forEach((item: string) => {
if (!(key in headingList)) {
@@ -133,7 +143,7 @@ for (ItemType in headingList) {
{pageTitle}
{
- documentType == "Namespace" && (
+ documentType === "Namespace" && (
)
}
diff --git a/ClientApp/src/media/contribute/add-suggestion-icon.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/add-suggestion-icon.png
similarity index 100%
rename from ClientApp/src/media/contribute/add-suggestion-icon.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/add-suggestion-icon.png
diff --git a/ClientApp/src/media/contribute/checkout-pr.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/checkout-pr.png
similarity index 100%
rename from ClientApp/src/media/contribute/checkout-pr.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/checkout-pr.png
diff --git a/ClientApp/src/media/contribute/comment.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/comment.png
similarity index 100%
rename from ClientApp/src/media/contribute/comment.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/comment.png
diff --git a/ClientApp/src/media/contribute/commit-suggestion.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/commit-suggestion.png
similarity index 100%
rename from ClientApp/src/media/contribute/commit-suggestion.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/commit-suggestion.png
diff --git a/ClientApp/src/media/contribute/commit-to-patch.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/commit-to-patch.png
similarity index 100%
rename from ClientApp/src/media/contribute/commit-to-patch.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/commit-to-patch.png
diff --git a/ClientApp/src/media/contribute/conversation-view-changes.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/conversation-view-changes.png
similarity index 100%
rename from ClientApp/src/media/contribute/conversation-view-changes.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/conversation-view-changes.png
diff --git a/ClientApp/src/media/contribute/copy-branch-name.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/copy-branch-name.png
similarity index 100%
rename from ClientApp/src/media/contribute/copy-branch-name.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/copy-branch-name.png
diff --git a/ClientApp/src/media/contribute/copy-path.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/copy-path.png
similarity index 100%
rename from ClientApp/src/media/contribute/copy-path.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/copy-path.png
diff --git a/ClientApp/src/media/contribute/create-issue-on-github.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/create-issue-on-github.png
similarity index 100%
rename from ClientApp/src/media/contribute/create-issue-on-github.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/create-issue-on-github.png
diff --git a/ClientApp/src/media/contribute/create-patch.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/create-patch.png
similarity index 100%
rename from ClientApp/src/media/contribute/create-patch.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/create-patch.png
diff --git a/ClientApp/src/media/contribute/create-pull-request-on-github.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/create-pull-request-on-github.png
similarity index 100%
rename from ClientApp/src/media/contribute/create-pull-request-on-github.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/create-pull-request-on-github.png
diff --git a/ClientApp/src/media/contribute/edit-article-on-github.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/edit-article-on-github.png
similarity index 100%
rename from ClientApp/src/media/contribute/edit-article-on-github.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/edit-article-on-github.png
diff --git a/ClientApp/src/media/contribute/edit-file-in-pr.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/edit-file-in-pr.png
similarity index 100%
rename from ClientApp/src/media/contribute/edit-file-in-pr.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/edit-file-in-pr.png
diff --git a/ClientApp/src/media/contribute/edit-in-patch.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/edit-in-patch.png
similarity index 100%
rename from ClientApp/src/media/contribute/edit-in-patch.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/edit-in-patch.png
diff --git a/ClientApp/src/media/contribute/edit-markdown-on-github.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/edit-markdown-on-github.png
similarity index 100%
rename from ClientApp/src/media/contribute/edit-markdown-on-github.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/edit-markdown-on-github.png
diff --git a/ClientApp/src/media/contribute/enter-suggestion.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/enter-suggestion.png
similarity index 100%
rename from ClientApp/src/media/contribute/enter-suggestion.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/enter-suggestion.png
diff --git a/ClientApp/src/media/contribute/fork-repo-on-github.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/fork-repo-on-github.png
similarity index 100%
rename from ClientApp/src/media/contribute/fork-repo-on-github.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/fork-repo-on-github.png
diff --git a/ClientApp/src/media/contribute/gitbash-pull.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/gitbash-pull.png
similarity index 100%
rename from ClientApp/src/media/contribute/gitbash-pull.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/gitbash-pull.png
diff --git a/ClientApp/src/media/contribute/github-clone.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/github-clone.png
similarity index 100%
rename from ClientApp/src/media/contribute/github-clone.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/github-clone.png
diff --git a/ClientApp/src/media/contribute/github-create-pr.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/github-create-pr.png
similarity index 100%
rename from ClientApp/src/media/contribute/github-create-pr.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/github-create-pr.png
diff --git a/ClientApp/src/media/contribute/github-open-pr.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/github-open-pr.png
similarity index 100%
rename from ClientApp/src/media/contribute/github-open-pr.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/github-open-pr.png
diff --git a/ClientApp/src/media/contribute/how-to-create-tutorial-a-overview.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/how-to-create-tutorial-a-overview.png
similarity index 100%
rename from ClientApp/src/media/contribute/how-to-create-tutorial-a-overview.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/how-to-create-tutorial-a-overview.png
diff --git a/ClientApp/src/media/contribute/line-comment.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/line-comment.png
similarity index 100%
rename from ClientApp/src/media/contribute/line-comment.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/line-comment.png
diff --git a/ClientApp/src/media/contribute/mdlint-list-hover.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/mdlint-list-hover.png
similarity index 100%
rename from ClientApp/src/media/contribute/mdlint-list-hover.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/mdlint-list-hover.png
diff --git a/ClientApp/src/media/contribute/mdlint-list-quickfix.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/mdlint-list-quickfix.png
similarity index 100%
rename from ClientApp/src/media/contribute/mdlint-list-quickfix.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/mdlint-list-quickfix.png
diff --git a/ClientApp/src/media/contribute/mdlint-list-warning.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/mdlint-list-warning.png
similarity index 100%
rename from ClientApp/src/media/contribute/mdlint-list-warning.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/mdlint-list-warning.png
diff --git a/ClientApp/src/media/contribute/plain-action-buttons.PNG b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/plain-action-buttons.PNG
similarity index 100%
rename from ClientApp/src/media/contribute/plain-action-buttons.PNG
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/plain-action-buttons.PNG
diff --git a/ClientApp/src/media/contribute/preview-suggestion.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/preview-suggestion.png
similarity index 100%
rename from ClientApp/src/media/contribute/preview-suggestion.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/preview-suggestion.png
diff --git a/ClientApp/src/media/contribute/propose-changes-on-github.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/propose-changes-on-github.png
similarity index 100%
rename from ClientApp/src/media/contribute/propose-changes-on-github.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/propose-changes-on-github.png
diff --git a/ClientApp/src/media/contribute/review-changes.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/review-changes.png
similarity index 100%
rename from ClientApp/src/media/contribute/review-changes.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/review-changes.png
diff --git a/ClientApp/src/media/contribute/select-branch.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/select-branch.png
similarity index 100%
rename from ClientApp/src/media/contribute/select-branch.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/select-branch.png
diff --git a/ClientApp/src/media/contribute/submit-review.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/submit-review.png
similarity index 100%
rename from ClientApp/src/media/contribute/submit-review.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/submit-review.png
diff --git a/ClientApp/src/media/contribute/vscode-branch-menu.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/vscode-branch-menu.png
similarity index 100%
rename from ClientApp/src/media/contribute/vscode-branch-menu.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/vscode-branch-menu.png
diff --git a/ClientApp/src/media/contribute/vscode-branches.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/vscode-branches.png
similarity index 100%
rename from ClientApp/src/media/contribute/vscode-branches.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/vscode-branches.png
diff --git a/ClientApp/src/media/contribute/vscode-clone.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/vscode-clone.png
similarity index 100%
rename from ClientApp/src/media/contribute/vscode-clone.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/vscode-clone.png
diff --git a/ClientApp/src/media/contribute/vscode-commit-menu.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/vscode-commit-menu.png
similarity index 100%
rename from ClientApp/src/media/contribute/vscode-commit-menu.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/vscode-commit-menu.png
diff --git a/ClientApp/src/media/contribute/vscode-confirm-commit.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/vscode-confirm-commit.png
similarity index 100%
rename from ClientApp/src/media/contribute/vscode-confirm-commit.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/vscode-confirm-commit.png
diff --git a/ClientApp/src/media/contribute/vscode-create-branch.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/vscode-create-branch.png
similarity index 100%
rename from ClientApp/src/media/contribute/vscode-create-branch.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/vscode-create-branch.png
diff --git a/ClientApp/src/media/contribute/vscode-push-commit.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/vscode-push-commit.png
similarity index 100%
rename from ClientApp/src/media/contribute/vscode-push-commit.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/vscode-push-commit.png
diff --git a/ClientApp/src/media/contribute/vscode-push.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/vscode-push.png
similarity index 100%
rename from ClientApp/src/media/contribute/vscode-push.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/vscode-push.png
diff --git a/ClientApp/src/media/contribute/vscode-source-control-menu.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/vscode-source-control-menu.png
similarity index 100%
rename from ClientApp/src/media/contribute/vscode-source-control-menu.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/vscode-source-control-menu.png
diff --git a/ClientApp/src/media/contribute/vscode-stage-all-changes.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/vscode-stage-all-changes.png
similarity index 100%
rename from ClientApp/src/media/contribute/vscode-stage-all-changes.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/vscode-stage-all-changes.png
diff --git a/ClientApp/src/media/contribute/vscode-stash.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/vscode-stash.png
similarity index 100%
rename from ClientApp/src/media/contribute/vscode-stash.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/vscode-stash.png
diff --git a/ClientApp/src/media/contribute/vscode-switch-branch.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/vscode-switch-branch.png
similarity index 100%
rename from ClientApp/src/media/contribute/vscode-switch-branch.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/vscode-switch-branch.png
diff --git a/ClientApp/src/media/contribute/vscode-sync-changes.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/vscode-sync-changes.png
similarity index 100%
rename from ClientApp/src/media/contribute/vscode-sync-changes.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/contribute/vscode-sync-changes.png
diff --git a/ClientApp/src/media/edit-action-button.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/edit-action-button.png
similarity index 100%
rename from ClientApp/src/media/edit-action-button.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/edit-action-button.png
diff --git a/ClientApp/src/media/feedback-action-button.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/feedback-action-button.png
similarity index 100%
rename from ClientApp/src/media/feedback-action-button.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/feedback-action-button.png
diff --git a/ClientApp/src/media/github-superoffice-docs.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/github-superoffice-docs.png
similarity index 100%
rename from ClientApp/src/media/github-superoffice-docs.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/github-superoffice-docs.png
diff --git a/ClientApp/src/media/mobile/mobile-add-email-address.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/mobile/mobile-add-email-address.png
similarity index 100%
rename from ClientApp/src/media/mobile/mobile-add-email-address.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/mobile/mobile-add-email-address.png
diff --git a/ClientApp/src/media/mobile/mobile-add-email-as-attendee.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/mobile/mobile-add-email-as-attendee.png
similarity index 100%
rename from ClientApp/src/media/mobile/mobile-add-email-as-attendee.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/mobile/mobile-add-email-as-attendee.png
diff --git a/ClientApp/src/media/mobile/mobile-crm-follow-up-description-to-title-agenda-internal-notes.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/mobile/mobile-crm-follow-up-description-to-title-agenda-internal-notes.png
similarity index 100%
rename from ClientApp/src/media/mobile/mobile-crm-follow-up-description-to-title-agenda-internal-notes.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/mobile/mobile-crm-follow-up-description-to-title-agenda-internal-notes.png
diff --git a/ClientApp/src/media/mobile/mobile-crm-follow-up-show-links.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/mobile/mobile-crm-follow-up-show-links.png
similarity index 100%
rename from ClientApp/src/media/mobile/mobile-crm-follow-up-show-links.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/mobile/mobile-crm-follow-up-show-links.png
diff --git a/ClientApp/src/media/mobile/mobile-crm-gif-prev-02.gif b/Source/SuperOffice.DocsNext/ClientApp/src/media/mobile/mobile-crm-gif-prev-02.gif
similarity index 100%
rename from ClientApp/src/media/mobile/mobile-crm-gif-prev-02.gif
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/mobile/mobile-crm-gif-prev-02.gif
diff --git a/ClientApp/src/media/share-action-button.png b/Source/SuperOffice.DocsNext/ClientApp/src/media/share-action-button.png
similarity index 100%
rename from ClientApp/src/media/share-action-button.png
rename to Source/SuperOffice.DocsNext/ClientApp/src/media/share-action-button.png
diff --git a/ClientApp/src/pages/404.astro b/Source/SuperOffice.DocsNext/ClientApp/src/pages/404.astro
similarity index 100%
rename from ClientApp/src/pages/404.astro
rename to Source/SuperOffice.DocsNext/ClientApp/src/pages/404.astro
diff --git a/ClientApp/src/pages/_migrate.md b/Source/SuperOffice.DocsNext/ClientApp/src/pages/_migrate.md
similarity index 100%
rename from ClientApp/src/pages/_migrate.md
rename to Source/SuperOffice.DocsNext/ClientApp/src/pages/_migrate.md
diff --git a/ClientApp/src/pages/contribute/[...slug].astro b/Source/SuperOffice.DocsNext/ClientApp/src/pages/contribute/[...slug].astro
similarity index 100%
rename from ClientApp/src/pages/contribute/[...slug].astro
rename to Source/SuperOffice.DocsNext/ClientApp/src/pages/contribute/[...slug].astro
diff --git a/ClientApp/src/pages/contribute/index.astro b/Source/SuperOffice.DocsNext/ClientApp/src/pages/contribute/index.astro
similarity index 100%
rename from ClientApp/src/pages/contribute/index.astro
rename to Source/SuperOffice.DocsNext/ClientApp/src/pages/contribute/index.astro
diff --git a/ClientApp/src/pages/da/[...slug].astro b/Source/SuperOffice.DocsNext/ClientApp/src/pages/da/[...slug].astro
similarity index 100%
rename from ClientApp/src/pages/da/[...slug].astro
rename to Source/SuperOffice.DocsNext/ClientApp/src/pages/da/[...slug].astro
diff --git a/ClientApp/src/pages/da/[...subcategory].astro b/Source/SuperOffice.DocsNext/ClientApp/src/pages/da/[...subcategory].astro
similarity index 100%
rename from ClientApp/src/pages/da/[...subcategory].astro
rename to Source/SuperOffice.DocsNext/ClientApp/src/pages/da/[...subcategory].astro
diff --git a/ClientApp/src/pages/da/[category].astro b/Source/SuperOffice.DocsNext/ClientApp/src/pages/da/[category].astro
similarity index 100%
rename from ClientApp/src/pages/da/[category].astro
rename to Source/SuperOffice.DocsNext/ClientApp/src/pages/da/[category].astro
diff --git a/ClientApp/src/pages/de/[...slug].astro b/Source/SuperOffice.DocsNext/ClientApp/src/pages/de/[...slug].astro
similarity index 100%
rename from ClientApp/src/pages/de/[...slug].astro
rename to Source/SuperOffice.DocsNext/ClientApp/src/pages/de/[...slug].astro
diff --git a/ClientApp/src/pages/de/[...subcategory].astro b/Source/SuperOffice.DocsNext/ClientApp/src/pages/de/[...subcategory].astro
similarity index 100%
rename from ClientApp/src/pages/de/[...subcategory].astro
rename to Source/SuperOffice.DocsNext/ClientApp/src/pages/de/[...subcategory].astro
diff --git a/ClientApp/src/pages/de/[category].astro b/Source/SuperOffice.DocsNext/ClientApp/src/pages/de/[category].astro
similarity index 100%
rename from ClientApp/src/pages/de/[category].astro
rename to Source/SuperOffice.DocsNext/ClientApp/src/pages/de/[category].astro
diff --git a/ClientApp/src/pages/en/[...category].astro b/Source/SuperOffice.DocsNext/ClientApp/src/pages/en/[...category].astro
similarity index 100%
rename from ClientApp/src/pages/en/[...category].astro
rename to Source/SuperOffice.DocsNext/ClientApp/src/pages/en/[...category].astro
diff --git a/ClientApp/src/pages/en/[...slug].astro b/Source/SuperOffice.DocsNext/ClientApp/src/pages/en/[...slug].astro
similarity index 100%
rename from ClientApp/src/pages/en/[...slug].astro
rename to Source/SuperOffice.DocsNext/ClientApp/src/pages/en/[...slug].astro
diff --git a/ClientApp/src/pages/en/[...subcategory].astro b/Source/SuperOffice.DocsNext/ClientApp/src/pages/en/[...subcategory].astro
similarity index 100%
rename from ClientApp/src/pages/en/[...subcategory].astro
rename to Source/SuperOffice.DocsNext/ClientApp/src/pages/en/[...subcategory].astro
diff --git a/ClientApp/src/pages/en/api/[...slug].astro b/Source/SuperOffice.DocsNext/ClientApp/src/pages/en/api/[...slug].astro
similarity index 100%
rename from ClientApp/src/pages/en/api/[...slug].astro
rename to Source/SuperOffice.DocsNext/ClientApp/src/pages/en/api/[...slug].astro
diff --git a/ClientApp/src/pages/en/api/reference/[...slug].astro b/Source/SuperOffice.DocsNext/ClientApp/src/pages/en/api/reference/[...mdslug].astro
similarity index 97%
rename from ClientApp/src/pages/en/api/reference/[...slug].astro
rename to Source/SuperOffice.DocsNext/ClientApp/src/pages/en/api/reference/[...mdslug].astro
index 09b24098..f553f1c1 100644
--- a/ClientApp/src/pages/en/api/reference/[...slug].astro
+++ b/Source/SuperOffice.DocsNext/ClientApp/src/pages/en/api/reference/[...mdslug].astro
@@ -26,11 +26,12 @@ export async function getStaticPaths() {
return async () => {
const rawContent = await readFile(filePath, "utf8");
const { data, content } = matter(rawContent);
- // Create a more complete entry object that matches content collection structure
+
const relativePath = filePath.replace(
"external-content/superoffice-docs/docs/",
""
);
+
const slug = relativePath.replace(/\.(md|mdx)$/, "");
const { html, headings } = await renderMarkdownWithHeadingIds(content);
@@ -103,7 +104,7 @@ export async function getStaticPaths() {
}
return {
- params: { slug: slug },
+ params: { mdslug: slug },
props: {
loadEntry: loadMarkdownContent(absoluteFilePath),
loadTocData: tocLoaderCache.get(apiType)!,
diff --git a/Source/SuperOffice.DocsNext/ClientApp/src/pages/en/api/reference/[...yamlslug].astro b/Source/SuperOffice.DocsNext/ClientApp/src/pages/en/api/reference/[...yamlslug].astro
new file mode 100644
index 00000000..c3579c29
--- /dev/null
+++ b/Source/SuperOffice.DocsNext/ClientApp/src/pages/en/api/reference/[...yamlslug].astro
@@ -0,0 +1,122 @@
+---
+import { readFile } from "fs/promises";
+import { glob } from "glob";
+import path from "path";
+import yaml from "js-yaml";
+import { getTocByPath } from "@utils/tocUtils";
+import { getYamlReferenceSlug } from "@utils/slugUtils";
+import YamlLayoutPage from "@layouts/YamlLayoutPage.astro";
+import type { TocData } from "~/types/TableOfContentTypes";
+
+export async function getStaticPaths() {
+
+ const apiOnly = process.env.API_ONLY === 'true';
+
+ if (!apiOnly) {
+ return [];
+ }
+
+
+ const baseContentPath = "external-content";
+
+ const apiCollections = [
+ "webapi",
+ "web",
+ "netserver/core",
+ "netserver/services",
+ ];
+
+ // Lazy loader for YAML entry
+ function loadYamlContent(filePath: string, collection: string) {
+ return async () => {
+ const rawContent = await readFile(filePath, "utf8");
+ const parsedYAMLData = yaml.load(rawContent);
+ return {
+ data: parsedYAMLData,
+ filePath,
+ id: getYamlReferenceSlug(filePath, collection),
+ collection,
+ };
+ };
+ }
+
+ // Lazy loader for TOC
+ function loadTocData(apiPath: string) {
+ return async () => {
+ try {
+ return await getTocByPath(apiPath);
+ } catch (error) {
+ console.warn(`Failed to load TOC for ${apiPath}`, error);
+ return { items: [] } as TocData;
+ }
+ };
+ }
+
+ function getApiType(path:string):string{
+ if(path.startsWith("netserver")){
+ return path
+ }
+ else{
+ return path.split("/")[0]
+ }
+ }
+
+ try {
+ const patterns = apiCollections.map(
+ (c) => `superoffice-docs/docs/en/api/reference/${c}/*.{yaml,yml}`
+ );
+
+ const filePaths = await glob(patterns, {
+ cwd: baseContentPath,
+ absolute: false,
+ });
+
+ if (filePaths.length === 0) {
+ console.error("No YAML files found under reference path!");
+ return [];
+ }
+
+ const tocLoaderCache = new Map
Promise>();
+
+ const paths = filePaths.map((relativePath) => {
+ const absoluteFilePath = path.resolve(baseContentPath, relativePath);
+ const normalizedPath = relativePath.replace(/\\/g, "/");
+ const match = normalizedPath.match(
+ /superoffice-docs\/docs\/en\/api\/reference\/([^/]+(?:\/[^/]+)?)/
+ );
+
+ const apiType = getApiType(match ? match[1] : "unknown");
+ const cleanPath = normalizedPath
+ .replace("superoffice-docs/docs/en/api/reference", "")
+ .replace(/\.(yml|yaml)$/, "");
+ const slug = cleanPath;
+ const tocCollectionPath = `superoffice-docs/docs/en/api/reference/${apiType}`;
+
+ if (!tocLoaderCache.has(apiType)) {
+ tocLoaderCache.set(apiType, loadTocData(tocCollectionPath));
+ }
+
+ return {
+ params: { yamlslug: slug },
+ props: {
+ loadEntry: loadYamlContent(absoluteFilePath, apiType),
+ loadTocData: tocLoaderCache.get(apiType)!,
+ collection: apiType,
+ },
+ };
+ });
+
+ return paths;
+ } catch (error) {
+ console.error("Error in getStaticPaths for YAML:", error);
+ return [];
+ }
+}
+
+const { loadEntry, loadTocData, collection } = Astro.props;
+
+const entry = await loadEntry();
+const tocData = await loadTocData();
+---
+
+
diff --git a/ClientApp/src/pages/en/automation/crmscript/[...slug].astro b/Source/SuperOffice.DocsNext/ClientApp/src/pages/en/automation/crmscript/[...slug].astro
similarity index 100%
rename from ClientApp/src/pages/en/automation/crmscript/[...slug].astro
rename to Source/SuperOffice.DocsNext/ClientApp/src/pages/en/automation/crmscript/[...slug].astro
diff --git a/ClientApp/src/pages/en/automation/netserver-scripting/[...slug].astro b/Source/SuperOffice.DocsNext/ClientApp/src/pages/en/automation/netserver-scripting/[...slug].astro
similarity index 100%
rename from ClientApp/src/pages/en/automation/netserver-scripting/[...slug].astro
rename to Source/SuperOffice.DocsNext/ClientApp/src/pages/en/automation/netserver-scripting/[...slug].astro
diff --git a/ClientApp/src/pages/index.astro b/Source/SuperOffice.DocsNext/ClientApp/src/pages/index.astro
similarity index 100%
rename from ClientApp/src/pages/index.astro
rename to Source/SuperOffice.DocsNext/ClientApp/src/pages/index.astro
diff --git a/ClientApp/src/pages/nl/[...slug].astro b/Source/SuperOffice.DocsNext/ClientApp/src/pages/nl/[...slug].astro
similarity index 100%
rename from ClientApp/src/pages/nl/[...slug].astro
rename to Source/SuperOffice.DocsNext/ClientApp/src/pages/nl/[...slug].astro
diff --git a/ClientApp/src/pages/nl/[...subcategory].astro b/Source/SuperOffice.DocsNext/ClientApp/src/pages/nl/[...subcategory].astro
similarity index 100%
rename from ClientApp/src/pages/nl/[...subcategory].astro
rename to Source/SuperOffice.DocsNext/ClientApp/src/pages/nl/[...subcategory].astro
diff --git a/ClientApp/src/pages/nl/[category].astro b/Source/SuperOffice.DocsNext/ClientApp/src/pages/nl/[category].astro
similarity index 100%
rename from ClientApp/src/pages/nl/[category].astro
rename to Source/SuperOffice.DocsNext/ClientApp/src/pages/nl/[category].astro
diff --git a/ClientApp/src/pages/no/[...slug].astro b/Source/SuperOffice.DocsNext/ClientApp/src/pages/no/[...slug].astro
similarity index 100%
rename from ClientApp/src/pages/no/[...slug].astro
rename to Source/SuperOffice.DocsNext/ClientApp/src/pages/no/[...slug].astro
diff --git a/ClientApp/src/pages/no/[...subcategory].astro b/Source/SuperOffice.DocsNext/ClientApp/src/pages/no/[...subcategory].astro
similarity index 100%
rename from ClientApp/src/pages/no/[...subcategory].astro
rename to Source/SuperOffice.DocsNext/ClientApp/src/pages/no/[...subcategory].astro
diff --git a/ClientApp/src/pages/no/[category].astro b/Source/SuperOffice.DocsNext/ClientApp/src/pages/no/[category].astro
similarity index 100%
rename from ClientApp/src/pages/no/[category].astro
rename to Source/SuperOffice.DocsNext/ClientApp/src/pages/no/[category].astro
diff --git a/ClientApp/src/pages/release-notes/[...slug].astro b/Source/SuperOffice.DocsNext/ClientApp/src/pages/release-notes/[...slug].astro
similarity index 100%
rename from ClientApp/src/pages/release-notes/[...slug].astro
rename to Source/SuperOffice.DocsNext/ClientApp/src/pages/release-notes/[...slug].astro
diff --git a/ClientApp/src/pages/search.astro b/Source/SuperOffice.DocsNext/ClientApp/src/pages/search.astro
similarity index 100%
rename from ClientApp/src/pages/search.astro
rename to Source/SuperOffice.DocsNext/ClientApp/src/pages/search.astro
diff --git a/ClientApp/src/pages/sv/[...slug].astro b/Source/SuperOffice.DocsNext/ClientApp/src/pages/sv/[...slug].astro
similarity index 100%
rename from ClientApp/src/pages/sv/[...slug].astro
rename to Source/SuperOffice.DocsNext/ClientApp/src/pages/sv/[...slug].astro
diff --git a/ClientApp/src/pages/sv/[...subcategory].astro b/Source/SuperOffice.DocsNext/ClientApp/src/pages/sv/[...subcategory].astro
similarity index 100%
rename from ClientApp/src/pages/sv/[...subcategory].astro
rename to Source/SuperOffice.DocsNext/ClientApp/src/pages/sv/[...subcategory].astro
diff --git a/ClientApp/src/pages/sv/[category].astro b/Source/SuperOffice.DocsNext/ClientApp/src/pages/sv/[category].astro
similarity index 100%
rename from ClientApp/src/pages/sv/[category].astro
rename to Source/SuperOffice.DocsNext/ClientApp/src/pages/sv/[category].astro
diff --git a/ClientApp/src/plugins/AddIncludesToMarkdown.js b/Source/SuperOffice.DocsNext/ClientApp/src/plugins/AddIncludesToMarkdown.js
similarity index 100%
rename from ClientApp/src/plugins/AddIncludesToMarkdown.js
rename to Source/SuperOffice.DocsNext/ClientApp/src/plugins/AddIncludesToMarkdown.js
diff --git a/ClientApp/src/plugins/RestyleDirectives.js b/Source/SuperOffice.DocsNext/ClientApp/src/plugins/RestyleDirectives.js
similarity index 100%
rename from ClientApp/src/plugins/RestyleDirectives.js
rename to Source/SuperOffice.DocsNext/ClientApp/src/plugins/RestyleDirectives.js
diff --git a/Source/SuperOffice.DocsNext/ClientApp/src/reuse/code/hello-world.cs b/Source/SuperOffice.DocsNext/ClientApp/src/reuse/code/hello-world.cs
new file mode 100644
index 00000000..495bd1d0
--- /dev/null
+++ b/Source/SuperOffice.DocsNext/ClientApp/src/reuse/code/hello-world.cs
@@ -0,0 +1,4 @@
+// Console.WriteLine("Hello World!");
+
+// string greeting = " Hello World! ";
+// Console.WriteLine($"[{greeting}]");
\ No newline at end of file
diff --git a/ClientApp/src/scripts/getLastUpdatedFromGitHub.js b/Source/SuperOffice.DocsNext/ClientApp/src/scripts/getLastUpdatedFromGitHub.js
similarity index 100%
rename from ClientApp/src/scripts/getLastUpdatedFromGitHub.js
rename to Source/SuperOffice.DocsNext/ClientApp/src/scripts/getLastUpdatedFromGitHub.js
diff --git a/ClientApp/src/styles/IncludeDirectiveStyles.css b/Source/SuperOffice.DocsNext/ClientApp/src/styles/IncludeDirectiveStyles.css
similarity index 100%
rename from ClientApp/src/styles/IncludeDirectiveStyles.css
rename to Source/SuperOffice.DocsNext/ClientApp/src/styles/IncludeDirectiveStyles.css
diff --git a/ClientApp/src/styles/VideoEmbeddingStyles.css b/Source/SuperOffice.DocsNext/ClientApp/src/styles/VideoEmbeddingStyles.css
similarity index 100%
rename from ClientApp/src/styles/VideoEmbeddingStyles.css
rename to Source/SuperOffice.DocsNext/ClientApp/src/styles/VideoEmbeddingStyles.css
diff --git a/ClientApp/src/styles/main.css b/Source/SuperOffice.DocsNext/ClientApp/src/styles/main.css
similarity index 100%
rename from ClientApp/src/styles/main.css
rename to Source/SuperOffice.DocsNext/ClientApp/src/styles/main.css
diff --git a/ClientApp/src/styles/pagefind/customPagefindStyles.css b/Source/SuperOffice.DocsNext/ClientApp/src/styles/pagefind/customPagefindStyles.css
similarity index 100%
rename from ClientApp/src/styles/pagefind/customPagefindStyles.css
rename to Source/SuperOffice.DocsNext/ClientApp/src/styles/pagefind/customPagefindStyles.css
diff --git a/ClientApp/src/styles/pagefind/ui.css b/Source/SuperOffice.DocsNext/ClientApp/src/styles/pagefind/ui.css
similarity index 100%
rename from ClientApp/src/styles/pagefind/ui.css
rename to Source/SuperOffice.DocsNext/ClientApp/src/styles/pagefind/ui.css
diff --git a/ClientApp/src/types/CategoryPageTypes.ts b/Source/SuperOffice.DocsNext/ClientApp/src/types/CategoryPageTypes.ts
similarity index 100%
rename from ClientApp/src/types/CategoryPageTypes.ts
rename to Source/SuperOffice.DocsNext/ClientApp/src/types/CategoryPageTypes.ts
diff --git a/ClientApp/src/types/DocsTypes.ts b/Source/SuperOffice.DocsNext/ClientApp/src/types/DocsTypes.ts
similarity index 100%
rename from ClientApp/src/types/DocsTypes.ts
rename to Source/SuperOffice.DocsNext/ClientApp/src/types/DocsTypes.ts
diff --git a/ClientApp/src/types/OnThisArticleTypes.ts b/Source/SuperOffice.DocsNext/ClientApp/src/types/OnThisArticleTypes.ts
similarity index 100%
rename from ClientApp/src/types/OnThisArticleTypes.ts
rename to Source/SuperOffice.DocsNext/ClientApp/src/types/OnThisArticleTypes.ts
diff --git a/ClientApp/src/types/SubCategoryPageTypes.ts b/Source/SuperOffice.DocsNext/ClientApp/src/types/SubCategoryPageTypes.ts
similarity index 100%
rename from ClientApp/src/types/SubCategoryPageTypes.ts
rename to Source/SuperOffice.DocsNext/ClientApp/src/types/SubCategoryPageTypes.ts
diff --git a/ClientApp/src/types/TableOfContentTypes.ts b/Source/SuperOffice.DocsNext/ClientApp/src/types/TableOfContentTypes.ts
similarity index 100%
rename from ClientApp/src/types/TableOfContentTypes.ts
rename to Source/SuperOffice.DocsNext/ClientApp/src/types/TableOfContentTypes.ts
diff --git a/ClientApp/src/types/WebAPITypes.ts b/Source/SuperOffice.DocsNext/ClientApp/src/types/WebAPITypes.ts
similarity index 100%
rename from ClientApp/src/types/WebAPITypes.ts
rename to Source/SuperOffice.DocsNext/ClientApp/src/types/WebAPITypes.ts
diff --git a/ClientApp/src/types/YamlManagedReferencesLayoutTypes.ts b/Source/SuperOffice.DocsNext/ClientApp/src/types/YamlManagedReferencesLayoutTypes.ts
similarity index 100%
rename from ClientApp/src/types/YamlManagedReferencesLayoutTypes.ts
rename to Source/SuperOffice.DocsNext/ClientApp/src/types/YamlManagedReferencesLayoutTypes.ts
diff --git a/ClientApp/src/types/YamlManagedReferencesTypes.ts b/Source/SuperOffice.DocsNext/ClientApp/src/types/YamlManagedReferencesTypes.ts
similarity index 100%
rename from ClientApp/src/types/YamlManagedReferencesTypes.ts
rename to Source/SuperOffice.DocsNext/ClientApp/src/types/YamlManagedReferencesTypes.ts
diff --git a/ClientApp/src/types/pagefind-default-ui.d.ts b/Source/SuperOffice.DocsNext/ClientApp/src/types/pagefind-default-ui.d.ts
similarity index 100%
rename from ClientApp/src/types/pagefind-default-ui.d.ts
rename to Source/SuperOffice.DocsNext/ClientApp/src/types/pagefind-default-ui.d.ts
diff --git a/ClientApp/src/types/pagefind.d.ts b/Source/SuperOffice.DocsNext/ClientApp/src/types/pagefind.d.ts
similarity index 100%
rename from ClientApp/src/types/pagefind.d.ts
rename to Source/SuperOffice.DocsNext/ClientApp/src/types/pagefind.d.ts
diff --git a/ClientApp/src/utils/contentUtils.ts b/Source/SuperOffice.DocsNext/ClientApp/src/utils/contentUtils.ts
similarity index 100%
rename from ClientApp/src/utils/contentUtils.ts
rename to Source/SuperOffice.DocsNext/ClientApp/src/utils/contentUtils.ts
diff --git a/ClientApp/src/utils/headerUtils.ts b/Source/SuperOffice.DocsNext/ClientApp/src/utils/headerUtils.ts
similarity index 100%
rename from ClientApp/src/utils/headerUtils.ts
rename to Source/SuperOffice.DocsNext/ClientApp/src/utils/headerUtils.ts
diff --git a/ClientApp/src/utils/slugUtils.ts b/Source/SuperOffice.DocsNext/ClientApp/src/utils/slugUtils.ts
similarity index 98%
rename from ClientApp/src/utils/slugUtils.ts
rename to Source/SuperOffice.DocsNext/ClientApp/src/utils/slugUtils.ts
index 2cbf164f..18de7081 100644
--- a/ClientApp/src/utils/slugUtils.ts
+++ b/Source/SuperOffice.DocsNext/ClientApp/src/utils/slugUtils.ts
@@ -108,7 +108,7 @@ export function getYamlReferenceSlug(
): string {
const basePath = `superoffice-docs/docs/en/api/reference` as const;
- return stripFilePathAndExtension(filePath, `${basePath}/${api}`);
+ return stripFilePathAndExtension(filePath, `${basePath}`);
}
/**
diff --git a/ClientApp/src/utils/tocUtils.ts b/Source/SuperOffice.DocsNext/ClientApp/src/utils/tocUtils.ts
similarity index 99%
rename from ClientApp/src/utils/tocUtils.ts
rename to Source/SuperOffice.DocsNext/ClientApp/src/utils/tocUtils.ts
index 9a457e79..e9c6daae 100644
--- a/ClientApp/src/utils/tocUtils.ts
+++ b/Source/SuperOffice.DocsNext/ClientApp/src/utils/tocUtils.ts
@@ -52,7 +52,7 @@ export async function getTableOfContentsFromCollection(
// Recursively resolve nested toc.yml references
function resolveItems(items: any[], currentDir = rootCollectionName): any[] {
for (const item of items) {
- const href = item.href;
+ const href = item?.href;
if (href && isNestedTocFile(href)) {
const resolved = path.posix.normalize(path.posix.join(currentDir, href));
const subId = normalizePath(resolved);
diff --git a/Source/SuperOffice.DocsNext/ClientApp/src/utils/transformXref.ts b/Source/SuperOffice.DocsNext/ClientApp/src/utils/transformXref.ts
new file mode 100644
index 00000000..d0fa520b
--- /dev/null
+++ b/Source/SuperOffice.DocsNext/ClientApp/src/utils/transformXref.ts
@@ -0,0 +1,10 @@
+export function transformXref(html: string) {
+ return html?.replace(
+ /]*><\/xref>/g,
+ (_match, href) => {
+ const segments = href?.split(".");
+ const linkText = segments[segments?.length - 1];
+ return `${linkText}`;
+ }
+ );
+}
diff --git a/ClientApp/tailwind.config.mjs b/Source/SuperOffice.DocsNext/ClientApp/tailwind.config.mjs
similarity index 100%
rename from ClientApp/tailwind.config.mjs
rename to Source/SuperOffice.DocsNext/ClientApp/tailwind.config.mjs
diff --git a/ClientApp/tsconfig.json b/Source/SuperOffice.DocsNext/ClientApp/tsconfig.json
similarity index 100%
rename from ClientApp/tsconfig.json
rename to Source/SuperOffice.DocsNext/ClientApp/tsconfig.json
diff --git a/Server/Controllers/Health.cs b/Source/SuperOffice.DocsNext/Controllers/Health.cs
similarity index 100%
rename from Server/Controllers/Health.cs
rename to Source/SuperOffice.DocsNext/Controllers/Health.cs
diff --git a/Server/Program.cs b/Source/SuperOffice.DocsNext/Program.cs
similarity index 96%
rename from Server/Program.cs
rename to Source/SuperOffice.DocsNext/Program.cs
index f6c0a500..53d3228d 100644
--- a/Server/Program.cs
+++ b/Source/SuperOffice.DocsNext/Program.cs
@@ -22,7 +22,7 @@
{
spaApp.UseSpa(spa =>
{
- spa.Options.SourcePath = "../ClientApp";
+ spa.Options.SourcePath = "/ClientApp";
spa.UseProxyToSpaDevelopmentServer("http://localhost:4321");
});
});
diff --git a/Server/Properties/launchSettings.json b/Source/SuperOffice.DocsNext/Properties/launchSettings.json
similarity index 100%
rename from Server/Properties/launchSettings.json
rename to Source/SuperOffice.DocsNext/Properties/launchSettings.json
diff --git a/Server/Server.http b/Source/SuperOffice.DocsNext/Server.http
similarity index 100%
rename from Server/Server.http
rename to Source/SuperOffice.DocsNext/Server.http
diff --git a/Server/Server.csproj b/Source/SuperOffice.DocsNext/SuperOffice.DocsNext.csproj
similarity index 75%
rename from Server/Server.csproj
rename to Source/SuperOffice.DocsNext/SuperOffice.DocsNext.csproj
index fbb5bd8b..11597917 100644
--- a/Server/Server.csproj
+++ b/Source/SuperOffice.DocsNext/SuperOffice.DocsNext.csproj
@@ -6,9 +6,9 @@
enable
- $(MSBuildThisFileDirectory)..\ClientApp\
- $(ClientAppDir)dist\
- wwwroot\
+ $(MSBuildThisFileDirectory)ClientApp/
+ $(ClientAppDir)dist/
+ wwwroot/
@@ -16,6 +16,13 @@
+
+
+
+
+
+
+
diff --git a/Server/Server.csproj.user b/Source/SuperOffice.DocsNext/SuperOffice.DocsNext.csproj.user
similarity index 100%
rename from Server/Server.csproj.user
rename to Source/SuperOffice.DocsNext/SuperOffice.DocsNext.csproj.user
diff --git a/Server/appsettings.Development.json b/Source/SuperOffice.DocsNext/appsettings.Development.json
similarity index 100%
rename from Server/appsettings.Development.json
rename to Source/SuperOffice.DocsNext/appsettings.Development.json
diff --git a/Server/appsettings.json b/Source/SuperOffice.DocsNext/appsettings.json
similarity index 100%
rename from Server/appsettings.json
rename to Source/SuperOffice.DocsNext/appsettings.json
diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml
new file mode 100644
index 00000000..1a6bcd1b
--- /dev/null
+++ b/build/azure-pipelines.yml
@@ -0,0 +1,94 @@
+trigger:
+ branches:
+ include:
+ - main
+ - release
+
+pr:
+ branches:
+ include:
+ - main
+
+variables:
+- name: DOTNET_VERSION
+ value: '8'
+
+resources:
+ repositories:
+ - repository: self
+ type: git
+ ref: main
+
+stages:
+ - stage: Build
+ displayName: "Build and Package"
+ jobs:
+ - job: Build
+ timeoutInMinutes: "120"
+ displayName: "Build .NET + Astro frontend"
+ pool:
+ name: Default
+ demands:
+ # - agent.os -equals Linux
+ - Agent.ComputerName -equals tfs-build-23
+ steps:
+ # Checkout your main repo
+ - checkout: self
+
+ # Checkout external repos
+ - script: |
+ git clone https://github.com/SuperOfficeDocs/contribution.git Source/SuperOffice.DocsNext/ClientApp/external-content/contribution
+ git clone https://github.com/SuperOfficeDocs/superoffice-docs.git Source/SuperOffice.DocsNext/ClientApp/external-content/superoffice-docs
+ displayName: "Clone external GitHub repos"
+
+ # Install .NET SDK
+ - task: UseDotNet@2
+ inputs:
+ version: '$(DOTNET_VERSION).0.x'
+
+ # Install Node.js
+ - task: NodeTool@0
+ inputs:
+ versionSpec: "22.x"
+
+ # Build & publish the .NET project (includes front-end build if wired in MSBuild targets)
+ - script: |
+ cd Source/SuperOffice.DocsNext
+ dotnet publish -c Release -o $(Build.ArtifactStagingDirectory)/out
+ displayName: "Publish .NET & Astro project"
+
+ # Zip the published output
+ - task: ArchiveFiles@2
+ inputs:
+ rootFolderOrFile: "$(Build.ArtifactStagingDirectory)/out"
+ includeRootFolder: false
+ archiveFile: "$(Build.ArtifactStagingDirectory)/app.zip"
+ replaceExistingArchive: true
+
+ # Publish the zip as a pipeline artifact
+ - publish: $(Build.ArtifactStagingDirectory)/app.zip
+ artifact: docs-next-artifact
+
+ - template: deploy-env.template.yml
+ parameters:
+ environment: "dev"
+ dependsOn: ["Build"]
+ azureResourceManagerConnection: "online-docs-dev"
+ isEnabled: "or(
+ eq(variables['Build.SourceBranch'], 'refs/heads/main'),
+ eq(variables['Build.Reason'], 'Manual')
+ )"
+
+ - template: deploy-env.template.yml
+ parameters:
+ environment: "stage"
+ dependsOn: ["Build"]
+ azureResourceManagerConnection: "online-docs-stage"
+ isEnabled: "eq(variables['Build.SourceBranch'], 'refs/heads/release')"
+
+ - template: deploy-env.template.yml
+ parameters:
+ environment: "prod"
+ dependsOn: ['Build','stage']
+ azureResourceManagerConnection: "online-docs-prod"
+ isEnabled: "eq(variables['Build.SourceBranch'], 'refs/heads/release')"
diff --git a/build/deploy-env.template.yml b/build/deploy-env.template.yml
new file mode 100644
index 00000000..116d7111
--- /dev/null
+++ b/build/deploy-env.template.yml
@@ -0,0 +1,63 @@
+parameters:
+ - name: environment
+ default: ""
+ - name: dependsOn
+ type: object
+ default: []
+ - name: azureResourceManagerConnection
+ default: ""
+ - name: isEnabled
+ default: "false"
+
+stages:
+ - stage: ${{ parameters.environment }}
+ dependsOn: ${{ parameters.dependsOn }}
+ variables:
+ - name: resourceGroupName
+ value: ${{ format('rg-DocsNext-{0}', parameters.environment) }}
+ condition: and(succeeded(), eq(${{ parameters.isEnabled }}, true))
+
+ jobs:
+ - deployment: DeployArmAndApps
+ workspace:
+ clean: all
+ # variables:
+ # - group: ${{ format('Docs Deployment {0}', parameters.environment) }}
+ environment: ${{ format('docs-{0}', parameters.environment) }}
+ strategy:
+ runOnce:
+ deploy:
+ steps:
+ - checkout: self
+ - download: none # By default deploy jobs download all artifacts. Stop this to avoid downloading of published code coverage artifact
+
+ - task: DownloadPipelineArtifact@2
+ inputs:
+ artifact: "docs-next-artifact"
+ path: "$(Pipeline.Workspace)/docs-next-artifact"
+
+ - task: UseDotNet@2
+ inputs:
+ version: "$(DOTNET_VERSION).0.x"
+
+ - task: NuGetAuthenticate@1
+
+ - task: AzurePowerShell@5
+ name: DeployInfrastructure
+ displayName: "Run Deployment Script"
+ inputs:
+ azureSubscription: "${{ parameters.azureResourceManagerConnection }}"
+ ScriptPath: "$(Build.SourcesDirectory)/Source/SuperOffice.DocsNext.BicepTemplate/Deploy.ps1"
+ ScriptArguments: >
+ -Environment ${{ parameters.environment }}
+ -DotNetVersion $(DOTNET_VERSION)
+ azurePowerShellVersion: latestVersion
+ pwsh: true
+
+ - task: AzureWebApp@1
+ displayName: "Deploy ZIP to Azure Web App"
+ inputs:
+ azureSubscription: "${{ parameters.azureResourceManagerConnection }}"
+ appName: "$(DeployInfrastructure.WebAppName)"
+ package: "$(Pipeline.Workspace)/docs-next-artifact/app.zip"
+ appType: "webAppLinux"