diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 35da5ba3c5..878d6b6969 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -15,6 +15,8 @@ jobs: steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Full history for per-page last-updated dates # We build doxygen from source because of # https://github.com/doxygen/doxygen/issues/9016 @@ -51,7 +53,7 @@ jobs: base-url-path: https://mflowcode.github.io/ path-to-root: build/install/docs/mfc include-pdf: false - sitemap-format: txt + sitemap-format: xml - name: Output stats run: | @@ -59,12 +61,6 @@ jobs: echo "url-count = ${{ steps.sitemap.outputs.url-count }}" echo "excluded-count = ${{ steps.sitemap.outputs.excluded-count }}" - - name: Linkcheck - Lychee - uses: lycheeverse/lychee-action@v2 - with: - args: -c .lychee.toml build/install/docs/mfc/ - fail: false - - name: Publish Documentation if: github.repository == 'MFlowCode/MFC' && github.ref == 'refs/heads/master' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' ) run: | @@ -81,5 +77,11 @@ jobs: git -C ../www commit -m "Docs @ ${GITHUB_SHA::7}" || true git -C ../www push + - name: Linkcheck - Lychee + uses: lycheeverse/lychee-action@v2 + with: + args: -c .lychee.toml build/install/docs/mfc/ + fail: true + # DOC_PUSH_URL should be of the format: # --> https://:@github.com// diff --git a/.lychee.toml b/.lychee.toml index b38b3c1da3..af73051c1c 100644 --- a/.lychee.toml +++ b/.lychee.toml @@ -16,5 +16,11 @@ accept = ["200", "429"] verbose = "error" -# Exclude sitemap from link checking (it contains pre-publish production URLs) -exclude_path = ["**/sitemap.txt"] +# Exclude sitemap file from scanning (it contains pre-publish production URLs) +exclude_path = ["sitemap\\.xml"] + +# Exclude URLs that fail due to external issues (broken SSL, pre-deploy only, etc.) +exclude = [ + "https://mflowcode\\.github\\.io/sitemap\\.xml", # Only exists after deployment + "https://cpe\\.ext\\.hpe\\.com", # HPE Cray docs have broken SSL cert +] diff --git a/CMakeLists.txt b/CMakeLists.txt index 0561b1c39e..33725e1867 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -806,6 +806,25 @@ if (MFC_DOCUMENTATION) GEN_DOCS(post_process "MFC: Post-Process") GEN_DOCS(documentation "MFC") + # Inject per-page last-updated dates into documentation markdown files. + # Runs after auto-generated .md files exist, before Doxygen processes them. + # Uses a stamp file so it only runs once per build. + add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/inject-dates.stamp" + DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/docs/documentation/examples.md" + "${CMAKE_CURRENT_SOURCE_DIR}/docs/documentation/case_constraints.md" + "${CMAKE_CURRENT_SOURCE_DIR}/docs/documentation/physics_constraints.md" + "${CMAKE_CURRENT_SOURCE_DIR}/docs/documentation/cli-reference.md" + "${CMAKE_CURRENT_SOURCE_DIR}/docs/documentation/parameters.md" + COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/docs/inject-dates.py" + "${CMAKE_CURRENT_SOURCE_DIR}" + COMMAND "${CMAKE_COMMAND}" -E touch "${CMAKE_CURRENT_BINARY_DIR}/inject-dates.stamp" + COMMENT "Injecting page dates into documentation" + VERBATIM + ) + add_custom_target(inject_page_dates DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/inject-dates.stamp") + add_dependencies(documentation_doxygen inject_page_dates) + # > Copy Resources (main landing page & assets) install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/docs/res" DESTINATION "docs/mfc") diff --git a/docs/header.html b/docs/header.html index 65a6e3c3dd..a4ac906459 100644 --- a/docs/header.html +++ b/docs/header.html @@ -18,7 +18,8 @@ $projectname: $title $title - + + diff --git a/docs/index.html b/docs/index.html index 2180ce4020..797fa941f3 100644 --- a/docs/index.html +++ b/docs/index.html @@ -23,20 +23,54 @@ +