diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 854d820479c..55024789b2d 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -146,6 +146,27 @@ jobs: else echo "Archived documentation already noindexed; nothing to commit." fi + - name: Publish root 404 page + # Missing URLs currently hit Apache httpd's default Not Found page. + # Copy a standalone page (not generated by MkDocs) to the site root + # and set ErrorDocument so visitors actually see it. See GH-2426. + if: ${{ github.event_name != 'pull_request' && github.repository == 'apache/sedona' }} + run: | + if [[ ! -d website-branch ]]; then + git fetch origin website --depth=1 + git worktree add website-branch FETCH_HEAD + fi + git -C website-branch config user.name "github-actions[bot]" + git -C website-branch config user.email "41898282+github-actions[bot]@users.noreply.github.com" + cp docs-overrides/root-404.html website-branch/404.html + cp docs-overrides/htaccess-root website-branch/.htaccess + git -C website-branch add 404.html .htaccess + if [[ -n "$(git -C website-branch status --porcelain)" ]]; then + git -C website-branch commit -m "Publish branded 404 page at the site root" + git -C website-branch push origin HEAD:website + else + echo "Root 404 page already current; nothing to commit." + fi - run: mkdir staging - run: cp -r site/* staging/ - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 diff --git a/docs-overrides/htaccess-root b/docs-overrides/htaccess-root new file mode 100644 index 00000000000..d1b2495527f --- /dev/null +++ b/docs-overrides/htaccess-root @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +ErrorDocument 404 /404.html diff --git a/docs-overrides/root-404.html b/docs-overrides/root-404.html new file mode 100644 index 00000000000..26d1f69aae2 --- /dev/null +++ b/docs-overrides/root-404.html @@ -0,0 +1,94 @@ + + + + + + + + Page not found – Apache Sedona + + + +
+

Page not found

+

+ This URL is not part of the Apache Sedona documentation. + Try the home page, or jump to SedonaSpark or SedonaDB. +

+ +
+ + +