Skip to content

docs: customize the 404 not found page#333

Draft
Snoopy1866 wants to merge 2 commits into
mainfrom
docs-404
Draft

docs: customize the 404 not found page#333
Snoopy1866 wants to merge 2 commits into
mainfrom
docs-404

Conversation

@Snoopy1866
Copy link
Copy Markdown
Owner

No description provided.

@Snoopy1866 Snoopy1866 changed the title docs: customize 404 not found page docs: customize the 404 not found page May 11, 2026
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label May 11, 2026
@read-the-docs-community
Copy link
Copy Markdown

read-the-docs-community Bot commented May 11, 2026

Documentation build overview

📚 pystatpower | 🛠️ Build #32629429 | 📁 Comparing e1170b7 against latest (d07db52)

  🔍 Preview build  

2 files changed
+ overrides/404.html
± 404.html

@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (d07db52) to head (e1170b7).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #333   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           16        16           
  Lines          580       580           
=========================================
  Hits           580       580           
Flag Coverage Δ
test-core-macos-latest-py3.10 100.00% <ø> (ø)
test-core-macos-latest-py3.11 100.00% <ø> (ø)
test-core-macos-latest-py3.12 100.00% <ø> (ø)
test-core-macos-latest-py3.13 100.00% <ø> (ø)
test-core-macos-latest-py3.14 100.00% <ø> (ø)
test-core-ubuntu-latest-py3.10 100.00% <ø> (ø)
test-core-ubuntu-latest-py3.11 100.00% <ø> (ø)
test-core-ubuntu-latest-py3.12 100.00% <ø> (ø)
test-core-ubuntu-latest-py3.13 100.00% <ø> (ø)
test-core-ubuntu-latest-py3.14 100.00% <ø> (ø)
test-core-windows-latest-py3.10 100.00% <ø> (ø)
test-core-windows-latest-py3.11 100.00% <ø> (ø)
test-core-windows-latest-py3.12 100.00% <ø> (ø)
test-core-windows-latest-py3.13 100.00% <ø> (ø)
test-core-windows-latest-py3.14 100.00% <ø> (ø)
test-minimum-scipy-ubuntu-latest-py3.10-scipy1.7.2 100.00% <ø> (ø)
test-minimum-scipy-ubuntu-latest-py3.11-scipy1.10.1 100.00% <ø> (ø)
test-minimum-scipy-ubuntu-latest-py3.12-scipy1.11.3 100.00% <ø> (ø)
test-minimum-scipy-ubuntu-latest-py3.13-scipy1.15.0 100.00% <ø> (ø)
test-minimum-scipy-ubuntu-latest-py3.14-scipy1.16.1 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a custom 404 error page with a statistical theme and updates the configuration to enable template overrides. The review feedback suggests using theme-specific CSS variables for font consistency, utilizing the MkDocs url filter for better environment compatibility in links, and avoiding the use of !important in CSS to ensure better maintainability.

Comment thread docs/overrides/404.html
Comment thread docs/overrides/404.html
</div>

<a
href="{{ config.site_url | default(base_url ~ '/../') }}"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using config.site_url for the home link can lead to issues in local development or staging environments, as it typically points to the production URL. It is recommended to use the MkDocs url filter, which correctly handles relative paths across different deployment environments and ensures the link works correctly during local preview (mkdocs serve).

      href="{{ 'index.html' | url }}"

Comment thread docs/overrides/404.html
Comment on lines +64 to +71
[data-md-component="content"] {
margin-left: 0 !important;
width: 100% !important;
}
.md-sidebar--primary,
.md-sidebar--secondary {
display: none !important;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The use of !important to override layout styles (like margin-left and width) is generally discouraged as it makes the CSS harder to maintain and can cause issues with future theme updates. Since the sidebars are already emptied via Jinja2 blocks (left_sidebar and right_sidebar), the layout should naturally adjust. Consider using more specific selectors or checking if the theme's default layout can achieve the same centering without forced overrides.

@Snoopy1866 Snoopy1866 marked this pull request as draft May 11, 2026 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant