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
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ _site
.sass-cache
.jekyll-cache
.jekyll-metadata
vendor
/vendor/
Gemfile.lock
.bundle
/.idea/
/.idea/
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"hossaini.bootstrap-intellisense"
]
}
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"bootstrapIntelliSense": {
"enable": true,
"bsVersion": "5.3.5",
"showSuggestions": true,
"autoComplete": true
}
}
3 changes: 2 additions & 1 deletion 404.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
layout: splash
title: 404 页面不存在
layout: default
---

<div class="notice--danger">
Expand Down
5 changes: 1 addition & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,11 @@ source "https://rubygems.org"
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
gem "jekyll", "4.4.1"
gem "minimal-mistakes-jekyll", "4.27.3"

group :jekyll_plugins do
gem "jekyll-paginate", "1.1.0"
gem "jekyll-sitemap", "1.4.0"
gem "jekyll-gist", "1.5.0"
gem "jekyll-feed", "0.17.0"
gem "jekyll-include-cache", "0.2.1"
gem "jekyll-redirect-from", "0.16.0"
end

Expand All @@ -33,4 +30,4 @@ gem "http_parser.rb", "0.8.0", :platforms => [:jruby]

# plugin dependencies
gem "nokogiri", "1.18.10"
gem "addressable", "2.8.7"
gem "bootstrap", "5.3.5"
19 changes: 6 additions & 13 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,13 @@ strict_front_matter: true
plugins:
- jekyll-paginate
- jekyll-sitemap
- jekyll-gist
- jekyll-feed
- jekyll-include-cache
- jekyll-redirect-from
# minimal-mistakes (mimic GitHub Pages with --safe)
whitelist:
- jekyll-paginate
- jekyll-sitemap
- jekyll-gist
- jekyll-feed
- jekyll-include-cache
- jekyll-redirect-from

# Conversion
Expand Down Expand Up @@ -148,9 +144,6 @@ defaults:
# # minimal-mistakes
# enable_coderay: false

# Theme Settings
theme: minimal-mistakes-jekyll

# Site Settings
locale: zh
# rtl:
Expand Down Expand Up @@ -267,12 +260,14 @@ analytics:
footer:
links:
- label: Github
icon: fab fa-fw fa-github
url: https://github.com/HMCL-dev/HMCL
- label: 粤ICP备18071565号
url: https://beian.miit.gov.cn
icon: bi bi-github
url: https://github.com/HMCL-dev/hmcl
# since:

icp:
name: 粤ICP备18071565号
url: https://beian.miit.gov.cn

# minimal-mistakes (with jekyll-paginate-v2) https://github.com/sverrirs/jekyll-paginate-v2/blob/master/README-GENERATOR.md#site-configuration
# pagination:
# enabled: false
Expand Down Expand Up @@ -320,8 +315,6 @@ compress_html:
head_scripts:
- /assets/js/settings.js
- /assets/js/theme.js
after_footer_scripts:
- /assets/js/plugins/jquery.auto-redirect.js

# jekyll-feed
feed:
Expand Down
10 changes: 5 additions & 5 deletions _data/plugins/auto_alert.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
note:
title: 注意
class_name: notice--info
class_name: alert alert-info
tip:
title: 提示
class_name: notice--success
class_name: alert alert-success
important:
title: 重要
class_name: notice--primary
class_name: alert alert-primary
warning:
title: 警告
class_name: notice--warning
class_name: alert alert-warning
caution:
title: 谨慎
class_name: notice--danger
class_name: alert alert-danger
32 changes: 2 additions & 30 deletions _data/settings.yaml
Original file line number Diff line number Diff line change
@@ -1,35 +1,7 @@
appearance_color:
type: radio
default: light
default: auto
options:
- light
- dark
- auto
appearance_skin_light:
type: radio
default: default
options:
- default
- air
- aqua
- contrast
- dark
- dirt
- neon
- mint
- plum
- sunrise
appearance_skin_dark:
type: radio
default: dark
options:
- default
- air
- aqua
- contrast
- light
- dark
- dirt
- neon
- mint
- plum
- sunrise
1 change: 0 additions & 1 deletion _docs/contribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
title: 贡献指南
date: 2021-10-09 23:18:02 +0800
author: huanghongxun
classes: wide
toc: false
---

