diff --git a/MultiProjectRepository/publish-csharp-docs.sh b/MultiProjectRepository/publish-csharp-docs.sh index 612028b..db2d4bd 100755 --- a/MultiProjectRepository/publish-csharp-docs.sh +++ b/MultiProjectRepository/publish-csharp-docs.sh @@ -10,6 +10,9 @@ COMMIT_USER_NAME="linksplatform" COMMIT_USER_EMAIL="linksplatformtechnologies@gmail.com" REPOSITORY="github.com/linksplatform/$REPOSITORY_NAME" +# Load DocFX configuration files +../Utils/LoadDocfxFiles.sh . + # Insert repository name into DocFX's configuration files sed -i "s/\$REPOSITORY_NAME/$REPOSITORY_NAME/g" toc.yml sed -i "s/\$REPOSITORY_NAME/$REPOSITORY_NAME/g" docfx.json diff --git a/SingleProjectRepository/publish-docs.sh b/SingleProjectRepository/publish-docs.sh index 8a36fb7..e5bbae6 100755 --- a/SingleProjectRepository/publish-docs.sh +++ b/SingleProjectRepository/publish-docs.sh @@ -10,6 +10,9 @@ COMMIT_USER_NAME="linksplatform" COMMIT_USER_EMAIL="linksplatformtechnologies@gmail.com" REPOSITORY="github.com/linksplatform/$REPOSITORY_NAME" +# Load DocFX configuration files +../Utils/LoadDocfxFiles.sh . + # Insert repository name into DocFX's configuration files sed -i "s/\$REPOSITORY_NAME/$REPOSITORY_NAME/g" toc.yml sed -i "s/\$REPOSITORY_NAME/$REPOSITORY_NAME/g" docfx.json diff --git a/Utils/LoadDocfxFiles.sh b/Utils/LoadDocfxFiles.sh new file mode 100755 index 0000000..b491041 --- /dev/null +++ b/Utils/LoadDocfxFiles.sh @@ -0,0 +1,23 @@ +#!/bin/bash +set -e # Exit with nonzero exit code if anything fails + +# Load docfx configuration files from the Files repository +# Usage: ./LoadDocfxFiles.sh [target_directory] + +TARGET_DIR="${1:-.}" +FILES_REPO_BASE="https://raw.githubusercontent.com/linksplatform/Files/main/docfx" + +echo "Loading docfx files to $TARGET_DIR..." + +# Create target directory if it doesn't exist +mkdir -p "$TARGET_DIR" + +# Download docfx configuration files +curl -s "$FILES_REPO_BASE/docfx.json" -o "$TARGET_DIR/docfx.json" +curl -s "$FILES_REPO_BASE/toc.yml" -o "$TARGET_DIR/toc.yml" +curl -s "$FILES_REPO_BASE/filter.yml" -o "$TARGET_DIR/filter.yml" + +echo "Docfx files loaded successfully:" +echo " - docfx.json" +echo " - toc.yml" +echo " - filter.yml" \ No newline at end of file