diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 9f88e69b..5c234615 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -30,7 +30,23 @@ jobs: chmod +x docfx/docfx - name: Generate documentation - run: ./docfx/docfx docs/docfx.json + env: + REPOSITORY_OWNER: ${{ github.repository_owner }} + REPOSITORY_NAME: ${{ github.event.repository.name }} + run: | + if [ "$REPOSITORY_NAME" = "$REPOSITORY_OWNER.github.io" ]; then + DOCFX_BASE_URL="https://${REPOSITORY_OWNER}.github.io/" + else + DOCFX_BASE_URL="https://${REPOSITORY_OWNER}.github.io/${REPOSITORY_NAME}/" + fi + + jq --arg base "$DOCFX_BASE_URL" \ + '.build.globalMetadata._appBaseUrl = $base' \ + docs/docfx.json > docs/docfx.generated.json + + ./docfx/docfx docs/docfx.generated.json + + rm docs/docfx.generated.json - name: Checkout gh-pages uses: actions/checkout@v4 diff --git a/docs/DiscordIcon.png b/docs/DiscordIcon.png new file mode 100644 index 00000000..957c20be Binary files /dev/null and b/docs/DiscordIcon.png differ diff --git a/docs/docfx.json b/docs/docfx.json index 0875132e..eb3320a0 100644 --- a/docs/docfx.json +++ b/docs/docfx.json @@ -42,6 +42,9 @@ "files": ["**"], "src": "../InscryptionCommunityPatch/Assets", "dest": "resources/community/assets" + }, + { + "files": ["DiscordIcon.png"] } ], "content": [ diff --git a/docs/template/api_wiki/layout/_master.tmpl b/docs/template/api_wiki/layout/_master.tmpl new file mode 100644 index 00000000..045682c3 --- /dev/null +++ b/docs/template/api_wiki/layout/_master.tmpl @@ -0,0 +1,175 @@ +{{!Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license.}} +{{!include(/^public/.*/)}} +{{!include(favicon.ico)}} +{{!include(logo.svg)}} + + + + + {{#redirect_url}} + + {{/redirect_url}} + {{^redirect_url}} + {{#title}}{{title}}{{/title}}{{^title}}{{>partials/title}}{{/title}} {{#_appTitle}}| {{_appTitle}} {{/_appTitle}} + + + {{#_description}}{{/_description}} + {{#description}}{{/description}} + + + + + + {{#_description}}{{/_description}} + {{^_description}}{{#description}}{{/description}}{{/_description}} + + + + + + {{#_description}}{{/_description}} + {{^_description}}{{#description}}{{/description}}{{/_description}} + + + + + + + + {{#_noindex}}{{/_noindex}} + {{#_enableSearch}}{{/_enableSearch}} + {{#_disableNewTab}}{{/_disableNewTab}} + {{#_disableTocFilter}}{{/_disableTocFilter}} + {{#docurl}}{{/docurl}} + + + + + + + + + + + + + + + + + + {{#_googleAnalyticsTagId}} + + + {{/_googleAnalyticsTagId}} + {{/redirect_url}} + + + {{^redirect_url}} + +
+ {{^_disableNavbar}} + + {{/_disableNavbar}} +
+ +
+ {{^_disableToc}} +
+
+
+
Table of Contents
+ +
+
+ +
+
+
+ {{/_disableToc}} + +
+
+ {{^_disableToc}} + + {{/_disableToc}} + + {{^_disableBreadcrumb}} + + {{/_disableBreadcrumb}} +
+ +
+ {{!body}} +
+ + {{^_disableContribution}} +
+ {{#sourceurl}} + {{__global.improveThisDoc}} + {{/sourceurl}} + {{^sourceurl}}{{#docurl}} + {{__global.improveThisDoc}} + {{/docurl}}{{/sourceurl}} +
+ {{/_disableContribution}} + + {{^_disableNextArticle}} + + {{/_disableNextArticle}} + +
+ + {{^_disableAffix}} +
+ +
+ {{/_disableAffix}} +
+ + {{#_enableSearch}} +
+ {{/_enableSearch}} + + + + {{/redirect_url}} + \ No newline at end of file diff --git a/docs/template/api_wiki/partials/head.tmpl.partial b/docs/template/api_wiki/partials/head.tmpl.partial new file mode 100644 index 00000000..62d911c1 --- /dev/null +++ b/docs/template/api_wiki/partials/head.tmpl.partial @@ -0,0 +1,51 @@ + +{{!Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license.}} + + + + {{#_googleAnalyticsTagId}} + + + {{/_googleAnalyticsTagId}} + {{#redirect_url}} + + {{/redirect_url}} + {{^redirect_url}} + + {{#title}}{{title}}{{/title}}{{^title}}{{>partials/title}}{{/title}} {{#_appTitle}}| {{_appTitle}} {{/_appTitle}} + + + {{#_description}}{{/_description}} + {{#description}}{{/description}} + + + + + + {{#_description}}{{/_description}} + {{^_description}}{{#description}}{{/description}}{{/_description}} + + + + + + {{#_description}}{{/_description}} + {{^_description}}{{#description}}{{/description}}{{/_description}} + + + + + + + + + {{#_noindex}}{{/_noindex}} + {{#_enableSearch}}{{/_enableSearch}} + {{#_enableNewTab}}{{/_enableNewTab}} + {{/redirect_url}} +