Expand Down
28 changes: 0 additions & 28 deletions _includes/head.html

This file was deleted.

2 changes: 0 additions & 2 deletions _includes/head/custom.html

This file was deleted.

189 changes: 189 additions & 0 deletions _includes/toc.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
{% capture tocWorkspace %}
{% comment %}
Copyright (c) 2017 Vladimir "allejo" Jimenez

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
{% endcomment %}
{% comment %}
Version 1.2.1
https://github.com/allejo/jekyll-toc

"...like all things liquid - where there's a will, and ~36 hours to spare, there's usually a/some way" ~jaybe

Usage:
{% include toc.html html=content sanitize=true class="inline_toc" id="my_toc" h_min=2 h_max=3 %}

Parameters:
* html (string) - the HTML of compiled markdown generated by kramdown in Jekyll

Optional Parameters:
* sanitize (bool) : false - when set to true, the headers will be stripped of any HTML in the TOC
* class (string) : '' - a CSS class assigned to the TOC
* id (string) : '' - an ID to assigned to the TOC
* h_min (int) : 1 - the minimum TOC header level to use; any header lower than this value will be ignored
* h_max (int) : 6 - the maximum TOC header level to use; any header greater than this value will be ignored
* ordered (bool) : false - when set to true, an ordered list will be outputted instead of an unordered list
* item_class (string) : '' - add custom class(es) for each list item; has support for '%level%' placeholder, which is the current heading level
* submenu_class (string) : '' - add custom class(es) for each child group of headings; has support for '%level%' placeholder which is the current "submenu" heading level
* base_url (string) : '' - add a base url to the TOC links for when your TOC is on another page than the actual content
* anchor_class (string) : '' - add custom class(es) for each anchor element
* skip_no_ids (bool) : false - skip headers that do not have an `id` attribute
* flat_toc (bool) : false - when set to true, the TOC will be a single level list

Output:
An ordered or unordered list representing the table of contents of a markdown block. This snippet will only
generate the table of contents and will NOT output the markdown given to it
{% endcomment %}

{% capture newline %}
{% endcapture %}
{% assign newline = newline | rstrip %} <!-- Remove the extra spacing but preserve the newline -->

{% capture deprecation_warnings %}{% endcapture %}

{% if include.baseurl %}
{% capture deprecation_warnings %}{{ deprecation_warnings }}<!-- jekyll-toc :: "baseurl" has been deprecated, use "base_url" instead -->{{ newline }}{% endcapture %}
{% endif %}

{% if include.skipNoIDs %}
{% capture deprecation_warnings %}{{ deprecation_warnings }}<!-- jekyll-toc :: "skipNoIDs" has been deprecated, use "skip_no_ids" instead -->{{ newline }}{% endcapture %}
{% endif %}

{% capture jekyll_toc %}{% endcapture %}
{% assign orderedList = include.ordered | default: false %}
{% assign flatToc = include.flat_toc | default: false %}
{% assign baseURL = include.base_url | default: include.baseurl | default: '' %}
{% assign skipNoIDs = include.skip_no_ids | default: include.skipNoIDs | default: false %}
{% assign minHeader = include.h_min | default: 1 %}
{% assign maxHeader = include.h_max | default: 6 %}
{% assign nodes = include.html | strip | split: '<h' %}

{% assign firstHeader = true %}
{% assign currLevel = 0 %}
{% assign lastLevel = 0 %}

{% capture listModifier %}{% if orderedList %}ol{% else %}ul{% endif %}{% endcapture %}

{% for node in nodes %}
{% if node == "" %}
{% continue %}
{% endif %}

{% assign currLevel = node | replace: '"', '' | slice: 0, 1 | times: 1 %}

{% if currLevel < minHeader or currLevel > maxHeader %}
{% continue %}
{% endif %}

{% assign _workspace = node | split: '</h' %}

{% assign _idWorkspace = _workspace[0] | split: 'id="' %}
{% assign _idWorkspace = _idWorkspace[1] | split: '"' %}
{% assign htmlID = _idWorkspace[0] %}

