Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,32 @@ jobs:
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Install DocFX
run: dotnet tool install -g docfx
- name: Initial static JSON schema submodule
run: git submodule update --init ./src/Helldivers-2-Models/json
- name: Generate OpenAPI JSON files
run: dotnet build -c Debug
- name: Rename Swagger HTML file to index
run: mv src/Helldivers-2-API/wwwroot/swagger-ui.html src/Helldivers-2-API/wwwroot/index.html
- name: Upload OpenAPI artifact
- name: Generate DocFX metadata
run: docfx metadata
- name: Generate DocFX site
run: docfx build docfx.json
- name: Upload DocFX website
uses: actions/upload-artifact@master
with:
name: 'OpenAPI-artifact'
path: './src/Helldivers-2-API/wwwroot'
name: 'docfx'
path: './_site/'
deploy:
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Download generated OpenAPI files
- name: Download DocFX website
uses: actions/download-artifact@master
with:
name: 'OpenAPI-artifact'
name: 'docfx'
path: '.'
- name: Setup Pages
uses: actions/configure-pages@v4
Expand Down
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -363,4 +363,11 @@ MigrationBackup/
FodyWeavers.xsd

# Jetbrains generated folders
.idea/
.idea/

# DocFX generates files
_site/
api/

# Ignore OpenAPI documents
docs/openapi/*.json
1 change: 1 addition & 0 deletions Helldivers-2.sln
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
Directory.Build.props = Directory.Build.props
fly.toml = fly.toml
.dockerignore = .dockerignore
docfx.json = docfx.json
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Helldivers-2-Models", "src\Helldivers-2-Models\Helldivers-2-Models.csproj", "{9B017849-C756-4B98-9B98-885AEBE9EAD4}"
Expand Down
46 changes: 46 additions & 0 deletions docfx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"metadata": [
{
"src": [
{
"files": [
"**/*.csproj"
]
}
],
"dest": "api"
}
],
"build": {
"content": [
{
"files": [
"**/*.{md,yml}"
],
"exclude": [
"_site/**",
"src/Helldivers-2-Models/json/**"
]
}
],
"resource": [
{
"files": [
"images/**",
"docs/openapi/**"
]
}
],
"output": "_site",
"template": [
"default",
"modern"
],
"globalMetadata": {
"_appName": "Helldivers-2 API",
"_appTitle": "Helldivers-2 API",
"_enableSearch": true,
"pdf": false
}
}
}
1 change: 1 addition & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Getting Started
1 change: 1 addition & 0 deletions docs/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Introduction
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions docs/toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
- name: Introduction
href: introduction.md
- name: Getting Started
href: getting-started.md
- name: SwaggerUI
href: ./openapi/swagger-ui.html
- name: Contributing
href: ../contributing.md
- name: Code of conduct
href: ../CODE_OF_CONDUCT.md
- name: Reporting vulnerabilities
href: ../SECURITY.md
11 changes: 11 additions & 0 deletions index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
_layout: landing
---

# This is the **HOMEPAGE**.

Refer to [Markdown](http://daringfireball.net/projects/markdown/) for how to write markdown files.

## Quick Start Notes:

1. Add images to the *images* folder if the file is referencing an image.
2 changes: 1 addition & 1 deletion src/Helldivers-2-API/Helldivers-2-API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<!-- Only generate OpenAPI docs for DEBUG builds -->
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<OpenApiDocumentsDirectory>$(MSBuildProjectDirectory)/wwwroot</OpenApiDocumentsDirectory>
<OpenApiDocumentsDirectory>$(SolutionDir)/docs/openapi</OpenApiDocumentsDirectory>
<OpenApiGenerateDocuments>true</OpenApiGenerateDocuments>
<OpenApiGenerateDocumentsOnBuild>true</OpenApiGenerateDocumentsOnBuild>
</PropertyGroup>
Expand Down
3 changes: 0 additions & 3 deletions src/Helldivers-2-API/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,6 @@
// Use response compression for smaller payload sizes
app.UseResponseCompression();

// We host our OpenAPI spec and preview files from wwwroot/
app.UseStaticFiles();

// select the correct culture for incoming requests
app.UseRequestLocalization();

Expand Down
Loading