为预览站点添加提示信息 (#319)

Co-authored-by: Burning_TNT <pangyl08@163.com>
This commit is contained in:
neveler 2025-11-02 22:32:42 +08:00 committed by GitHub
parent c852e380d8
commit 70ba60e045
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 1 deletions

View File

@ -210,6 +210,8 @@ jobs:
echo "baseurl: ${{ needs.preview-create-init.outputs.pathname }}/PR${{ env.GITHUB_PR_NUMBER }}" >> _action.yml
echo "source: ${{ github.workspace }}" >> _action.yml
echo "destination: /home/runner/site" >> _action.yml
echo "preview:" >> _action.yml
echo " pr-number: ${{ env.GITHUB_PR_NUMBER }}" >> _action.yml
bundle exec jekyll build --config _config.yml,_action.yml
- id: upload-site
name: Upload Site

View File

@ -11,6 +11,10 @@ layout: compress
</head>
<body class="layout--{{ page.layout | default: layout.layout }}{% if page.classes or layout.classes %}{{ page.classes | default: layout.classes | join: ' ' | prepend: ' ' }}{% endif %}" dir="{% if site.rtl %}rtl{% else %}ltr{% endif %}">
{% if site.preview and site.preview.pr-number %}
<div class="notice--warning text-center m0">当前站点为预览构建而非官方文档,如需反馈问题请前往 <a href="https://github.com/HMCL-dev/HMCL-docs/pull/{{ site.preview.pr-number }}">#{{ site.preview.pr-number }}</a> 反馈。</div>
{% endif %}
{% include_cached skip-links.html %}
{% include_cached masthead.html %}
@ -34,4 +38,4 @@ layout: compress
{% include scripts.html %}
</body>
</html>
</html>

View File

@ -10,3 +10,7 @@ a, span, code, kbd, pre, em, strong, b, i {
word-wrap: break-word;
word-break: break-word;
}
.m0 {
margin: 0 !important;
}