{% assign _classWorkspace = _workspace[0] | split: 'class="' %}
{% assign _classWorkspace = _classWorkspace[1] | split: '"' %}
{% assign htmlClass = _classWorkspace[0] %}

{% if htmlClass contains "no_toc" %}
{% continue %}
{% endif %}

{% if firstHeader %}
{% assign minHeader = currLevel %}
{% endif %}

{% capture _hAttrToStrip %}{{ _workspace[0] | split: '>' | first }}>{% endcapture %}
{% assign header = _workspace[0] | replace: _hAttrToStrip, '' %}

{% if include.item_class and include.item_class != blank %}
{% capture listItemClass %} class="{{ include.item_class | replace: '%level%', currLevel | split: '.' | join: ' ' }}"{% endcapture %}
{% endif %}

{% if include.submenu_class and include.submenu_class != blank %}
{% assign subMenuLevel = currLevel | minus: 1 %}
{% capture subMenuClass %} class="{{ include.submenu_class | replace: '%level%', subMenuLevel | split: '.' | join: ' ' }}"{% endcapture %}
{% endif %}

{% capture anchorBody %}{% if include.sanitize %}{{ header | strip_html }}{% else %}{{ header }}{% endif %}{% endcapture %}

{% if htmlID %}
{% capture anchorAttributes %} href="{% if baseURL %}{{ baseURL }}{% endif %}#{{ htmlID }}"{% endcapture %}

{% if include.anchor_class %}
{% capture anchorAttributes %}{{ anchorAttributes }} class="{{ include.anchor_class | split: '.' | join: ' ' }}"{% endcapture %}
{% endif %}

{% capture listItem %}<a{{ anchorAttributes }}>{{ anchorBody }}</a>{% endcapture %}
{% elsif skipNoIDs == true %}
{% continue %}
{% else %}
{% capture listItem %}{{ anchorBody }}{% endcapture %}
{% endif %}

{% if currLevel > lastLevel and flatToc == false %}
{% capture jekyll_toc %}{{ jekyll_toc }}<{{ listModifier }}{{ subMenuClass }}>{% endcapture %}
{% elsif currLevel < lastLevel and flatToc == false %}
{% assign repeatCount = lastLevel | minus: currLevel %}

{% for i in (1..repeatCount) %}
{% capture jekyll_toc %}{{ jekyll_toc }}</li></{{ listModifier }}>{% endcapture %}
{% endfor %}

{% capture jekyll_toc %}{{ jekyll_toc }}</li>{% endcapture %}
{% else %}
{% capture jekyll_toc %}{{ jekyll_toc }}</li>{% endcapture %}
{% endif %}

{% capture jekyll_toc %}{{ jekyll_toc }}<li{{ listItemClass }}>{{ listItem }}{% endcapture %}

{% assign lastLevel = currLevel %}
{% assign firstHeader = false %}
{% endfor %}

{% if flatToc == true %}
{% assign repeatCount = 1 %}
{% else %}
{% assign repeatCount = minHeader | minus: 1 %}
{% assign repeatCount = lastLevel | minus: repeatCount %}
{% endif %}

{% for i in (1..repeatCount) %}
{% capture jekyll_toc %}{{ jekyll_toc }}</li></{{ listModifier }}>{% endcapture %}
{% endfor %}

{% if jekyll_toc != '' %}
{% assign rootAttributes = '' %}
{% if include.class and include.class != blank %}
{% capture rootAttributes %} class="{{ include.class | split: '.' | join: ' ' }}"{% endcapture %}
{% endif %}

{% if include.id and include.id != blank %}
{% capture rootAttributes %}{{ rootAttributes }} id="{{ include.id }}"{% endcapture %}
{% endif %}

{% if rootAttributes %}
{% assign nodes = jekyll_toc | split: '>' %}
{% capture jekyll_toc %}<{{ listModifier }}{{ rootAttributes }}>{{ nodes | shift | join: '>' }}>{% endcapture %}
{% endif %}
{% endif %}
{% endcapture %}{% assign tocWorkspace = '' %}{{ deprecation_warnings }}{{ jekyll_toc -}}
Loading