Skip to content
Draft
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
77 changes: 77 additions & 0 deletions docs/overrides/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{% extends "main.html" %} {% block left_sidebar %} {% endblock %} {% block
right_sidebar %} {% endblock %} {% block content %}
<div class="md-content" style="text-align: center; margin: 4rem auto">
<article class="md-content__inner md-typeset">
<div style="margin-bottom: 2rem">
<span
style="
font-size: 6rem;
font-weight: 700;
opacity: 0.1;
line-height: 1;
display: block;
font-family: &quot;JetBrains Mono&quot;, monospace;
Comment thread
Snoopy1866 marked this conversation as resolved.
"
>404</span
>
<h1
style="
margin-top: -2.5rem;
border-bottom: none;
color: var(--md-primary-fg-color);
"
>
此页面处于“不可观察”状态
</h1>
</div>

<div
style="
max-width: 32rem;
margin: 0 auto;
color: var(--md-default-fg-color--light);
"
>
<p style="font-size: 1.1rem; line-height: 1.8">
正如一个未定义的模型,你所寻找的参数已经由于显著性不足而被剔除。
</p>

<p style="font-style: italic; opacity: 0.8; margin: 1.5rem 0">
该页面当前的 p-value 远大于 0.05,<br />我们无法拒绝“它不存在”这一虚无假设。
</p>

<div style="font-size: 3rem; margin: 2rem 0; filter: grayscale(0.5)">
🍃
</div>
</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 }}"

class="md-button md-button--primary"
style="
border-radius: 100px;
padding: 0.6rem 2.5rem;
text-decoration: none;
"
>
重置观察位
</a>
</article>
</div>

<style>
/* 适配 Zensical 的居中逻辑 */
[data-md-component="content"] {
margin-left: 0 !important;
width: 100% !important;
}
.md-sidebar--primary,
.md-sidebar--secondary {
display: none !important;
}
Comment on lines +64 to +71

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.

/* 确保公式美观 */
.md-typeset p {
margin-bottom: 1em;
}
</style>
{% endblock %}
6 changes: 6 additions & 0 deletions zensical.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ features = [
"search.highlight",
"header.autohide"
]
custom_dir = "docs/overrides"

[project.extra]
alternate = [
{ name = "Chinese", link = "/zh-cn/", lang = "zh" }
]

# Palette toggle for automatic mode
[[project.theme.palette]]
Expand Down