Compare commits
292 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f32402dcdf | |||
| 3e60685d5a | |||
| 3682a2a1d3 | |||
| 4d07d872d5 | |||
| a1e123ac02 | |||
| 6c3c3d7a9a | |||
| a66bc4e0d1 | |||
| b7e9c6166b | |||
| df47c49726 | |||
| c881715c2a | |||
| b32370803b | |||
| 020a8fdbcc | |||
| b06b89cc11 | |||
| ba4b506b2f | |||
| 51bffc18b5 | |||
| 87f0fe68ae | |||
| c2d168c6d1 | |||
| c1b61c7997 | |||
| 5098685763 | |||
| 3c886553db | |||
| 84bca1af4f | |||
| 851b8e48cb | |||
| 89beb8fe4f | |||
| 462506cb92 | |||
| f6ed1ce8fe | |||
| b52b31a0cd | |||
| 12ada20fb8 | |||
| 39e6466d78 | |||
| fd0b171e5f | |||
| 7ceed732d2 | |||
| e07904b0f6 | |||
| 5f5d019f09 | |||
| f4e8babd12 | |||
| 1ed0acdf35 | |||
| 3b89a4eaab | |||
| 20433ed50d | |||
| 6c83d0630c | |||
| 79b5c27ed8 | |||
| dfeaf0e9a7 | |||
| 1e493fef48 | |||
| 7f19569336 | |||
| 429698a096 | |||
| 09440190aa | |||
| 1217640d40 | |||
| 300bbe9a44 | |||
| 7ec41cdb00 | |||
| fd13ca782b | |||
| bae1678c59 | |||
| 72bd72f5ed | |||
| c09f141034 | |||
| a2d8eaa249 | |||
| ff8e5fc7bf | |||
| 84e9eea483 | |||
| 5705048952 | |||
| d379911220 | |||
| 773a8a7eb9 | |||
| 6ab33ff7bf | |||
| dc0b96210a | |||
| 4dc8d0f7d7 | |||
| 76fec05da2 | |||
| 54c773368e | |||
| 05693d8b4c | |||
| 38cf4ee0de | |||
| 3df577cb0d | |||
| 063d8fa219 | |||
| 7f38d99ae4 | |||
| c771bce957 | |||
| 2ea592b4a3 | |||
| a9fd15e47d | |||
| d6be3c1fc2 | |||
| c9af0b9018 | |||
| b2b47095eb | |||
| 002ebda06f | |||
| 551938f0b4 | |||
| 9d6ee9feef | |||
| 1bd56105b7 | |||
| b7dba0713e | |||
| dd4f422dba | |||
| aaebdfb02c | |||
| 9eb18b9e75 | |||
| 594c89eb1e | |||
| 976d1ea82a | |||
| b16a06893c | |||
| 32711ff29c | |||
| 38eb829194 | |||
| 4c9b5b6773 | |||
| 8b2dd976e6 | |||
| 8789f6eaff | |||
| 34021a58a3 | |||
| 804d1e484d | |||
| e482fbe36a | |||
| de5fd0c3f7 | |||
| 07756a8c34 | |||
| ef84231860 | |||
| 0c87728979 | |||
| 90032a4471 | |||
| 2ebc77797c | |||
| 714a656ca8 | |||
| 175a307673 | |||
| 8e3d880557 | |||
| 9f24e82770 | |||
| 7e8e2e9431 | |||
| fbe58346e5 | |||
| 7aface4334 | |||
| b9539e9d69 | |||
| 927e6f9946 | |||
| da54fef151 | |||
| 0c3148b3ee | |||
| 7c7b81f589 | |||
| d777b2cfaf | |||
| 928fba19a8 | |||
| 68f4d5fb80 | |||
| df3aaa7ea3 | |||
| 4753da9236 | |||
| e4bc95172c | |||
| f5a79bac03 | |||
| 8beeb2dfa5 | |||
| 9894cf6263 | |||
| bece9f6fa2 | |||
| 9f7bce87a7 | |||
| 6c6a326607 | |||
| 4342d40158 | |||
| e4367587f1 | |||
| 2cc276e5f5 | |||
| caeb3d443e | |||
| 4b2ff9e773 | |||
| 95612e33f5 | |||
| 443abcf784 | |||
| 7b7fba261b | |||
| d02a9977a2 | |||
| 4bfe3962a9 | |||
| 9718a1c5c7 | |||
| a846d74e43 | |||
| c606e8c96e | |||
| 307851fc25 | |||
| 94a1796e63 | |||
| c783ced12f | |||
| 5d16e1ac0f | |||
| c7a03ea847 | |||
| 8ccf57862c | |||
| 86f4630f0b | |||
| 8416b6f757 | |||
| 30dbc469bd | |||
| 1cfabbe8bc | |||
| d4d2a95f98 | |||
| b5208b3f4b | |||
| fb16d9e1a2 | |||
| dc288de30f | |||
| e953d16f1c | |||
| a8e815aaa0 | |||
| 7991f97e7a | |||
| 65875dec78 | |||
| 8aa3cf96a9 | |||
| ac39b35cd5 | |||
| dba2e38ac8 | |||
| 9e3a440909 | |||
| 8cfd7d30a4 | |||
| 6f16b3ffe1 | |||
| a1833aaf41 | |||
| 2d0887173e | |||
| 17070d6fba | |||
| e3c69a6b13 | |||
| 5e9f24e3d3 | |||
| 1761aa17b9 | |||
| fdc501904c | |||
| 9ec83753d3 | |||
| 1121c9df57 | |||
| 95c8113d62 | |||
| 6fe37cef59 | |||
| 4e29d5e5ca | |||
| 02dda642ea | |||
| c2bb7e0f80 | |||
| 4fb9711fa6 | |||
| 6682d38af2 | |||
| eaa1fea5dc | |||
| 81f6d68f0a | |||
| a9678bf73c | |||
| c4a1b10e6a | |||
| fa952dfac7 | |||
| 089fce6a1c | |||
| bdad5f7758 | |||
| d484414e20 | |||
| d22d261e69 | |||
| 0de8e5053f | |||
| ecb0d964ad | |||
| c4606930ff | |||
| a631096b29 | |||
| b9fe4cc207 | |||
| aae1380688 | |||
| 223a42e3b7 | |||
| c4519a9194 | |||
| 98bf58d9bc | |||
| 4d223bdc29 | |||
| b3b9e358fd | |||
| 9f1773b6c7 | |||
| 1f412dc12d | |||
| e11caf7a59 | |||
| 496b60cff1 | |||
| b4741cc1a3 | |||
| b58fddda9c | |||
| 5c043e2c0f | |||
| 98c5a1ad54 | |||
| 23626dd604 | |||
| deed146884 | |||
| 9b47648aa5 | |||
| a25331bca3 | |||
| 8bb2a35dcc | |||
| 608693c962 | |||
| 5df739e5dc | |||
| 8611f00cf4 | |||
| 7fa16bbf66 | |||
| 88ec3aad5b | |||
| aff8b7f2c9 | |||
| 2956b9927c | |||
| 78416fa920 | |||
| 3443e0745b | |||
| 1b359b7f14 | |||
| 6df8f283f2 | |||
| 38043616ef | |||
| d7a25beafa | |||
| d64a6210f2 | |||
| ff95cfaed7 | |||
| 80ae5003f7 | |||
| 566c2238a2 | |||
| db6335cee3 | |||
| 1cc75302f1 | |||
| 901f47bac9 | |||
| d4e1a2392f | |||
| 60e9d6f0b9 | |||
| f2b0bd5aca | |||
| 0ac4c06d66 | |||
| 869b4f5798 | |||
| 68849f644f | |||
| 0f5e60274a | |||
| 913b79b30a | |||
| 6e3f3200e2 | |||
| 11422bfcd2 | |||
| bc6d8f47c2 | |||
| 40cb2e412a | |||
| 0ace5e2aad | |||
| eef8efde25 | |||
| 2fdb240b2c | |||
| cd12da45b4 | |||
| cbcb9c53cb | |||
| 06250ca531 | |||
| cb7ea11a81 | |||
| 46e107b507 | |||
| d90b51c02d | |||
| 6abad2937e | |||
| a7bb6cf835 | |||
| d441e8487e | |||
| 7376238567 | |||
| 433c631110 | |||
| 9ca9a6e284 | |||
| 914f02643e | |||
| 0b5e40e2bf | |||
| 4e20b85420 | |||
| 19396e7e5f | |||
| 089e96f6fa | |||
| 88ee7146d5 | |||
| e685b2d33e | |||
| c4cedfe6c1 | |||
| 2a25978ee6 | |||
| afc79a1809 | |||
| 9ed873a0dd | |||
| 9b8c94761e | |||
| 04b9cceed9 | |||
| 8dceb3ea6e | |||
| a98fa072fd | |||
| 541bad62ae | |||
| 1f40755ce1 | |||
| 25eebf642f | |||
| 7ff750ab0a | |||
| 22149b2082 | |||
| 703349de9d | |||
| af282b0935 | |||
| 81bc55c46f | |||
| 934c57cdff | |||
| 3195fc5d62 | |||
| 56bc897f36 | |||
| b9b2c40103 | |||
| d45a13e939 | |||
| 264bb76b53 | |||
| 3687dd17fb | |||
| 9d527f0e2e | |||
| 14fc25888c | |||
| a951ccfea8 | |||
| 78c53f0aca | |||
| ddc33ec1da | |||
| 595bdd908b | |||
| de4ff5d8d7 | |||
| 866203a4ce |
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"output": "CHANGELOG.md",
|
||||
"template": ".auto-changelog/template.hbs",
|
||||
"handlebarsSetup": ".auto-changelog/setup.js",
|
||||
"sortCommits": "relevance",
|
||||
"commitLimit": false,
|
||||
"replaceText": {
|
||||
"^(Feat|feat):": ":sparkles: Feat:",
|
||||
"^(Fix|fix):": ":bug: Fix:",
|
||||
"^(Build|build):": ":hammer: Build:",
|
||||
"^(Refactor|refactor):": ":recycle: Refactor:",
|
||||
"^(Style|style):": ":lipstick: Style:",
|
||||
"^(Perf|perf):": ":zap: Perf:",
|
||||
"^(Test|test):": ":white_check_mark: Test:",
|
||||
"^(Docs|docs):": ":memo: Docs:",
|
||||
"^(Chore|chore):": ":wrench: Chore:"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Custom Handlebars helpers
|
||||
module.exports = function (Handlebars) {
|
||||
/**
|
||||
* Handlebars helper to replace a string with another string
|
||||
* @param {String} context the string to replace
|
||||
* @param {Object} options
|
||||
* @param {String} options.hash.from the string to replace
|
||||
* @param {String} options.hash.to the string to replace with
|
||||
* @example {{replace "foo bar" from="foo" to="baz"}} => "baz bar"
|
||||
*/
|
||||
Handlebars.registerHelper('replace', function (context, options) {
|
||||
return context.replace(options.hash.from, options.hash.to)
|
||||
})
|
||||
/**
|
||||
* Handlebars helper to convert a name to a GitHub username
|
||||
* @param {String} context name to convert
|
||||
* @param {Object} options
|
||||
* @param {Boolean} [options.hash.linked=true] whether to return a linked username
|
||||
* @example {{githubUser "Cell"}} => "Lruihao"
|
||||
*/
|
||||
Handlebars.registerHelper('githubUser', function (context, { hash: { linked = false }}) {
|
||||
const map = {
|
||||
'Cell': "Lruihao",
|
||||
}
|
||||
const username = map[context] || context
|
||||
if (linked) {
|
||||
return `[@${username}](https://github.com/${username})`
|
||||
}
|
||||
return `@${username}`
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
{{!-- if need, set replaceText in config.json "#(\\d+)": "[#$1](https://github.com/hugo-fixit/FixIt/issues/$1)" --}}
|
||||
|
||||
{{#each releases}}
|
||||
{{#if href}}
|
||||
## [{{title}}]({{href}}){{#if tag}} - {{isoDate}}{{/if}}
|
||||
{{else}}
|
||||
## {{title}}{{#if tag}} - {{isoDate}}{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{#if summary}}
|
||||
{{summary}}
|
||||
{{/if}}
|
||||
|
||||
{{!-- List commits with `Breaking change: ` somewhere in the message --}}
|
||||
{{#commit-list commits heading='### :boom: Breaking Changes' message='^(Breaking change|BREAKING CHANGE):'}}
|
||||
- {{subject}} [`{{shorthash}}`]({{href}}) by {{githubUser author}}
|
||||
{{/commit-list}}
|
||||
|
||||
{{!-- List commits that add new features, but exclude those that have `:sparkles:` in the message --}}
|
||||
{{#commit-list commits heading='### :tada: New Features' message='(:tada:|Feat:|feat:)' exclude='^:sparkles:'}}
|
||||
- {{subject}} [`{{shorthash}}`]({{href}}) by {{githubUser author}}
|
||||
{{/commit-list}}
|
||||
|
||||
{{!-- List commits that enhance existing features, but exclude those that have `:tada:` in the message --}}
|
||||
{{#commit-list commits heading='### :sparkles: Enhancements' message='(:sparkles:|Feat:|feat:|Perf:|perf:)' exclude='^:tada:'}}
|
||||
- {{subject}} [`{{shorthash}}`]({{href}}) by {{githubUser author}}
|
||||
{{/commit-list}}
|
||||
|
||||
{{!-- List commits that bug fixes --}}
|
||||
{{#commit-list commits heading='### :bug: Bug Fixes' message='(:bug:|Fix:|fix:)'}}
|
||||
- {{subject}} [`{{shorthash}}`]({{href}}) by {{githubUser author}}
|
||||
{{/commit-list}}
|
||||
|
||||
{{!-- List commits that improve the documentation --}}
|
||||
{{#commit-list commits heading='### :memo: Documentation' message='(:memo:|Docs:|docs:)'}}
|
||||
- {{subject}} [`{{shorthash}}`]({{href}}) by {{githubUser author}}
|
||||
{{/commit-list}}
|
||||
|
||||
{{!-- List other changes commits --}}
|
||||
{{#commit-list commits heading='### :wrench: Other Changes' message='(Refactor:|refactor:|Style:|style:|Test:|test:|Chore:|chore:|Build:|build:)'}}
|
||||
- {{subject}} [`{{shorthash}}`]({{href}}) by {{githubUser author}}
|
||||
{{/commit-list}}
|
||||
|
||||
**Full Changelog**: {{href}}
|
||||
|
||||
---
|
||||
|
||||
### Uncategorized
|
||||
|
||||
{{#if merges}}
|
||||
#### Merged pull requests
|
||||
|
||||
{{#each merges}}
|
||||
{{!-- {{#if href}}[`#{{id}}`]({{href}}){{/if}} --}}
|
||||
- {{#if commit.breaking}}**Breaking change:** {{/if}}{{message}} by {{githubUser author}} in {{#if id}}#{{id}}{{/if}}
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
|
||||
{{#if fixes}}
|
||||
#### Closed issues
|
||||
|
||||
{{#each fixes}}
|
||||
- {{#if commit.breaking}}**Breaking change:** {{/if}}{{commit.subject}}{{#each fixes}} {{#if id}}#{{id}}{{/if}}{{/each}} by {{githubUser commit.author}}
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
|
||||
{{/each}}
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"comments": false,
|
||||
"minified": true,
|
||||
"presets": [
|
||||
[
|
||||
"@babel/preset-env",
|
||||
{
|
||||
"targets": "> 0.25%, not dead"
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
assets/lib/**/* linguist-vendored
|
||||
@@ -1,5 +1,3 @@
|
||||
custom: [
|
||||
"https://paypal.me/Lruihao",
|
||||
"https://lruihao.cn/images/alipay.gif",
|
||||
"https://lruihao.cn/images/wechatpay.gif"
|
||||
"https://paypal.me/Lruihao"
|
||||
]
|
||||
@@ -48,4 +48,4 @@ body:
|
||||
label: Additional Information 补充信息
|
||||
description: |
|
||||
Configuration files or front matter code ...
|
||||
配置文件或者前置参数的代码 ...
|
||||
配置文件或者前置参数的代码……
|
||||
|
||||
@@ -12,7 +12,7 @@ body:
|
||||
请针对不同的功能建议提交新的 issue。
|
||||
placeholder: |
|
||||
I recommend adding this feature ...
|
||||
我希望添加这样的一个功能 ...
|
||||
我希望添加这样的一个功能……
|
||||
- type: textarea
|
||||
id: reference
|
||||
attributes:
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
name: Update Algolia Search Index
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- 'docs'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
algolia-atomic:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true # Fetch Hugo themes (true OR recursive)
|
||||
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
|
||||
|
||||
- name: Setup Hugo
|
||||
uses: peaceiris/actions-hugo@v2
|
||||
with:
|
||||
hugo-version: 'latest'
|
||||
extended: true
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
|
||||
- name: Update Algolia Index (en)
|
||||
env:
|
||||
ALGOLIA_APP_ID: YKOM6PKLUY
|
||||
ALGOLIA_ADMIN_KEY: ${{ secrets.ALGOLIA_ADMIN_KEY }}
|
||||
ALGOLIA_INDEX_NAME: 'index.en'
|
||||
ALGOLIA_INDEX_FILE: './docs/public/index.json'
|
||||
run: |
|
||||
npm run algolia
|
||||
|
||||
- name: Update Algolia Index (zh-cn)
|
||||
env:
|
||||
ALGOLIA_APP_ID: YKOM6PKLUY
|
||||
ALGOLIA_ADMIN_KEY: ${{ secrets.ALGOLIA_ADMIN_KEY }}
|
||||
ALGOLIA_INDEX_NAME: 'index.zh-cn'
|
||||
ALGOLIA_INDEX_FILE: './docs/public/zh-cn/index.json'
|
||||
run: |
|
||||
npm run algolia
|
||||
@@ -8,14 +8,14 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive # Fetch Hugo themes (true OR recursive)
|
||||
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
|
||||
- name: Setup Hugo
|
||||
uses: peaceiris/actions-hugo@v2
|
||||
uses: peaceiris/actions-hugo@v3
|
||||
with:
|
||||
hugo-version: latest
|
||||
extended: true
|
||||
- name: Build Hugo static files
|
||||
run: hugo -v --source=docs --gc --minify
|
||||
run: hugo -v --source=demo --gc --minify
|
||||
|
||||
@@ -19,7 +19,7 @@ on:
|
||||
branches:
|
||||
- master
|
||||
schedule:
|
||||
- cron: '30 18 * * 5'
|
||||
- cron: "30 18 * * 5"
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
@@ -29,18 +29,21 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [ 'javascript' ]
|
||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
|
||||
language: [ "javascript" ]
|
||||
# CodeQL supports [ "cpp", "csharp", "go", "java", "javascript", "python" ]
|
||||
# Learn more:
|
||||
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true # Fetch Hugo themes (true OR recursive)
|
||||
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
config-file: ./.github/configs/codeql.yml
|
||||
@@ -52,7 +55,7 @@ jobs:
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v2
|
||||
uses: github/codeql-action/autobuild@v3
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
@@ -66,4 +69,4 @@ jobs:
|
||||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
uses: github/codeql-action/analyze@v3
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
# This is a basic workflow to help you get started with Actions
|
||||
|
||||
name: Release for new tag
|
||||
|
||||
# Controls when the action will run.
|
||||
on:
|
||||
# Triggers the workflow on push or pull request events but only for the master branch
|
||||
push:
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
|
||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||
jobs:
|
||||
# This workflow contains a single job called "build"
|
||||
build:
|
||||
# The type of runner that the job will run on
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||
steps:
|
||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # Fetch all history for generating release notes
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
|
||||
- name: Install dependencies and generate release notes
|
||||
run: |
|
||||
npm install
|
||||
npm run release -- --starting-version ${{ github.ref_name }}
|
||||
|
||||
- name: GitHub Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
# Creates a draft release. Defaults to false
|
||||
draft: true
|
||||
body_path: CHANGELOG.md
|
||||
@@ -25,4 +25,4 @@ $RECYCLE.BIN/
|
||||
## Linux
|
||||
.directory
|
||||
|
||||
|
||||
CHANGELOG.md
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
[submodule "docs"]
|
||||
path = docs
|
||||
url = https://github.com/hugo-fixit/docs.git
|
||||
@@ -1,277 +0,0 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
<!-- Releases see https://github.com/hugo-fixit/FixIt/releases -->
|
||||
|
||||
## v0.2.17 [2023.1.29]
|
||||
|
||||
> Snapshot: <>
|
||||
|
||||
- :tada: Feat: add support for [Fusejs search](https://fusejs.io/) ([#203](https://github.com/hugo-fixit/FixIt/issues/203))
|
||||
- :sparkles: Feat: add feature post reward support ([#216](https://github.com/hugo-fixit/FixIt/issues/216), @Lruihao[#234](https://github.com/hugo-fixit/FixIt/pull/234))
|
||||
- :sparkles: Feat: add reward shortcode support ([#216](https://github.com/hugo-fixit/FixIt/issues/216))
|
||||
- :sparkles: Feat: add TagCloud config support for tags page, see parameter `params.tagcloud` ([#235](https://github.com/hugo-fixit/FixIt/issues/235))
|
||||
- :sparkles: Feat: add [pace](https://github.com/CodeByZach/pace) support ([#190](https://github.com/hugo-fixit/FixIt/issues/190))
|
||||
- :sparkles: Feat: add custom templates and parameter `params.customFilePath` support
|
||||
- :sparkles: Feat: add feature end of post flag support ([#236](https://github.com/hugo-fixit/FixIt/issues/236))
|
||||
- :sparkles: Feat: refactor parameter `params.footer.siteTime`
|
||||
- :sparkles: Feat: add params to close wordcount and readingTime in post ([#209](https://github.com/hugo-fixit/FixIt/issues/209))
|
||||
- :sparkles: Feat: add parameter `params.footer.order` to order footer lines
|
||||
- :sparkles: Feat: add parameter `params.home.profile.avatarMenu`
|
||||
- :truck: Feat: migrate parameter `params.autoBookmark` to `params.page.autoBookmark` ([#55](https://github.com/hugo-fixit/FixIt/issues/55))
|
||||
- :truck: Feat: move `assets/data/emoji` to `assets/lib/valine/emoji/`
|
||||
- :zap: Perf: optimize close comment feature when the post has expired ([#204](https://github.com/hugo-fixit/FixIt/issues/204))
|
||||
- :zap: Perf: optimize sub menu position calculation in desktop header with css replace of javascript
|
||||
- :zap: Perf: enhance pangu spelling correction
|
||||
- :bug: Fix: remove the leading and trailing whitespace of the code string ([#205](https://github.com/hugo-fixit/FixIt/issues/205))
|
||||
- :bento: Fix: update webfonts for fontawesome 6.2.0 (@NicoDreamzZ[#228](https://github.com/hugo-fixit/FixIt/pull/228))
|
||||
- :bug: Fix: image shortcode/plugin lose the support for svg type files ([#210](https://github.com/hugo-fixit/FixIt/issues/210))
|
||||
- :bug: Fix: can't keep the static table of the contents in front of the post
|
||||
- :bug: Fix: escape hashtag character `#` in tag and category ([#245](https://github.com/hugo-fixit/FixIt/issues/245))
|
||||
- :bug: Fix: pangu.js cdn error
|
||||
- :bug: Fix: sitemap.xml link in robots.txt doesn't point to main sitemap (@Mejituu[#276](https://github.com/hugo-fixit/FixIt/pull/276))
|
||||
- :recycle: Refactor(i18n): hierarchize translation fields for supported languages
|
||||
- :globe_with_meridians: Docs(i18n): add missing translations for French + enhancements (@Kapusch[#247](https://github.com/hugo-fixit/FixIt/pull/247))
|
||||
- :lipstick: Style: refactor css style
|
||||
- :lipstick: Style: update home page stylesheet
|
||||
- :arrow_up: Chore(libs):
|
||||
- Update Twikoo from 1.4.10 to 1.6.8 and add Katex support for it ([#215](https://github.com/hugo-fixit/FixIt/issues/215) [#243](https://github.com/hugo-fixit/FixIt/issues/243))
|
||||
- :wrench: Chore(deps-dev):
|
||||
- Bump @babel/cli from 7.18.10 to 7.20.7
|
||||
- Bump @babel/core from 7.19.1 to 7.20.12
|
||||
- Bump @babel/preset-env from 7.18.10 to 7.20.2
|
||||
- Bump core-js from 3.25.2 to 3.27.2
|
||||
|
||||
- **Full Changelog:** @Lruihao [`v0.2.16...v0.2.17`](https://github.com/hugo-fixit/FixIt/compare/v0.2.16...v0.2.17)
|
||||
|
||||
## v0.2.16 [2022.9.24]
|
||||
|
||||
> This version fixes several bugs, adds a few new features and SEO optimizations, and refactors part of the project structure and code.
|
||||
> Snapshot: <https://fixit-jir7e7kzt-x-cell.vercel.app>
|
||||
|
||||
- :tada: Feat: add reading progress bar support ([#191](https://github.com/hugo-fixit/FixIt/issues/191))
|
||||
- :tada: Feat: add b2t scroll percent support ([#192](https://github.com/hugo-fixit/FixIt/issues/192))
|
||||
- :sparkles: Feat: add auto bookmark support ([#55](https://github.com/hugo-fixit/FixIt/issues/55))
|
||||
- :sparkles: Feat: add `raw` shortcode
|
||||
- :sparkles: Feat(menu): add params: `icon`, `type` for menu items
|
||||
- :sparkles: Feat: add custom aside template in post page ([#172](https://github.com/hugo-fixit/FixIt/issues/172))
|
||||
- :sparkles: Feat(math): add more block delimiter support for math
|
||||
- :sparkles: Feat(highlight): add full support for Chroma highlighting languages in the [list](https://gohugo.io/content-management/syntax-highlighting/#list-of-chroma-highlighting-languages)
|
||||
- :sparkles: Feat: add optional parameter `noreferrer` for the shortcode `link`
|
||||
- :sparkles: Feat: update echarts theme config
|
||||
- :sparkles: Feat: add noscript warning banner ([#194](https://github.com/hugo-fixit/FixIt/issues/194))
|
||||
- :sparkles: Feat: add 12 newly supported social links ([#175](https://github.com/hugo-fixit/FixIt/issues/175) [#197](https://github.com/hugo-fixit/FixIt/issues/197))
|
||||
- :zap: Perf: remove extra spaces in plugin link
|
||||
- :wheelchair: Feat(accessibility): use `aria-hidden=true` on icons that AT should ignore
|
||||
- :recycle: Refactor: image rendering
|
||||
- :recycle: Refactor: back to top and scroll to comments
|
||||
- :recycle: Refactor: custom.js rendering and remove `params.customJS` ([#189](https://github.com/hugo-fixit/FixIt/pull/189))
|
||||
- :recycle: Refactor: scss directory ([#185](https://github.com/hugo-fixit/FixIt/issues/185))
|
||||
- :recycle: Refactor: plugin script
|
||||
- :recycle: Refactor: version.template.svg
|
||||
- :recycle: Refactor: config ([#187](https://github.com/hugo-fixit/FixIt/issues/187))
|
||||
- :bug: Fix: add function `dos2unix` to unify new lines symbol between Windows and Unix/Mac OS
|
||||
- :bug: Fix: author display error in post and markdown file
|
||||
- :bug: Fix: use data attributes or class replace for custom attributes
|
||||
- :bug: Fix: attribute `media` not allowed on element meta in `[name=theme-color]`
|
||||
- :bug: Fix: support smooth migration from LoveIt to FixIt ([#174](https://github.com/hugo-fixit/FixIt/discussions/174) [#182](https://github.com/hugo-fixit/FixIt/issues/182))
|
||||
- :bug: Fix: `center-quote` shortcode rendering error when config `unsafe = false` (@yureiita[#160](https://github.com/hugo-fixit/FixIt/pull/160))
|
||||
- :bug: Fix: menu item invalid params `draft` in submenu
|
||||
- :bug: Fix: missing height and weight of img element and lazyload object-fit style
|
||||
- :bug: Fix: image shortcode invalid params `height` and `weight` ([#200](https://github.com/hugo-fixit/FixIt/issues/200))
|
||||
- :bug: Fix: typeit shortcode invalid config `duration = -1` and fix style
|
||||
- :bug: Fix: typeit shortcode prints consecutive spaces and newline errors
|
||||
- :art: Style: change the default icons of some social links
|
||||
- :bug: Fix: component `paginator` style error ([#188](https://github.com/hugo-fixit/FixIt/issues/188))
|
||||
- :lipstick: Style: fix language and theme switch cursor style ([#193](https://github.com/hugo-fixit/FixIt/issues/193))
|
||||
- :lipstick: Style: change line-break style of code element from `anywhere` to `auto`
|
||||
- :globe_with_meridians: Docs(i18n): update pt-br, de in i18n
|
||||
- :mag: Perf(SEO): enhance SEO performance
|
||||
- :wrench: Chore: modify babel config and optimize theme.js compilation and loading (revert [`65371a1`](https://github.com/hugo-fixit/FixIt/commit/65371a19a40591c3f403f7fde2b7001c3390354d))
|
||||
- :wrench: Chore: creating new go.mod: module github.com/hugo-fixit/FixIt
|
||||
- :arrow_up: Chore(libs):
|
||||
- Update simple-icons from 6.3.0 to 7.12.0
|
||||
- Update emoji-data from 5.0.1 to 14.0.0
|
||||
- Update mermaid from 9.1.3 to 9.1.7
|
||||
- Update typeit from 7.0.4 to 8.7.0
|
||||
- Update lightgallery from 1.4.0 to 2.6.1
|
||||
- Update Valine from 1.5.0 to 1.5.1
|
||||
- Update @waline/client from 2.6.1 to 2.10.0
|
||||
- Update mapbox-gl from 2.8.2 to 2.10.0
|
||||
- Update fontawesome-free from 6.1.1 to 6.2.0
|
||||
- Update katex from 0.15.3 to 0.16.2
|
||||
- Update echarts from 5.2.2 to 5.3.3
|
||||
- Update algoliasearch from 4.13.0 to 4.14.2
|
||||
- :wrench: Chore(deps-dev):
|
||||
- Remove dependencies: minimist, babel-preset-minify
|
||||
- Bump core-js from 3.24.1 to 3.25.2 (@dependabot[#201](https://github.com/hugo-fixit/FixIt/pull/201))
|
||||
- Bump @babel/core from 7.18.10 to 7.19.1 (@dependabot[#202](https://github.com/hugo-fixit/FixIt/pull/202))
|
||||
- **Full Changelog:** @Lruihao [`v0.2.15...v0.2.16`](https://github.com/hugo-fixit/FixIt/compare/v0.2.15...v0.2.16)
|
||||
|
||||
## v0.2.15 [2022.8.4]
|
||||
|
||||
> Add content encryption feature(pages, partial), total word count, enhance auto toc, developer options and more.
|
||||
> Snapshot: <https://fixit-hvd1rg4ba-x-cell.vercel.app>
|
||||
|
||||
- :truck: Feat: ransfer repository from Lruihao to hugo-fixit
|
||||
- :tada: Feat: add content encryption of pages ([#123](https://github.com/hugo-fixit/FixIt/issues/123))
|
||||
- :tada: Feat: add `fixit-encryptor` shortcode ([#123](https://github.com/hugo-fixit/FixIt/issues/123))
|
||||
- :sparkles: Feat: add total word count feature in section and remove from footer ([#124](https://github.com/hugo-fixit/FixIt/issues/124))
|
||||
- :sparkles: Feat: enhance auto toc feature ([#104](https://github.com/hugo-fixit/FixIt/issues/104) [#136](https://github.com/hugo-fixit/FixIt/issues/136))
|
||||
- :sparkles: Feat: add repost feature ([#156](https://github.com/hugo-fixit/FixIt/issues/156))
|
||||
- :sparkles: Feat: add developer options
|
||||
- Check for updates option
|
||||
- Mobile Devtools config ([#163](https://github.com/hugo-fixit/FixIt/pull/163))
|
||||
- :bug: Fix: unable to show search bar of header at mobile mode ([#143](https://github.com/hugo-fixit/FixIt/issues/143))
|
||||
- :bug: Fix: Giscus comment invalid config `inputPosition`
|
||||
- :bug: Fix: Waline comment invalid config `imageUploader = false` & `highlighter = false` (@yureiita[#161](https://github.com/hugo-fixit/FixIt/pull/161))
|
||||
- :bug: Fix: busuanzi logic error
|
||||
- :bug: Fix: close comment system logic error when the article was expired
|
||||
- :bug: Style: fix typos for rel attribute value noreferrer (@yureiita[#157](https://github.com/hugo-fixit/FixIt/pull/157))
|
||||
- :recycle: Refactor: migrate theme js from src to assets by js.build
|
||||
- :recycle: Refactor: change the post edit url splicing rules
|
||||
- :mag: Feat(SEO): add options to make output `baidu_urls.txt` file ([#138](https://github.com/hugo-fixit/FixIt/issues/138))
|
||||
- :truck: Feat: migrate exampleSite to docs submodule
|
||||
- :art: Style: add theme colors variables and add common color styles
|
||||
- :art: Style: add scroll bar for auto toc ([#136](https://github.com/hugo-fixit/FixIt/issues/136))
|
||||
- :art: Style: change the version badge style form flat-square to flat
|
||||
- :memo: Docs: revise theme documentations
|
||||
- :heavy_plus_sign: Feat: add theme core configuration settings file
|
||||
- :wrench: Feat(cdn): add unpkg cdn support
|
||||
- :wrench: Chore: change the theme minimum supported Hugo versions above **0.84.0**
|
||||
- :arrow_up: Chore(libs): update some third-party libraries
|
||||
- Update Artalk from 2.2.12 to 2.3.4 ([#150](https://github.com/hugo-fixit/FixIt/issues/150))
|
||||
- Update Waline from 1.5.2 to 2.6.1
|
||||
- Update Valine from 1.4.18 to 1.5.0
|
||||
- Update mermaid from 8.13.3 to 9.1.3
|
||||
- :arrow_up: Chore(deps-dev):
|
||||
- Bump babel-preset-minify from 0.5.1 to 0.5.2 ([#145](https://github.com/hugo-fixit/FixIt/pull/145))
|
||||
- Bump core-js from 3.22.0 to 3.24.1 ([#168](https://github.com/hugo-fixit/FixIt/pull/168))
|
||||
- Bump @babel/preset-env from 7.16.11 to 7.18.10 ([#169](https://github.com/hugo-fixit/FixIt/pull/169))
|
||||
- Bump @babel/cli from 7.17.6 to 7.18.10 ([#170](https://github.com/hugo-fixit/FixIt/pull/170))
|
||||
- Bump @babel/core from 7.17.9 to 7.18.10 ([#171](https://github.com/hugo-fixit/FixIt/pull/171))
|
||||
- **Full Changelog:** @Lruihao [`v0.2.14...v0.2.15`](https://github.com/hugo-fixit/FixIt/compare/v0.2.14...v0.2.15)
|
||||
|
||||
## v0.2.14 [2022.5.15]
|
||||
|
||||
> Add hugo new features support.
|
||||
> Snapshot: <https://fixit-p1tg6tsml-lruihao.vercel.app>
|
||||
|
||||
- :recycle: Refactor: header layout
|
||||
- :tada: Feat: add sub menu (nested menu) support ([#31](https://github.com/hugo-fixit/FixIt/issues/31))
|
||||
- :sparkles: Feat: add user-defined content to menu items via the `params` field ([#99](https://github.com/hugo-fixit/FixIt/issues/99))
|
||||
- :sparkles: Feat: modified language selector to submenu (@pandaoh[`eced169`](https://github.com/hugo-fixit/FixIt/commit/eced169713ce4a0208ce70ab556824e47eb671d5), @Lruihao[#31](https://github.com/hugo-fixit/FixIt/issues/31))
|
||||
- :bug: Fix: add "no more translations" judgment logic ([#100](https://github.com/hugo-fixit/FixIt/issues/100))
|
||||
- :bug: Fix: fix some header css bug ([#31](https://github.com/hugo-fixit/FixIt/issues/31))
|
||||
- :sparkles: Feat: enhance link render ([#96](https://github.com/hugo-fixit/FixIt/issues/96))
|
||||
- Add external icon for external links automatically
|
||||
- Add download icon for downloadable links
|
||||
- :sparkles: Feat: add giscus comment system ([#130](https://github.com/hugo-fixit/FixIt/issues/130))
|
||||
- :sparkles: Feat: link shortcode add `external-icon` option ([#96](https://github.com/hugo-fixit/FixIt/issues/96))
|
||||
- :sparkles: Feat: add GitHub Corners support ([#106](https://github.com/hugo-fixit/FixIt/issues/106))
|
||||
- :sparkles: Feat: add local avatar and gravatar support for post author ([#125](https://github.com/hugo-fixit/FixIt/issues/125))
|
||||
- :sparkles: Feat: add ~~total word count support in footer~~ ([#124](https://github.com/hugo-fixit/FixIt/issues/124))
|
||||
- :sparkles: Feat: add "Edit this page" button support ([#103](https://github.com/hugo-fixit/FixIt/issues/103))
|
||||
- :sparkles: Feat: add count badge for taxonomy ([#122](https://github.com/hugo-fixit/FixIt/issues/122))
|
||||
- :zap: Perf: add Gravatar config support
|
||||
- :bug: Fix: invalid front matter `comment: true` ([#108](https://github.com/hugo-fixit/FixIt/issues/108))
|
||||
- :bug: Fix: ibruce and watermark option negative value error ([#114](https://github.com/hugo-fixit/FixIt/issues/114))
|
||||
- :truck: Feat: *migrate ~~`home.profile.gravatarSite`~~ to `gravatar.host`*
|
||||
- :truck: Feat: *migrate ~~`ibruce.siteTime`~~ to `footer.siteTime`*
|
||||
- :lipstick: Style: add some common CSS styles Class ([#101](https://github.com/hugo-fixit/FixIt/issues/101))
|
||||
- :lipstick: Style: add the gap between and icon and text at blending typesetting (@ctj12461, @Lruihao[#118](https://github.com/hugo-fixit/FixIt/pull/118))
|
||||
- :lipstick: Style: modify blockquote CSS
|
||||
- :memo: Docs: revise theme documentations
|
||||
- :zap: Perf: remove third-party library clipboard.js ([#84](https://github.com/hugo-fixit/FixIt/issues/84))
|
||||
- :pencil2: Docs: fix highlight url typo in `theme-documentation-built-in-shortcodes` (@d-baer[#85](https://github.com/hugo-fixit/FixIt/pull/85))
|
||||
- :wrench: Chore(i18n): improve translations for the supported languages ([#119](https://github.com/hugo-fixit/FixIt/issues/119))
|
||||
- :wrench: Chore(i18n): add i18n support for console messages
|
||||
- :wrench: Chore: add deprecated parameter detection in cli
|
||||
- :arrow_up: Chore: update some third-party libraries
|
||||
- :wrench: Chore(deps-dev):
|
||||
- Bump minimist from 1.2.5 to 1.2.6 ([#92](https://github.com/hugo-fixit/FixIt/pull/92))
|
||||
- Bump @babel/core from 7.17.5 to 7.17.10 ([#126](https://github.com/hugo-fixit/FixIt/pull/126))
|
||||
- Bump core-js from 3.21.1 to 3.22.5 ([#129](https://github.com/hugo-fixit/FixIt/pull/129))
|
||||
- Bump @babel/cli from 7.17.6 to 7.17.10 ([#127](https://github.com/hugo-fixit/FixIt/pull/127))
|
||||
- Bump @babel/preset-env from 7.16.11 to 7.17.10 ([`bc74d14`](https://github.com/hugo-fixit/FixIt/commit/bc74d149c16b36644fecdd5bef325bf8087f8593))
|
||||
- **Full Changelog:** @Lruihao [`v0.2.13...v0.2.14`](https://github.com/hugo-fixit/FixIt/compare/v0.2.13...v0.2.14)
|
||||
|
||||
## v0.2.13 [2022.3.14]
|
||||
|
||||
> Improve and add some new features.
|
||||
> Snapshot: <https://fixit-bbh5g5x90-lruihao.vercel.app>
|
||||
|
||||
- :recycle: Refactor: page layout ([#65](https://github.com/hugo-fixit/FixIt/issues/65))
|
||||
- :tada: Feat: add Artalk comment support ([#54](https://github.com/hugo-fixit/FixIt/issues/54), @hiifong[#57](https://github.com/hugo-fixit/FixIt/pull/57))
|
||||
- :tada: Feat: add Waline comment support ([#36](https://github.com/hugo-fixit/FixIt/issues/36))
|
||||
- :tada: Feat: add Twikoo comment support ([#64](https://github.com/hugo-fixit/FixIt/issues/64))
|
||||
- :sparkles: Feat: add recently updated section ([#50](https://github.com/hugo-fixit/FixIt/issues/50))
|
||||
- :sparkles: Feat: add article expiration reminder support ([#51](https://github.com/hugo-fixit/FixIt/issues/51))
|
||||
- :sparkles: Feat: add pageStyle option ([#62](https://github.com/hugo-fixit/FixIt/issues/62))
|
||||
- :sparkles: Style: add media style for print view ([#61](https://github.com/hugo-fixit/FixIt/issues/61))
|
||||
- :sparkles: Feat: add Gravatar mirror site support (@ctj12461[#66](https://github.com/hugo-fixit/FixIt/pull/66))
|
||||
- :sparkles: Feat: add archive count display ([#33](https://github.com/hugo-fixit/FixIt/issues/33))
|
||||
- :sparkles: Feat: add `details` shortcode ([#68](https://github.com/hugo-fixit/FixIt/issues/68))
|
||||
- :sparkles: Feat: add `center-quote` shortcode ([#69](https://github.com/hugo-fixit/FixIt/issues/69))
|
||||
- :sparkles: Feat: add markdown support for **title** parameter of the admonition shortcode
|
||||
- :sparkles: Feat: add 9 newly supported social links ([#17](https://github.com/hugo-fixit/FixIt/issues/17))
|
||||
- :zap: Perf: enhance highlight feature (GitHub syntax supported) and fix some css bugs ([#43](https://github.com/hugo-fixit/FixIt/issues/43))
|
||||
- Inline Code
|
||||
- Indented Code
|
||||
- Block Fenced Code
|
||||
- gist shortcode
|
||||
- :sparkles: Feat: add `params.page.code.edit` option support ([#76](https://github.com/hugo-fixit/FixIt/issues/76))
|
||||
- :mag: Feat: add 360 and sougou seo support
|
||||
- :bug: Fix: remove source map of local libraries to avoid 404 error ([#67](https://github.com/hugo-fixit/FixIt/issues/67))
|
||||
- :fire: Feat: remove shortcode cardlink ([#42](https://github.com/hugo-fixit/FixIt/issues/42))
|
||||
- :lipstick: Style: more refined theme style ([#40](https://github.com/hugo-fixit/FixIt/issues/40))
|
||||
- :pencil2: Style: fix typo *discription* should be **description** ([#60](https://github.com/hugo-fixit/FixIt/issues/60))
|
||||
- :wrench: Chore(update-libs):
|
||||
- Update cell-watermark 1.0.3 and CDN support (fontFamily supported)
|
||||
- Update animate.css 3.7.2 -> 4.1.1 ([#74](https://github.com/hugo-fixit/FixIt/issues/74))
|
||||
- :wrench: Chore: add atomic-algolia for exampleSite ([#70](https://github.com/hugo-fixit/FixIt/issues/70))
|
||||
- **Full Changelog:** @Lruihao [`v0.2.12...v0.2.13`](https://github.com/hugo-fixit/FixIt/compare/v0.2.12...v0.2.13)
|
||||
|
||||
## v0.2.12 [2022-1-27]
|
||||
|
||||
> Fix most known bugs and add some new features.
|
||||
> Snapshot: <https://fixit-e9lpwfkbp-lruihao.vercel.app>
|
||||
|
||||
- :tada: Feat: add PWA support
|
||||
- :tada: Feat: add Watermark support ([#16](https://github.com/hugo-fixit/FixIt/issues/16))
|
||||
- :tada: Feat: add "不蒜子" count and site run time ([#18](https://github.com/hugo-fixit/FixIt/issues/18))
|
||||
- :sparkles: Feat: add pangu.js support ([#20](https://github.com/hugo-fixit/FixIt/issues/20))
|
||||
- :sparkles: Feat: add public network security config (only in China) ([#15](https://github.com/hugo-fixit/FixIt/issues/15))
|
||||
- :sparkles: Feat: add CustomJS option ([#24](https://github.com/hugo-fixit/FixIt/issues/24))
|
||||
- :sparkles: Feat: add theme embedded archeTypes
|
||||
- :mag: Feat(SEO): optimize SEO meta ([#30](https://github.com/hugo-fixit/FixIt/issues/30))
|
||||
- :zap: Feat: remove lib smooth-scroll ([#1](https://github.com/hugo-fixit/FixIt/issues/1)) replaced by CSS native properties scroll-margin, scroll-behavior ([#39](https://github.com/hugo-fixit/FixIt/issues/39))
|
||||
- :zap: Perf: merge shortcode cardlink (deprecated v0.2.13) into shortcode link and add 'download' param ([#42](https://github.com/hugo-fixit/FixIt/issues/42))
|
||||
- :zap: Perf: optimize JS loading ([#25](https://github.com/hugo-fixit/FixIt/issues/25))
|
||||
- :recycle: Refactor: header title DOM and add subtitle option ([#26](https://github.com/hugo-fixit/FixIt/issues/26))
|
||||
- :bug: Fix: set mermaid theme as 'default' when initialization ([#38](https://github.com/hugo-fixit/FixIt/issues/38))
|
||||
- :bug: Fix: typeit print code error ([#19](https://github.com/hugo-fixit/FixIt/issues/19))
|
||||
- :bug: Fix: pre element overflow error ([#29](https://github.com/hugo-fixit/FixIt/issues/29))
|
||||
- :bug: Fix: toc display error without content header ([#21](https://github.com/hugo-fixit/FixIt/issues/21))
|
||||
- :lipstick: Style: style detail adjustments, change scroll-behavior to smooth, taxonomy, header, footer, shortcode style etc.
|
||||
- :pencil: Docs: improve demo site documentation ([#37](https://github.com/hugo-fixit/FixIt/issues/37))
|
||||
- :wrench: Chore: add commands `fixit_checker.sh`
|
||||
- :wrench: Chore(i18n): change some translations
|
||||
- :arrow_up: Chore: update all third-party libraries
|
||||
- **Full Changelog:** @Lruihao [`v0.2.11...v0.2.12`](https://github.com/hugo-fixit/FixIt/compare/v0.2.11...v0.2.12)
|
||||
|
||||
## v0.2.11 [2021-12-19]
|
||||
|
||||
> :tada: The beginning of FixIt to fix the theme LoveIt.
|
||||
|
||||
- :sparkles: Feat: add cardlink shortcode ([Lruihao/hugo-blog@`df9eca2`](https://github.com/Lruihao/hugo-blog/commit/df9eca26af43287748fd8d4654014357a8269b0b))
|
||||
- :tada: Feat: add friends layout template
|
||||
- :wrench: Chore(i18n): add translations for Traditional Chinese ([Lruihao/hugo-blog@`df9eca2`](https://github.com/Lruihao/hugo-blog/commit/b86157d8b84830bda415ab2488580afd843acac2))
|
||||
- :bug: Fix: mobile style ([Lruihao/hugo-blog#19](https://github.com/Lruihao/hugo-blog/issues/19))
|
||||
- :bug: Style: fix content h1 style ([Lruihao/hugo-blog#8](https://github.com/Lruihao/hugo-blog/issues/8))
|
||||
- :bug: Fix: `.params.author` should be `$params.author` ([Lruihao/hugo-blog#1](https://github.com/Lruihao/hugo-blog/issues/1))
|
||||
- **Full Changelog:** @Lruihao [`v0.2.10...v0.2.11`](https://github.com/hugo-fixit/FixIt/compare/v0.2.10...v0.2.11)
|
||||
|
||||
## v0.2.10 :arrow_down: [2020-5-29 before]
|
||||
|
||||
Thanks [dillonzq/LoveIt](https://github.com/dillonzq/LoveIt/releases)
|
||||
@@ -7,7 +7,7 @@ First, fork this repository by clicking the fork button.
|
||||
Next, clone your forked repo.
|
||||
|
||||
```bash
|
||||
git clone --recursive https://github.com/hugo-fixit/FixIt.git && cd FixIt
|
||||
git clone https://github.com/hugo-fixit/FixIt.git && cd FixIt
|
||||
```
|
||||
|
||||
Then, install the dev dependencies.
|
||||
@@ -21,19 +21,16 @@ And now you are ready to go!
|
||||
Here are some useful commands.
|
||||
|
||||
```bash
|
||||
# build theme.js with babel
|
||||
npm run babel
|
||||
# build theme.js and then build the static site
|
||||
npm run build
|
||||
# run a local debugging server with watch
|
||||
npm run server
|
||||
# run a local debugging server with watch in production environment
|
||||
npm run server:production
|
||||
# build theme.js and then run a local debugging server
|
||||
npm run start
|
||||
# build theme.js and then run a local debugging server in production environment
|
||||
npm run start:production
|
||||
```
|
||||
|
||||
If you want to do docs-related theme changes, the simplest way is to have both `FixIt` and `fixit-docs` cloned as sibling directories, and then run:
|
||||
|
||||
```bash
|
||||
npm run server:docs
|
||||
```
|
||||
|
||||
Finally, create a new pull request at <https://github.com/hugo-fixit/FixIt/pulls> to submit your contribution 🎉
|
||||
|
||||
@@ -2,7 +2,7 @@ The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2018 LIUZHICHAO.COM
|
||||
Copyright (c) 2019-2020 DILLONZQ.COM
|
||||
Copyright (c) 2021-2023 LRUIHAO.CN
|
||||
Copyright (c) 2021-2024 Lruihao (https://lruihao.cn)
|
||||
|
||||
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
|
||||
|
||||
@@ -1,170 +1,130 @@
|
||||
# FixIt Theme | Hugo
|
||||
|
||||
[](https://github.com/hugo-fixit/FixIt/releases)
|
||||
[](https://gohugo.io/)
|
||||
[](https://gohugo.io/)
|
||||
[](/LICENSE)
|
||||
|
||||
👉 English README | [简体中文说明](README.zh-cn.md)
|
||||
|
||||
> [FixIt](https://github.com/hugo-fixit/FixIt) is a **clean**, **elegant** but **advanced** blog theme for [Hugo](https://gohugo.io/).
|
||||
[FixIt](https://github.com/hugo-fixit/FixIt) is a **clean**, **elegant** but **advanced** blog theme for [Hugo](https://gohugo.io/).
|
||||
|
||||
It is based on the original [LoveIt Theme](https://github.com/dillonzq/LoveIt), [KeepIt Theme](https://github.com/Fastbyte01/KeepIt) and [LeaveIt Theme](https://github.com/liuzc/LeaveIt).
|
||||
It is based on the original [LoveIt Theme](https://github.com/dillonzq/LoveIt), [KeepIt Theme](https://github.com/Fastbyte01/KeepIt) and [LeaveIt Theme](https://github.com/liuzc/LeaveIt).[^1]
|
||||
|
||||
The FixIt theme inherits the excellent features of these themes, and adds new features and optimizations on those basis. Please read [Why Choose FixIt](#why-choose-fixit) to learn more.
|
||||

|
||||
|
||||

|
||||
## Getting started
|
||||
|
||||
## [Getting started](https://fixit.lruihao.cn/categories/documentation/)
|
||||
- [Installation](https://fixit.lruihao.cn/documentation/installation/)
|
||||
- [Getting Started](https://fixit.lruihao.cn/documentation/getting-started/)
|
||||
- [Content Management](https://fixit.lruihao.cn/documentation/content-management/)
|
||||
- [Advanced Usage](https://fixit.lruihao.cn/documentation/advanced/)
|
||||
|
||||
Head to this [documentation page](https://fixit.lruihao.cn/theme-documentation-basics/) for a complete guidence to get started with the FixIt theme.
|
||||
Alternatively, you can run the [documentation site](https://fixit.lruihao.cn/) locally. For more details, see [hugo-fixit/docs](https://github.com/hugo-fixit/docs).
|
||||
|
||||
Or run [Documentation Site](https://fixit.lruihao.cn) locally:
|
||||
## Template repository
|
||||
|
||||
```bash
|
||||
git clone --recursive https://github.com/hugo-fixit/FixIt.git && cd FixIt
|
||||
|
||||
hugo server --source=docs
|
||||
```
|
||||
|
||||
In addition, there is the [FixIt wiki](https://github.com/hugo-fixit/FixIt/wiki).
|
||||
|
||||
## Install or Migrate
|
||||
|
||||
If you are currently using the LoveIt theme (or some other themes), it is very easy to migrate to FixIt.
|
||||
|
||||
You can add this repo as a submodule of your site directory. Alternatively, you can [install the theme](https://fixit.lruihao.cn/theme-documentation-basics/#install-theme) in other ways.
|
||||
|
||||
```bash
|
||||
git submodule add https://github.com/hugo-fixit/FixIt.git themes/FixIt
|
||||
```
|
||||
|
||||
And later you can update the submodule in your site directory to the latest commit using this command:
|
||||
|
||||
```bash
|
||||
git submodule update --remote --merge
|
||||
```
|
||||
|
||||
Next, go to the `config.toml` and change the default theme to `FixIt`.
|
||||
|
||||
```diff
|
||||
- theme = "LoveIt"
|
||||
+ theme = "FixIt"
|
||||
```
|
||||
|
||||
Now the migration is finished and everything is ready 🎉
|
||||
|
||||
## Why choose FixIt
|
||||
|
||||
The FixIt theme inherits the excellent features of themes such as LoveIt, and adds new features and optimizations on those basis, as detailed in [Features](#features). In addition, the FixIt theme has the following advantages:
|
||||
|
||||
* Complete Chinese and English official documentations
|
||||
* Community support: Theme official website, Discussions and official QQ group
|
||||
* Continuously and actively update
|
||||
* Constantly incorporate suggestions and ideas from all sides
|
||||
* Highly open theme customizable section
|
||||
|
||||
In short, if you prefer the design language and freedom of the FixIt theme, and if you like to personalize your own themes as I do, the FixIt theme may be more suitable for you.
|
||||
- [hugo-fixit/hugo-fixit-start](https://github.com/hugo-fixit/hugo-fixit-start)
|
||||
- [hugo-fixit/hugo-fixit-start1](https://github.com/hugo-fixit/hugo-fixit-start1)
|
||||
- [hugo-fixit/docs](https://github.com/hugo-fixit/docs)
|
||||
- [Lruihao/hugo-blog](https://github.com/Lruihao/hugo-blog)
|
||||
|
||||
## Who used FixIt
|
||||
|
||||
To see this theme in action, here are some [live demo sites](https://fixit.lruihao.cn/friends/) which are rendered with **FixIt** theme.
|
||||
|
||||
| Site | Repo |
|
||||
| :----------------------------------------------------------- | :----------------------------------------------------------- |
|
||||
| [FixIt Theme Official Website](https://fixit.lruihao.cn), [FixIt Preview](https://pre.fixit.lruihao.cn) | [hugo-fixit/docs](https://github.com/hugo-fixit/docs) |
|
||||
| [FixIt Blog Template - Git](https://demo.fixit.lruihao.cn) | [hugo-fixit/hugo-fixit-blog-git](https://github.com/hugo-fixit/hugo-fixit-blog-git) |
|
||||
| [FixIt Blog Template - Go](https://demo.fixit.lruihao.cn) | [hugo-fixit/hugo-fixit-blog-go](https://github.com/hugo-fixit/hugo-fixit-blog-go) |
|
||||
| [Lruihao's note](https://lruihao.cn) | [Lruihao/hugo-blog](https://github.com/Lruihao/hugo-blog) |
|
||||
|
||||
## Features
|
||||
|
||||
### Performance and SEO
|
||||
|
||||
* Optimized for **performance**: 99/100 on mobile and 100/100 on desktop in [Google PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights)
|
||||
* Optimized SEO performance with a correct **SEO SCHEMA** based on JSON-LD
|
||||
* **[Google Analytics](https://analytics.google.com/analytics)** supported
|
||||
* **[Fathom Analytics](https://usefathom.com/)** supported
|
||||
* Search engine **verification** supported (Google, Bing, Yandex, Pinterest, Baidu, 360 and Sogou)
|
||||
* **CDN** for third-party libraries supported
|
||||
* Automatically converted images with **Lazy Load** by [lazysizes](https://github.com/aFarkas/lazysizes)
|
||||
- Optimized for **performance**: 99/100 on mobile and 100/100 on desktop in [Google PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights)
|
||||
- Optimized SEO performance with a correct **SEO SCHEMA** based on JSON-LD
|
||||
- **[Google Analytics](https://analytics.google.com/analytics)** supported
|
||||
- **[Fathom Analytics](https://usefathom.com/)** supported
|
||||
- Search engine **verification** supported (Google, Bing, Yandex, Pinterest, Baidu, 360 and Sogou)
|
||||
- **CDN** for third-party libraries supported
|
||||
|
||||
### Appearance and Layout
|
||||
|
||||
* **Responsive** layout
|
||||
* **Light/Dark** mode
|
||||
* Globally consistent **design language**
|
||||
* **Pagination** supported
|
||||
* Easy-to-use and self-expanding **table of contents**
|
||||
* **Multilanguage** supported and i18n ready
|
||||
* Beautiful **CSS animation**
|
||||
- **Responsive** layout
|
||||
- **Light/Dark** mode
|
||||
- Globally consistent **design language**
|
||||
- **Pagination** supported
|
||||
- Easy-to-use and self-expanding **table of contents**
|
||||
- **Multilanguage** supported and i18n ready
|
||||
- Beautiful **CSS animation**
|
||||
|
||||
### Social and Comment Systems
|
||||
|
||||
* **Gravatar** supported by [Gravatar](https://gravatar.com)
|
||||
* Local **Avatar** supported
|
||||
* Up to **87** social links supported
|
||||
* Up to **28** share sites supported
|
||||
* **Disqus** comment system supported by [Disqus](https://disqus.com)
|
||||
* **Gitalk** comment system supported by [Gitalk](https://github.com/gitalk/gitalk)
|
||||
* **Valine** comment system supported by [Valine](https://valine.js.org/)
|
||||
* **Waline** comment system supported by [Waline](https://waline.js.org/)
|
||||
* **Facebook comments** system supported by [Facebook](https://developers.facebook.com/docs/plugins/comments/)
|
||||
* **Telegram comments** system supported by [Telegram Comments](https://comments.app/)
|
||||
* **Commento** comment system supported by [Commento](https://commento.io/)
|
||||
* **Utterances** comment system supported by [Utterances](https://utteranc.es/)
|
||||
* **Artalk** comment system supported by [Artalk](https://artalk.js.org/)
|
||||
* **Twikoo** comment system supported by [Twikoo](https://twikoo.js.org/)
|
||||
* **giscus** comment system supported by [giscus](https://giscus.app/)
|
||||
- **Gravatar** supported by [Gravatar](https://gravatar.com)
|
||||
- Local **Avatar** supported
|
||||
- Up to **87** social links supported
|
||||
- Up to **28** share sites supported
|
||||
- **Disqus** comment system supported by [Disqus](https://disqus.com)
|
||||
- **Gitalk** comment system supported by [Gitalk](https://github.com/gitalk/gitalk)
|
||||
- **Valine** comment system supported by [Valine](https://valine.js.org/)
|
||||
- **Waline** comment system supported by [Waline](https://waline.js.org/)
|
||||
- **Facebook comments** system supported by [Facebook](https://developers.facebook.com/docs/plugins/comments/)
|
||||
- **Telegram comments** system supported by [Telegram Comments](https://comments.app/)
|
||||
- **Commento** comment system supported by [Commento](https://commento.io/)
|
||||
- **Utterances** comment system supported by [Utterances](https://utteranc.es/)
|
||||
- **Artalk** comment system supported by [Artalk](https://artalk.js.org/)
|
||||
- **Twikoo** comment system supported by [Twikoo](https://twikoo.js.org/)
|
||||
- **giscus** comment system supported by [giscus](https://giscus.app/)
|
||||
|
||||
### Extended Features
|
||||
|
||||
* **PWA (Progressive Web App)** supported
|
||||
* **Sub Menu** supported
|
||||
* **Content Encryption** supported (Pages, Partial)
|
||||
* **Friends** page embedded template
|
||||
* **Search** supported by [Lunr.js](https://lunrjs.com/) or [algolia](https://www.algolia.com/) or [Fuse.js](https://fusejs.io/)
|
||||
* **Twemoji** supported
|
||||
* Automatically **highlighting** code
|
||||
* **Copy code** to clipboard with one click
|
||||
* **Images gallery** supported by [lightgallery](https://github.com/sachinchoolur/lightgallery)
|
||||
* Extended Markdown syntax for **[Font Awesome](https://fontawesome.com/) icons**
|
||||
* Extended Markdown syntax for **ruby annotation**
|
||||
* Extended Markdown syntax for **fraction**
|
||||
* **Mathematical formula** supported by [KaTeX](https://katex.org/)
|
||||
* **Diagrams** shortcode supported by [mermaid](https://github.com/knsv/mermaid)
|
||||
* **Interactive data visualization** shortcode supported by [ECharts](https://echarts.apache.org/)
|
||||
* **Mapbox** shortcode supported by [Mapbox GL JS](https://docs.mapbox.com/mapbox-gl-js)
|
||||
* **Music player** shortcode supported by [APlayer](https://github.com/MoePlayer/APlayer) and [MetingJS](https://github.com/metowolf/MetingJS)
|
||||
* **Bilibili player** shortcode
|
||||
* Kinds of **admonitions** shortcode
|
||||
* **Custom style** shortcode
|
||||
* **Custom script** shortcode
|
||||
* **Animated typing** supported by [TypeIt](https://typeitjs.com/)
|
||||
* **Cookie consent banner** supported by [cookieconsent](https://github.com/osano/cookieconsent)
|
||||
* **Web Watermark** supported by [cell-watermark](https://github.com/Lruihao/watermark)
|
||||
* **Chinese typesetting** supported by [pangu.js](https://github.com/vinta/pangu.js)
|
||||
* ...
|
||||
- **PWA (Progressive Web App)** supported
|
||||
- **Sub Menu** supported
|
||||
- **Content Encryption** supported (Pages, Partial)
|
||||
- **Friends** page embedded template
|
||||
- **Search** supported by [algolia](https://www.algolia.com/) or [Fuse.js](https://fusejs.io/)
|
||||
- **Twemoji** supported
|
||||
- Automatically **highlighting** code
|
||||
- **Copy code** to clipboard with one click
|
||||
- **Images gallery** supported by [lightgallery](https://github.com/sachinchoolur/lightgallery)
|
||||
- Extended Markdown syntax for **[Font Awesome](https://fontawesome.com/) icons**
|
||||
- Extended Markdown syntax for **ruby annotation**
|
||||
- Extended Markdown syntax for **fraction**
|
||||
- **Mathematical formula** supported by [KaTeX](https://katex.org/)
|
||||
- **Diagrams** shortcode supported by [mermaid](https://github.com/knsv/mermaid)
|
||||
- **Interactive data visualization** shortcode supported by [ECharts](https://echarts.apache.org/)
|
||||
- **Mapbox** shortcode supported by [Mapbox GL JS](https://docs.mapbox.com/mapbox-gl-js)
|
||||
- **Music player** shortcode supported by [APlayer](https://github.com/MoePlayer/APlayer) and [MetingJS](https://github.com/metowolf/MetingJS)
|
||||
- **Bilibili player** shortcode
|
||||
- Kinds of **admonitions** shortcode
|
||||
- **Custom style** shortcode
|
||||
- **Custom script** shortcode
|
||||
- **Animated typing** supported by [TypeIt](https://typeitjs.com/)
|
||||
- **Cookie consent banner** supported by [cookieconsent](https://github.com/osano/cookieconsent)
|
||||
- **Web Watermark** supported by [cell-watermark](https://github.com/Lruihao/watermark)
|
||||
- **Chinese typesetting** supported by [pangu.js](https://github.com/vinta/pangu.js)
|
||||
- Options to **cache remote image** locally
|
||||
- ...
|
||||
|
||||
### Theme Components
|
||||
|
||||
The FixIt theme balances **simplicity** and **extensibility** with extra [Hugo theme components](https://fixit.lruihao.cn/components/) for customization.
|
||||
|
||||
## Multilingual and i18n
|
||||
|
||||
FixIt supports the following languages:
|
||||
|
||||
* English
|
||||
* Simplified Chinese
|
||||
* Traditional Chinese
|
||||
* French
|
||||
* Polish
|
||||
* Brazilian Portuguese
|
||||
* Italian
|
||||
* Spanish
|
||||
* German
|
||||
* Serbian
|
||||
* Russian
|
||||
* Romanian
|
||||
* Vietnamese
|
||||
* [Contribute with a new language](https://github.com/hugo-fixit/FixIt/pulls)
|
||||
- English
|
||||
- Simplified Chinese
|
||||
- Traditional Chinese
|
||||
- French
|
||||
- Polish
|
||||
- Brazilian Portuguese
|
||||
- Italian
|
||||
- Spanish
|
||||
- German
|
||||
- Serbian
|
||||
- Russian
|
||||
- Romanian
|
||||
- Vietnamese
|
||||
- [Contribute with a new language](https://github.com/hugo-fixit/FixIt/pulls)
|
||||
|
||||
[Languages Compatibility](https://fixit.lruihao.cn/theme-documentation-basics/#language-compatibility)
|
||||
[Languages Compatibility](https://fixit.lruihao.cn/documentation/basics/#language-compatibility)
|
||||
|
||||
## [Roadmap](https://github.com/hugo-fixit/FixIt/projects/1)
|
||||
|
||||
@@ -186,53 +146,51 @@ Make sure that you follow [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) while contrib
|
||||
|
||||
## Acknowledgements
|
||||
|
||||
<details open>
|
||||
<details>
|
||||
<summary>Thanks to the authors of following resources included in the theme:</summary>
|
||||
|
||||
* [normalize.css](https://github.com/necolas/normalize.css)
|
||||
* [Font Awesome](https://fontawesome.com/)
|
||||
* [Simple Icons](https://github.com/simple-icons/simple-icons)
|
||||
* [Animate.css](https://daneden.github.io/animate.css/)
|
||||
* [autocomplete-js](https://github.com/algolia/autocomplete)
|
||||
* [Lunr.js](https://lunrjs.com/)
|
||||
* [algoliasearch](https://github.com/algolia/algoliasearch-client-javascript)
|
||||
* [Fuse.js](https://fusejs.io/)
|
||||
* [lazysizes](https://github.com/aFarkas/lazysizes)
|
||||
* [object-fit-images](https://github.com/fregante/object-fit-images)
|
||||
* [Twemoji](https://github.com/twitter/twemoji)
|
||||
* [emoji-data](https://github.com/iamcal/emoji-data)
|
||||
* [lightgallery](https://github.com/sachinchoolur/lightgallery)
|
||||
* [Sharer.js](https://github.com/ellisonleao/sharer.js)
|
||||
* [TypeIt](https://typeitjs.com/)
|
||||
* [KaTeX](https://katex.org/)
|
||||
* [mermaid](https://github.com/mermaid-js/mermaid)
|
||||
* [ECharts](https://echarts.apache.org/)
|
||||
* [Mapbox GL JS](https://docs.mapbox.com/mapbox-gl-js)
|
||||
* [APlayer](https://github.com/MoePlayer/APlayer)
|
||||
* [MetingJS](https://github.com/metowolf/MetingJS)
|
||||
* [Gitalk](https://github.com/gitalk/gitalk)
|
||||
* [Valine](https://valine.js.org/)
|
||||
* [cookieconsent](https://github.com/osano/cookieconsent)
|
||||
* [cell-watermark](https://github.com/Lruihao/watermark)
|
||||
* [不蒜子](http://busuanzi.ibruce.info/)
|
||||
* [pangu.js](https://github.com/vinta/pangu.js)
|
||||
* [Artalk](https://artalk.js.org/)
|
||||
* [Waline](https://waline.js.org/)
|
||||
* [Twikoo](https://twikoo.js.org/)
|
||||
* [github-corners](https://github.com/tholman/github-corners)
|
||||
* [giscus](https://giscus.app/)
|
||||
* [crypto-js](https://github.com/brix/crypto-js)
|
||||
* [vConsole](https://github.com/Tencent/vConsole)
|
||||
* [eruda](https://github.com/liriliri/eruda)
|
||||
* [pace](https://github.com/CodeByZach/pace)
|
||||
- [normalize.css](https://github.com/necolas/normalize.css)
|
||||
- [Font Awesome](https://fontawesome.com/)
|
||||
- [Simple Icons](https://github.com/simple-icons/simple-icons)
|
||||
- [Animate.css](https://daneden.github.io/animate.css/)
|
||||
- [autocomplete-js](https://github.com/algolia/autocomplete)
|
||||
- [algoliasearch](https://github.com/algolia/algoliasearch-client-javascript)
|
||||
- [Fuse.js](https://fusejs.io/)
|
||||
- [object-fit-images](https://github.com/fregante/object-fit-images)
|
||||
- [Twemoji](https://github.com/twitter/twemoji)
|
||||
- [emoji-data](https://github.com/iamcal/emoji-data)
|
||||
- [lightgallery](https://github.com/sachinchoolur/lightgallery)
|
||||
- [Sharer.js](https://github.com/ellisonleao/sharer.js)
|
||||
- [TypeIt](https://typeitjs.com/)
|
||||
- [KaTeX](https://katex.org/)
|
||||
- [mermaid](https://github.com/mermaid-js/mermaid)
|
||||
- [ECharts](https://echarts.apache.org/)
|
||||
- [Mapbox GL JS](https://docs.mapbox.com/mapbox-gl-js)
|
||||
- [APlayer](https://github.com/MoePlayer/APlayer)
|
||||
- [MetingJS](https://github.com/metowolf/MetingJS)
|
||||
- [Gitalk](https://github.com/gitalk/gitalk)
|
||||
- [Valine](https://valine.js.org/)
|
||||
- [cookieconsent](https://github.com/osano/cookieconsent)
|
||||
- [cell-watermark](https://github.com/Lruihao/watermark)
|
||||
- [不蒜子](http://busuanzi.ibruce.info/)
|
||||
- [pangu.js](https://github.com/vinta/pangu.js)
|
||||
- [Artalk](https://artalk.js.org/)
|
||||
- [Waline](https://waline.js.org/)
|
||||
- [Twikoo](https://twikoo.js.org/)
|
||||
- [github-corners](https://github.com/tholman/github-corners)
|
||||
- [giscus](https://giscus.app/)
|
||||
- [crypto-js](https://github.com/brix/crypto-js)
|
||||
- [vConsole](https://github.com/Tencent/vConsole)
|
||||
- [eruda](https://github.com/liriliri/eruda)
|
||||
- [pace](https://github.com/CodeByZach/pace)
|
||||
|
||||
</details>
|
||||
|
||||
<details open>
|
||||
<details>
|
||||
<summary>The FixIt also draws on some features of the following projects, and thanks to their authors as well:</summary>
|
||||
|
||||
* [DoIt](https://github.com/HEIGE-PCloud/DoIt)
|
||||
* [NexT](https://github.com/next-theme/hexo-theme-next)
|
||||
- [DoIt](https://github.com/HEIGE-PCloud/DoIt)
|
||||
- [NexT](https://github.com/next-theme/hexo-theme-next)
|
||||
|
||||
</details>
|
||||
|
||||
@@ -242,14 +200,18 @@ FixIt is licensed under the **MIT** license. Check the [LICENSE file](LICENSE) f
|
||||
|
||||
## Author
|
||||
|
||||
[Lruihao](https://lruihao.cn)
|
||||
Follow [Lruihao](https://github.com/Lruihao "Follow me on GitHub")
|
||||
|
||||
## Sponsor
|
||||
|
||||
If you enjoy the theme, please consider buying me a coffee ☕️.
|
||||
[](https://github.com/hugo-fixit/FixIt)
|
||||
|
||||
* [PayPal](https://paypal.me/Lruihao)
|
||||
* [Alipay](images/alipay.gif)
|
||||
* [Wechat](images/wechatpay.gif)
|
||||
If you enjoy the theme, please consider buying me a coffee ☕️. Thanks!
|
||||
|
||||
Thanks! ❤️
|
||||
- [PayPal](https://paypal.me/Lruihao)
|
||||
- [Alipay](images/alipay.jpg)
|
||||
- [Wechat](images/wechatpay.jpg)
|
||||
|
||||
Don't forget to leave a ⭐️ if you like this theme, thanks!
|
||||
|
||||
[^1]: The theme name is interesting: "leave it, keep it, love it, fix it". Appears and leaves, loves but cannot keep. Doesn't it look like that damn love and BUG? 🤣
|
||||
|
||||
@@ -1,170 +1,128 @@
|
||||
# FixIt 主题 | Hugo
|
||||
|
||||
[](https://github.com/hugo-fixit/FixIt/releases)
|
||||
[](https://gohugo.io/)
|
||||
[](https://gohugo.io/)
|
||||
[](/LICENSE)
|
||||
|
||||
👉 [English README](README.md) | 简体中文说明
|
||||
|
||||
> [FixIt](https://github.com/hugo-fixit/FixIt) 是一个**简洁**、**优雅**且**高效**的 [Hugo](https://gohugo.io/) 博客主题。
|
||||
[FixIt](https://github.com/hugo-fixit/FixIt) 是一个**简洁**、**优雅**且**高效**的 [Hugo](https://gohugo.io/) 博客主题。
|
||||
|
||||
它的原型基于 [LoveIt 主题](https://github.com/dillonzq/LoveIt),[KeepIt 主题](https://github.com/Fastbyte01/KeepIt) 和 [LeaveIt 主题](https://github.com/liuzc/LeaveIt)。
|
||||
它的原型基于 [LoveIt 主题](https://github.com/dillonzq/LoveIt),[KeepIt 主题](https://github.com/Fastbyte01/KeepIt) 和 [LeaveIt 主题](https://github.com/liuzc/LeaveIt)。[^1]
|
||||
|
||||
FixIt 主题继承了这些主题的优秀功能,并在此基础上添加了新的功能与优化,请阅读 [为什么选择 FixIt](#为什么选择-FixIt) 来了解更多。
|
||||

|
||||
|
||||

|
||||
## 主题文档
|
||||
|
||||
## [立即开始](https://fixit.lruihao.cn/zh-cn/categories/documentation/)
|
||||
- [安装篇](https://fixit.lruihao.cn/zh-cn/documentation/installation/)
|
||||
- [入门篇](https://fixit.lruihao.cn/zh-cn/documentation/getting-started/)
|
||||
- [内容管理](https://fixit.lruihao.cn/zh-cn/documentation/content-management/)
|
||||
- [进阶篇](https://fixit.lruihao.cn/zh-cn/documentation/advanced/)
|
||||
|
||||
前往这篇 [文档](https://fixit.lruihao.cn/zh-cn/theme-documentation-basics/),阅读关于安装与使用的详细指南。
|
||||
或者在本地运行 [文档站点](https://fixit.lruihao.cn/zh-cn/),更多细节详见 [hugo-fixit/docs](https://github.com/hugo-fixit/docs)。
|
||||
|
||||
或者,在本地构建 [文档](https://fixit.lruihao.cn/zh-cn/):
|
||||
## 模板仓库
|
||||
|
||||
> Gitee 镜像仓库:<https://gitee.com/lruihao/FixIt>
|
||||
|
||||
```bash
|
||||
git clone --recursive https://github.com/hugo-fixit/FixIt.git && cd FixIt
|
||||
|
||||
hugo server --source=docs
|
||||
```
|
||||
|
||||
除此之外,还有 [FixIt 主题维基](https://github.com/hugo-fixit/FixIt/wiki)。
|
||||
|
||||
## 安装或迁移
|
||||
|
||||
如果你现在正在使用 LoveIt 主题(或者一些其他的主题),你可以很容易地迁移至 FixIt。
|
||||
|
||||
你可以将这个主题仓库添加为你的网站目录的子模块。或者,您可以通过其他方式 [安装主题](https://fixit.lruihao.cn/zh-cn/theme-documentation-basics/#install-theme)。
|
||||
|
||||
```bash
|
||||
git submodule add https://github.com/hugo-fixit/FixIt.git themes/FixIt
|
||||
```
|
||||
|
||||
之后,你可以在站点目录通过这条命令来将主题更新至最新版本:
|
||||
|
||||
```bash
|
||||
git submodule update --remote --merge
|
||||
```
|
||||
|
||||
接着,前往 `config.toml` 并将默认主题更改为 `FixIt`。
|
||||
|
||||
```diff
|
||||
- theme = "LoveIt"
|
||||
+ theme = "FixIt"
|
||||
```
|
||||
|
||||
这样就完成了迁移工作,现在一切准备就绪 🎉
|
||||
|
||||
## 为什么选择 FixIt
|
||||
|
||||
FixIt 主题继承了 LoveIt 等主题的优秀功能,并在它们的基础上添加了新的功能与优化,详见 [特性](#特性)。除此之外,FixIt 主题还有以下优点:
|
||||
|
||||
* 完善的中英文官方文档
|
||||
* 社区支持:主题官网、Discussions 和官方 QQ 群
|
||||
* 持续积极地更新
|
||||
* 不断收纳各方的建议和想法
|
||||
* 高度开放主题可自定义部分
|
||||
|
||||
总之,如果你更偏好 FixIt 主题的设计语言和自由度,如果你和我一样喜欢个性化自定义主题,那么,FixIt 主题可能是更适合你。
|
||||
- [hugo-fixit/hugo-fixit-start](https://github.com/hugo-fixit/hugo-fixit-start)
|
||||
- [hugo-fixit/hugo-fixit-start1](https://github.com/hugo-fixit/hugo-fixit-start1)
|
||||
- [hugo-fixit/docs](https://github.com/hugo-fixit/docs)
|
||||
- [Lruihao/hugo-blog](https://github.com/Lruihao/hugo-blog)
|
||||
|
||||
## 谁在用 FixIt
|
||||
|
||||
为了直观地浏览主题特性,这里有一些基于 **FixIt** 主题渲染的 [预览网站](https://fixit.lruihao.cn/zh-cn/friends/)。
|
||||
|
||||
| 站点 | 仓库 |
|
||||
| :----------------------------------------------------------- | :---------------------------------------------------------- |
|
||||
| [FixIt 主题官网](https://fixit.lruihao.cn), [FixIt 预览版](https://pre.fixit.lruihao.cn) | [hugo-fixit/docs](https://github.com/hugo-fixit/docs) |
|
||||
| [FixIt 博客模板 - Git](https://demo.fixit.lruihao.cn) | [hugo-fixit/hugo-fixit-blog-git](https://github.com/hugo-fixit/hugo-fixit-blog-git) |
|
||||
| [FixIt 博客模板 - Go](https://demo.fixit.lruihao.cn) | [hugo-fixit/hugo-fixit-blog-go](https://github.com/hugo-fixit/hugo-fixit-blog-go) |
|
||||
| [李瑞豪的博客](https://lruihao.cn) | [Lruihao/hugo-blog](https://github.com/Lruihao/hugo-blog) |
|
||||
|
||||
## 特性
|
||||
|
||||
### 性能和 SEO
|
||||
|
||||
* **性能**优化:在 [Google PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights) 中, 99/100 的移动设备得分和 100/100 的桌面设备得分
|
||||
* 使用基于 JSON-LD 格式 的 **SEO SCHEMA** 文件进行 SEO 优化
|
||||
* 支持 **[Google Analytics](https://analytics.google.com/analytics)**
|
||||
* 支持 **[Fathom Analytics](https://usefathom.com/)**
|
||||
* 支持搜索引擎的**网站验证** (Google, Bing, Yandex, Pinterest, Baidu, 360 and Sogou)
|
||||
* 支持所有第三方库的 **CDN**
|
||||
* 基于 [lazysizes](https://github.com/aFarkas/lazysizes) 自动转换图片为**懒加载**
|
||||
- **性能**优化:在 [Google PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights) 中,99/100 的移动设备得分和 100/100 的桌面设备得分
|
||||
- 使用基于 JSON-LD 格式 的 **SEO SCHEMA** 文件进行 SEO 优化
|
||||
- 支持 **[Google Analytics](https://analytics.google.com/analytics)**
|
||||
- 支持 **[Fathom Analytics](https://usefathom.com/)**
|
||||
- 支持搜索引擎的**网站验证** (Google, Bing, Yandex, Pinterest, Baidu, 360 and Sogou)
|
||||
- 支持所有第三方库的 **CDN**
|
||||
|
||||
### 外观和布局
|
||||
|
||||
* **响应式**布局
|
||||
* **浅色/深色** 主题模式
|
||||
* 全局一致的**设计语言**
|
||||
* 支持**分页**
|
||||
* 易用和自动展开的**文章目录**
|
||||
* 支持**多语言**和国际化
|
||||
* 美观的 **CSS 动画**
|
||||
- **响应式**布局
|
||||
- **浅色/深色** 主题模式
|
||||
- 全局一致的**设计语言**
|
||||
- 支持**分页**
|
||||
- 易用和自动展开的**文章目录**
|
||||
- 支持**多语言**和国际化
|
||||
- 美观的 **CSS 动画**
|
||||
|
||||
### 社交和评论系统
|
||||
|
||||
* 支持 **[Gravatar](https://gravatar.com)** 头像
|
||||
* 支持本地**头像**
|
||||
* 支持多达 **87** 种社交链接
|
||||
* 支持多达 **28** 种网站分享
|
||||
* 支持 **[Disqus](https://disqus.com)** 评论系统
|
||||
* 支持 **[Gitalk](https://github.com/gitalk/gitalk)** 评论系统
|
||||
* 支持 **[Valine](https://valine.js.org/)** 评论系统
|
||||
* 支持 **[Waline](https://waline.js.org/)** 评论系统
|
||||
* 支持 **[Facebook](https://developers.facebook.com/docs/plugins/comments/) 评论**系统
|
||||
* 支持 **[Telegram comments](https://comments.app/) 评论**系统
|
||||
* 支持 **[Commento](https://commento.io/)** 评论系统
|
||||
* 支持 **[Utterances](https://utteranc.es/)** 评论系统
|
||||
* 支持 **[Artalk](https://artalk.js.org/)** 评论系统
|
||||
* 支持 **[Twikoo](https://twikoo.js.org/)** 评论系统
|
||||
* 支持 **[giscus](https://giscus.app/zh-CN/)** 评论系统
|
||||
- 支持 **[Gravatar](https://gravatar.com)** 头像
|
||||
- 支持本地**头像**
|
||||
- 支持多达 **87** 种社交链接
|
||||
- 支持多达 **28** 种网站分享
|
||||
- 支持 **[Disqus](https://disqus.com)** 评论系统
|
||||
- 支持 **[Gitalk](https://github.com/gitalk/gitalk)** 评论系统
|
||||
- 支持 **[Valine](https://valine.js.org/)** 评论系统
|
||||
- 支持 **[Waline](https://waline.js.org/)** 评论系统
|
||||
- 支持 **[Facebook](https://developers.facebook.com/docs/plugins/comments/) 评论**系统
|
||||
- 支持 **[Telegram comments](https://comments.app/) 评论**系统
|
||||
- 支持 **[Commento](https://commento.io/)** 评论系统
|
||||
- 支持 **[Utterances](https://utteranc.es/)** 评论系统
|
||||
- 支持 **[Artalk](https://artalk.js.org/)** 评论系统
|
||||
- 支持 **[Twikoo](https://twikoo.js.org/)** 评论系统
|
||||
- 支持 **[giscus](https://giscus.app/zh-CN/)** 评论系统
|
||||
|
||||
### 扩展功能
|
||||
|
||||
* 支持**渐进式网页应用**
|
||||
* 支持**二级菜单**
|
||||
* 支持**内容加密**(页面、局部)
|
||||
* 支持**友情链接**的页面模板
|
||||
* 支持基于 [Lunr.js](https://lunrjs.com/) 或 [algolia](https://www.algolia.com/) 或 [Fuse.js](https://fusejs.io/) 的**搜索**
|
||||
* 支持 **Twemoji**
|
||||
* 支持**代码高亮**
|
||||
* 一键**复制代码**到剪贴板
|
||||
* 支持基于 [lightgallery](https://github.com/sachinchoolur/lightgallery) 的**图片画廊**
|
||||
* 支持 **[Font Awesome](https://fontawesome.com/) 图标**的扩展 Markdown 语法
|
||||
* 支持**上标注释**的扩展 Markdown 语法
|
||||
* 支持**分数**的扩展 Markdown 语法
|
||||
* 支持基于 [KaTeX](https://katex.org/) 的**数学公式**
|
||||
* 支持基于 [mermaid](https://github.com/knsv/mermaid) 的**图表** shortcode
|
||||
* 支持基于 [ECharts](https://echarts.apache.org/) 的**交互式数据可视化** shortcode
|
||||
* 支持基于 [Mapbox GL JS](https://docs.mapbox.com/mapbox-gl-js) 的 **Mapbox** shortcode
|
||||
* 支持基于 [APlayer](https://github.com/MoePlayer/APlayer) 和 [MetingJS](https://github.com/metowolf/MetingJS) 的**音乐播放器** shortcode
|
||||
* 支持 **Bilibili 视频** shortcode
|
||||
* 支持多种**注释**的 shortcode
|
||||
* 支持**自定义样式**的 shortcode
|
||||
* 支持**自定义脚本**的 shortcode
|
||||
* 支持基于 [TypeIt](https://typeitjs.com/) 的**打字动画** shortcode
|
||||
* 支持基于 [cookieconsent](https://github.com/osano/cookieconsent) 的 **Cookie 许可横幅**
|
||||
* 支持基于 [cell-watermark](https://github.com/Lruihao/watermark) 的**网页水印**
|
||||
* 支持基于 [pangu.js](https://github.com/vinta/pangu.js) 的**中文排版**
|
||||
* ...
|
||||
- 支持**渐进式网页应用**
|
||||
- 支持**二级菜单**
|
||||
- 支持**内容加密**(页面、局部)
|
||||
- 支持**友情链接**的页面模板
|
||||
- 支持基于 [algolia](https://www.algolia.com/) 或 [Fuse.js](https://fusejs.io/) 的**搜索**
|
||||
- 支持 **Twemoji**
|
||||
- 支持**代码高亮**
|
||||
- 一键**复制代码**到剪贴板
|
||||
- 支持基于 [lightgallery](https://github.com/sachinchoolur/lightgallery) 的**图片画廊**
|
||||
- 支持 **[Font Awesome](https://fontawesome.com/) 图标**的扩展 Markdown 语法
|
||||
- 支持**上标注释**的扩展 Markdown 语法
|
||||
- 支持**分数**的扩展 Markdown 语法
|
||||
- 支持基于 [KaTeX](https://katex.org/) 的**数学公式**
|
||||
- 支持基于 [mermaid](https://github.com/knsv/mermaid) 的**图表** shortcode
|
||||
- 支持基于 [ECharts](https://echarts.apache.org/) 的**交互式数据可视化** shortcode
|
||||
- 支持基于 [Mapbox GL JS](https://docs.mapbox.com/mapbox-gl-js) 的 **Mapbox** shortcode
|
||||
- 支持基于 [APlayer](https://github.com/MoePlayer/APlayer) 和 [MetingJS](https://github.com/metowolf/MetingJS) 的**音乐播放器** shortcode
|
||||
- 支持 **Bilibili 视频** shortcode
|
||||
- 支持多种**注释**的 shortcode
|
||||
- 支持**自定义样式**的 shortcode
|
||||
- 支持**自定义脚本**的 shortcode
|
||||
- 支持基于 [TypeIt](https://typeitjs.com/) 的**打字动画** shortcode
|
||||
- 支持基于 [cookieconsent](https://github.com/osano/cookieconsent) 的 **Cookie 许可横幅**
|
||||
- 支持基于 [cell-watermark](https://github.com/Lruihao/watermark) 的**网页水印**
|
||||
- 支持基于 [pangu.js](https://github.com/vinta/pangu.js) 的**中文排版**
|
||||
- 支持本地**缓存远程图床图片**
|
||||
- ……
|
||||
|
||||
### 主题组件
|
||||
|
||||
FixIt 主题旨在在 **简洁性** 和 **可扩展性** 之间取得平衡。为此,我们开发了一系列额外的 [Hugo 主题组件](https://fixit.lruihao.cn/zh-cn/components/) 供用户选择。
|
||||
|
||||
## 多语言和国际化
|
||||
|
||||
FixIt 支持下列语言:
|
||||
|
||||
* 英语
|
||||
* 简体中文
|
||||
* 繁体中文
|
||||
* 法语
|
||||
* 波兰语
|
||||
* 巴西葡萄牙语
|
||||
* 意大利语
|
||||
* 西班牙语
|
||||
* 德语
|
||||
* 塞尔维亚语
|
||||
* 俄语
|
||||
* 罗马尼亚语
|
||||
* 越南语
|
||||
* [贡献一种新的语言](https://github.com/hugo-fixit/FixIt/pulls)
|
||||
- 英语
|
||||
- 简体中文
|
||||
- 繁体中文
|
||||
- 法语
|
||||
- 波兰语
|
||||
- 巴西葡萄牙语
|
||||
- 意大利语
|
||||
- 西班牙语
|
||||
- 德语
|
||||
- 塞尔维亚语
|
||||
- 俄语
|
||||
- 罗马尼亚语
|
||||
- 越南语
|
||||
- [贡献一种新的语言](https://github.com/hugo-fixit/FixIt/pulls)
|
||||
|
||||
[语言兼容性](https://fixit.lruihao.cn/zh-cn/theme-documentation-basics/#language-compatibility)
|
||||
|
||||
@@ -174,7 +132,7 @@ FixIt 支持下列语言:
|
||||
|
||||
## 问题、想法、bugs 和 PRs
|
||||
|
||||
所有的反馈都是欢迎的!详见 [议题](https://github.com/hugo-fixit/FixIt/issues) 或者 [讨论](https://github.com/hugo-fixit/FixIt/discussions)。
|
||||
所有的反馈都是欢迎的!详见 [议题](https://github.com/hugo-fixit/FixIt/issues) 或者 [讨论](https://github.com/hugo-fixit/FixIt/discussions) 或者加入 QQ 群:`814031017`。
|
||||
|
||||
## 参与贡献
|
||||
|
||||
@@ -182,76 +140,82 @@ FixIt 支持下列语言:
|
||||
|
||||
确保在贡献和参与讨论时遵守 [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)。
|
||||
|
||||
**贡献时,请先通过此存储库上的问题讨论您希望进行的更改,然后再进行实际更改**。
|
||||
**贡献时,请先通过此存储库上的问题讨论你希望进行的更改,然后再进行实际更改**。
|
||||
|
||||
## [所有贡献者](contributors.md)
|
||||
|
||||
## 镜像
|
||||
|
||||
- Gitee 镜像仓库:<https://gitee.com/lruihao/FixIt>
|
||||
|
||||
## 致谢
|
||||
|
||||
<details open>
|
||||
<details>
|
||||
<summary>FixIt 主题中用到了以下项目,感谢它们的作者:</summary>
|
||||
|
||||
* [normalize.css](https://github.com/necolas/normalize.css)
|
||||
* [Font Awesome](https://fontawesome.com/)
|
||||
* [Simple Icons](https://github.com/simple-icons/simple-icons)
|
||||
* [Animate.css](https://daneden.github.io/animate.css/)
|
||||
* [autocomplete-js](https://github.com/algolia/autocomplete)
|
||||
* [Lunr.js](https://lunrjs.com/)
|
||||
* [algoliasearch](https://github.com/algolia/algoliasearch-client-javascript)
|
||||
* [Fuse.js](https://fusejs.io/)
|
||||
* [lazysizes](https://github.com/aFarkas/lazysizes)
|
||||
* [object-fit-images](https://github.com/fregante/object-fit-images)
|
||||
* [Twemoji](https://github.com/twitter/twemoji)
|
||||
* [emoji-data](https://github.com/iamcal/emoji-data)
|
||||
* [lightgallery](https://github.com/sachinchoolur/lightgallery)
|
||||
* [Sharer.js](https://github.com/ellisonleao/sharer.js)
|
||||
* [TypeIt](https://typeitjs.com/)
|
||||
* [KaTeX](https://katex.org/)
|
||||
* [mermaid](https://github.com/mermaid-js/mermaid)
|
||||
* [ECharts](https://echarts.apache.org/)
|
||||
* [Mapbox GL JS](https://docs.mapbox.com/mapbox-gl-js)
|
||||
* [APlayer](https://github.com/MoePlayer/APlayer)
|
||||
* [MetingJS](https://github.com/metowolf/MetingJS)
|
||||
* [Gitalk](https://github.com/gitalk/gitalk)
|
||||
* [Valine](https://valine.js.org/)
|
||||
* [cookieconsent](https://github.com/osano/cookieconsent)
|
||||
* [cell-watermark](https://github.com/Lruihao/watermark)
|
||||
* [不蒜子](http://busuanzi.ibruce.info/)
|
||||
* [pangu.js](https://github.com/vinta/pangu.js)
|
||||
* [Artalk](https://artalk.js.org/)
|
||||
* [Waline](https://waline.js.org/)
|
||||
* [Twikoo](https://twikoo.js.org/)
|
||||
* [github-corners](https://github.com/tholman/github-corners)
|
||||
* [giscus](https://giscus.app/zh-CN)
|
||||
* [crypto-js](https://github.com/brix/crypto-js)
|
||||
* [vConsole](https://github.com/Tencent/vConsole)
|
||||
* [eruda](https://github.com/liriliri/eruda)
|
||||
* [pace](https://github.com/CodeByZach/pace)
|
||||
- [normalize.css](https://github.com/necolas/normalize.css)
|
||||
- [Font Awesome](https://fontawesome.com/)
|
||||
- [Simple Icons](https://github.com/simple-icons/simple-icons)
|
||||
- [Animate.css](https://daneden.github.io/animate.css/)
|
||||
- [autocomplete-js](https://github.com/algolia/autocomplete)
|
||||
- [algoliasearch](https://github.com/algolia/algoliasearch-client-javascript)
|
||||
- [Fuse.js](https://fusejs.io/)
|
||||
- [object-fit-images](https://github.com/fregante/object-fit-images)
|
||||
- [Twemoji](https://github.com/twitter/twemoji)
|
||||
- [emoji-data](https://github.com/iamcal/emoji-data)
|
||||
- [lightgallery](https://github.com/sachinchoolur/lightgallery)
|
||||
- [Sharer.js](https://github.com/ellisonleao/sharer.js)
|
||||
- [TypeIt](https://typeitjs.com/)
|
||||
- [KaTeX](https://katex.org/)
|
||||
- [mermaid](https://github.com/mermaid-js/mermaid)
|
||||
- [ECharts](https://echarts.apache.org/)
|
||||
- [Mapbox GL JS](https://docs.mapbox.com/mapbox-gl-js)
|
||||
- [APlayer](https://github.com/MoePlayer/APlayer)
|
||||
- [MetingJS](https://github.com/metowolf/MetingJS)
|
||||
- [Gitalk](https://github.com/gitalk/gitalk)
|
||||
- [Valine](https://valine.js.org/)
|
||||
- [cookieconsent](https://github.com/osano/cookieconsent)
|
||||
- [cell-watermark](https://github.com/Lruihao/watermark)
|
||||
- [不蒜子](http://busuanzi.ibruce.info/)
|
||||
- [pangu.js](https://github.com/vinta/pangu.js)
|
||||
- [Artalk](https://artalk.js.org/)
|
||||
- [Waline](https://waline.js.org/)
|
||||
- [Twikoo](https://twikoo.js.org/)
|
||||
- [github-corners](https://github.com/tholman/github-corners)
|
||||
- [giscus](https://giscus.app/zh-CN)
|
||||
- [crypto-js](https://github.com/brix/crypto-js)
|
||||
- [vConsole](https://github.com/Tencent/vConsole)
|
||||
- [eruda](https://github.com/liriliri/eruda)
|
||||
- [pace](https://github.com/CodeByZach/pace)
|
||||
|
||||
</details>
|
||||
|
||||
<details open>
|
||||
<details>
|
||||
<summary>FixIt 主题还借鉴了以下项目的部分功能,同样感谢它们的作者:</summary>
|
||||
|
||||
* [DoIt](https://github.com/HEIGE-PCloud/DoIt)
|
||||
* [NexT](https://github.com/next-theme/hexo-theme-next)
|
||||
- [DoIt](https://github.com/HEIGE-PCloud/DoIt)
|
||||
- [NexT](https://github.com/next-theme/hexo-theme-next)
|
||||
|
||||
</details>
|
||||
|
||||
## 许可协议
|
||||
|
||||
FixIt 根据 **MIT** 许可协议授权。 更多信息请查看 [LICENSE 文件](LICENSE)。
|
||||
FixIt 根据 **MIT** 许可协议授权。更多信息请查看 [LICENSE 文件](LICENSE)。
|
||||
|
||||
## 作者
|
||||
|
||||
[Lruihao](https://lruihao.cn)
|
||||
Follow [Lruihao](https://github.com/Lruihao "在 GitHub 上关注我")
|
||||
|
||||
## 赞助支持
|
||||
|
||||
如果你喜爱这个主题,请考虑给我买杯咖啡 ☕️.
|
||||
[](https://github.com/hugo-fixit/FixIt)
|
||||
|
||||
* [PayPal](https://paypal.me/Lruihao)
|
||||
* [支付宝](images/alipay.gif)
|
||||
* [微信支付](images/wechatpay.gif)
|
||||
如果你喜爱这个主题,请考虑给我买杯咖啡 ☕️,谢谢!
|
||||
|
||||
谢谢!❤️
|
||||
- [PayPal](https://paypal.me/Lruihao)
|
||||
- [支付宝](images/alipay.jpg)
|
||||
- [微信支付](images/wechatpay.jpg)
|
||||
|
||||
如果你喜欢这个主题,别忘了留下一颗 ⭐️ 哦,谢谢!
|
||||
|
||||
[^1]: 主题名称趣谈:“leave it, keep it,love it,fix it”。出现又离开,爱而不得。这像不像那该死的爱情和 BUG 呢?🤣
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
| Version | Supported |
|
||||
| :-----------: | :----------------: |
|
||||
| 0.3.x | :white_check_mark: |
|
||||
|
||||
legacy and transitional versions:
|
||||
|
||||
| Version | Supported | LoveIt Compatibility |
|
||||
| :-----------: | :----------------: | :------------------: |
|
||||
| 0.1.x | :x: | :white_check_mark: |
|
||||
| 0.2.x | :x: | :white_check_mark: |
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
If you want to report a vulnerability, create a new issue at https://github.com/hugo-fixit/FixIt/issues. Any vulnerabilities will be fixed as soon as possible.
|
||||
@@ -1,8 +1,9 @@
|
||||
---
|
||||
title: "{{ replace .TranslationBaseName "-" " " | title }}"
|
||||
subtitle: ""
|
||||
title: {{ replace .TranslationBaseName "-" " " | title }}
|
||||
subtitle:
|
||||
date: {{ .Date }}
|
||||
description: ""
|
||||
keywords: ""
|
||||
comment: false
|
||||
slug: {{ substr .File.UniqueID 0 7 }}
|
||||
description:
|
||||
keywords:
|
||||
draft: true
|
||||
---
|
||||
|
||||
@@ -1,18 +1,22 @@
|
||||
---
|
||||
title: "{{ replace .TranslationBaseName "-" " " | title }}"
|
||||
subtitle: ""
|
||||
type: "friends"
|
||||
title: {{ replace .TranslationBaseName "-" " " | title }}
|
||||
subtitle:
|
||||
layout: friends
|
||||
date: {{ .Date }}
|
||||
description: "{{ .Site.Author.name }}'s friends"
|
||||
keywords:
|
||||
- Hugo
|
||||
- friends template
|
||||
description: "{{ .Site.Params.author.name }}'s friends"
|
||||
keywords:
|
||||
- 'Hugo FixIt'
|
||||
- 'friends template'
|
||||
- 友情链接
|
||||
comment: false
|
||||
---
|
||||
|
||||
<!-- When you set data `friends.yml` in `yourProject/data/` directory, it will be automatically loaded here. -->
|
||||
|
||||
---
|
||||
|
||||
<!-- You can define additional content below for this page. -->
|
||||
|
||||
## Base info
|
||||
|
||||
```yaml
|
||||
@@ -25,7 +29,9 @@ comment: false
|
||||
## Friendly Reminder
|
||||
|
||||
{{< admonition info "Notice" true >}}
|
||||
|
||||
1. If you want to exchange link, please leave a comment in the above format. (personal non-commercial blogs / websites only)
|
||||
2. :(fa-solid fa-exclamation-triangle): Website failure, stop maintenance and improper content may be unlinked!
|
||||
3. Those websites that do not respect other people's labor achievements, reprint without source, or malicious acts, please do not come to exchange.
|
||||
|
||||
{{< /admonition >}}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
type: "offline"
|
||||
description: "{{ T "offlineTitle" }} - {{ .Site.Title }}"
|
||||
keywords:
|
||||
- PWA
|
||||
- offline
|
||||
- 离线
|
||||
---
|
||||
|
||||
<!-- You need do nothing for this page. -->
|
||||
@@ -1,45 +1,43 @@
|
||||
---
|
||||
title: "{{ replace .TranslationBaseName "-" " " | title }}"
|
||||
subtitle: ""
|
||||
title: {{ replace .TranslationBaseName "-" " " | title }}
|
||||
subtitle:
|
||||
date: {{ .Date }}
|
||||
slug: {{ substr .File.UniqueID 0 7 }}
|
||||
draft: true
|
||||
author: ""
|
||||
authorLink: ""
|
||||
authorEmail: ""
|
||||
description: ""
|
||||
keywords: ""
|
||||
license: ""
|
||||
author:
|
||||
name:
|
||||
link:
|
||||
email:
|
||||
avatar:
|
||||
description:
|
||||
keywords:
|
||||
license:
|
||||
comment: false
|
||||
weight: 0
|
||||
|
||||
tags:
|
||||
- draft
|
||||
- draft
|
||||
categories:
|
||||
- draft
|
||||
|
||||
- draft
|
||||
hiddenFromHomePage: false
|
||||
hiddenFromSearch: false
|
||||
|
||||
summary: ""
|
||||
hiddenFromRss: false
|
||||
hiddenFromRelated: false
|
||||
summary:
|
||||
resources:
|
||||
- name: featured-image
|
||||
src: featured-image.jpg
|
||||
- name: featured-image-preview
|
||||
src: featured-image-preview.jpg
|
||||
|
||||
toc:
|
||||
enable: true
|
||||
math:
|
||||
enable: false
|
||||
- name: featured-image
|
||||
src: featured-image.jpg
|
||||
- name: featured-image-preview
|
||||
src: featured-image-preview.jpg
|
||||
toc: true
|
||||
math: false
|
||||
lightgallery: false
|
||||
seo:
|
||||
images: []
|
||||
|
||||
password:
|
||||
message:
|
||||
repost:
|
||||
enable: true
|
||||
url: ""
|
||||
url:
|
||||
|
||||
# See details front matter: https://fixit.lruihao.cn/theme-documentation-content/#front-matter
|
||||
# See details front matter: https://fixit.lruihao.cn/documentation/content-management/introduction/#front-matter
|
||||
---
|
||||
|
||||
<!--more-->
|
||||
@@ -1,45 +1,43 @@
|
||||
---
|
||||
title: "{{ replace .TranslationBaseName "-" " " | title }}"
|
||||
subtitle: ""
|
||||
title: {{ replace .TranslationBaseName "-" " " | title }}
|
||||
subtitle:
|
||||
date: {{ .Date }}
|
||||
slug: {{ substr .File.UniqueID 0 7 }}
|
||||
draft: true
|
||||
author: ""
|
||||
authorLink: ""
|
||||
authorEmail: ""
|
||||
description: ""
|
||||
keywords: ""
|
||||
license: ""
|
||||
author:
|
||||
name:
|
||||
link:
|
||||
email:
|
||||
avatar:
|
||||
description:
|
||||
keywords:
|
||||
license:
|
||||
comment: false
|
||||
weight: 0
|
||||
|
||||
tags:
|
||||
- draft
|
||||
- draft
|
||||
categories:
|
||||
- draft
|
||||
|
||||
- draft
|
||||
hiddenFromHomePage: false
|
||||
hiddenFromSearch: false
|
||||
|
||||
summary: ""
|
||||
hiddenFromRss: false
|
||||
hiddenFromRelated: false
|
||||
summary:
|
||||
resources:
|
||||
- name: featured-image
|
||||
src: featured-image.jpg
|
||||
- name: featured-image-preview
|
||||
src: featured-image-preview.jpg
|
||||
|
||||
toc:
|
||||
enable: true
|
||||
math:
|
||||
enable: false
|
||||
- name: featured-image
|
||||
src: featured-image.jpg
|
||||
- name: featured-image-preview
|
||||
src: featured-image-preview.jpg
|
||||
toc: true
|
||||
math: false
|
||||
lightgallery: false
|
||||
seo:
|
||||
images: []
|
||||
|
||||
password:
|
||||
message:
|
||||
repost:
|
||||
enable: true
|
||||
url: ""
|
||||
url:
|
||||
|
||||
# See details front matter: https://fixit.lruihao.cn/theme-documentation-content/#front-matter
|
||||
# See details front matter: https://fixit.lruihao.cn/documentation/content-management/introduction/#front-matter
|
||||
---
|
||||
|
||||
<!--more-->
|
||||
|
||||
@@ -43,8 +43,25 @@ html {
|
||||
body {
|
||||
background-color: $global-background-color;
|
||||
color: $global-font-color;
|
||||
@include overflow-wrap(break-word);
|
||||
scrollbar-color: auto;
|
||||
@include overflow-wrap(break-word);
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
width: 0.75rem;
|
||||
height: 0.75rem;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
background-color: transparent;
|
||||
background-clip: content-box;
|
||||
border: 2px solid transparent;
|
||||
@include border-radius(0.5rem);
|
||||
}
|
||||
|
||||
&[data-scroll]::-webkit-scrollbar-thumb {
|
||||
background-color: $scrollbar-color;
|
||||
}
|
||||
|
||||
&[data-theme='dark'] {
|
||||
color: $global-font-color-dark;
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
.breadcrumb-container {
|
||||
padding-inline: 1rem;
|
||||
font-size: 0.75rem;
|
||||
background-color: $global-background-color;
|
||||
@include z-index(1);
|
||||
@extend .print-d-none;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
background-color: $global-background-color-dark;
|
||||
}
|
||||
|
||||
&.sticky {
|
||||
position: sticky;
|
||||
top: $header-height;
|
||||
}
|
||||
|
||||
.breadcrumb {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
padding: 0.5rem 0;
|
||||
margin: 0 auto;
|
||||
list-style: none;
|
||||
border-bottom: 1px inset $global-border-color;
|
||||
@extend %page-style;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
border-bottom-color: $global-border-color-dark;
|
||||
}
|
||||
|
||||
.breadcrumb-item {
|
||||
display: flex;
|
||||
|
||||
+.breadcrumb-item::before {
|
||||
content: "/";
|
||||
display: inline-block;
|
||||
padding-inline: 0.5rem;
|
||||
color: $global-font-secondary-color;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
color: $global-font-secondary-color-dark;
|
||||
}
|
||||
}
|
||||
|
||||
&.active {
|
||||
color: var(--#{$prefix}secondary);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -30,28 +30,24 @@
|
||||
|
||||
.ms-1,
|
||||
.mx-1 {
|
||||
margin-left: 0.25rem !important;
|
||||
margin-left: 0.25em !important;
|
||||
}
|
||||
.me-1,
|
||||
.mx-1 {
|
||||
margin-right: 0.25rem !important;
|
||||
margin-right: 0.25em !important;
|
||||
}
|
||||
.ps-1,
|
||||
.px-1 {
|
||||
padding-left: 0.25rem !important;
|
||||
padding-left: 0.25em !important;
|
||||
}
|
||||
.pe-1,
|
||||
.px-1 {
|
||||
padding-right: 0.25rem !important;
|
||||
padding-right: 0.25em !important;
|
||||
}
|
||||
|
||||
@each $color, $value in $theme-colors {
|
||||
.text-#{$color} {
|
||||
color: #{$value} !important;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
color: #{darken($value, 5%)} !important;
|
||||
}
|
||||
color: var(--#{$prefix}#{$color}) !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ footer {
|
||||
text-align: center;
|
||||
line-height: 1.25rem;
|
||||
padding: 1rem 0;
|
||||
@extend .print-d-none;
|
||||
|
||||
.footer-container {
|
||||
display: flex;
|
||||
@@ -19,10 +20,6 @@ footer {
|
||||
margin-right: 0.25rem;
|
||||
}
|
||||
|
||||
.fixit-icon {
|
||||
top: 0.25em;
|
||||
}
|
||||
|
||||
.animate-icon {
|
||||
color: #dc143c;
|
||||
animation: icon-animate 1.33s ease-in-out infinite;
|
||||
@@ -40,23 +37,23 @@ footer {
|
||||
@keyframes icon-animate {
|
||||
0%,
|
||||
100% {
|
||||
transform: scale(1);
|
||||
@include transform(scale(1));
|
||||
}
|
||||
|
||||
10%,
|
||||
30% {
|
||||
transform: scale(0.9);
|
||||
@include transform(scale(0.9));
|
||||
}
|
||||
|
||||
20%,
|
||||
40%,
|
||||
60%,
|
||||
80% {
|
||||
transform: scale(1.1);
|
||||
@include transform(scale(1.1));
|
||||
}
|
||||
|
||||
50%,
|
||||
70% {
|
||||
transform: scale(1.1);
|
||||
@include transform(scale(1.1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
header {
|
||||
width: 100%;
|
||||
z-index: 150;
|
||||
background-color: $header-background-color;
|
||||
@include z-index(2);
|
||||
@include transition(box-shadow 0.3s ease);
|
||||
@extend .print-d-none;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
background-color: $header-background-color-dark;
|
||||
@@ -10,6 +11,10 @@ header {
|
||||
|
||||
&:hover {
|
||||
@include box-shadow(0 0 1.5rem 0 rgba(0, 0, 0, 0.1));
|
||||
|
||||
[data-theme='dark'] & {
|
||||
@include box-shadow(0 0 1.5rem 0 rgba(255, 255, 255, 0.1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,7 +87,16 @@ header {
|
||||
}
|
||||
}
|
||||
|
||||
&.language,
|
||||
.menu-link i {
|
||||
@include transform(perspective(1rem));
|
||||
@include transition(transform 0.4s ease);
|
||||
}
|
||||
|
||||
.menu-link:hover i {
|
||||
@include transform(perspective(1rem) translateZ(0.2rem));
|
||||
}
|
||||
|
||||
&.language-switch,
|
||||
&.theme-switch {
|
||||
cursor: pointer;
|
||||
}
|
||||
@@ -216,10 +230,13 @@ header {
|
||||
flex-wrap: nowrap;
|
||||
float: right;
|
||||
|
||||
>.menu-item:hover {
|
||||
& .sub-menu {
|
||||
>.menu-item {
|
||||
&:hover .sub-menu {
|
||||
display: block;
|
||||
transform: translateX(-0.5rem);
|
||||
@include transform(translateX(-0.5rem));
|
||||
}
|
||||
&.language-switch:hover .sub-menu {
|
||||
@include transform(translateX(calc(1.75rem - 100%)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -230,20 +247,15 @@ header {
|
||||
width: 0;
|
||||
margin: 0.125rem 0.25rem;
|
||||
padding: 0;
|
||||
border-left: 1px dashed lighten($global-font-secondary-color, 20%);
|
||||
border-left: 1px dashed lighten($global-font-secondary-color, 15%);
|
||||
|
||||
[data-theme='dark'] & {
|
||||
border-left-color: darken($global-font-secondary-color-dark, 20%);
|
||||
border-left-color: darken($global-font-secondary-color-dark, 15%);
|
||||
}
|
||||
}
|
||||
|
||||
&.language {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.sub-menu {
|
||||
z-index: 160;
|
||||
position: absolute;
|
||||
margin: 0;
|
||||
padding: 0.25rem 0;
|
||||
@@ -253,14 +265,14 @@ header {
|
||||
border: 1px solid $global-border-color;
|
||||
background-color: $header-background-color;
|
||||
@include transition(box-shadow 0.3s ease);
|
||||
@include box-shadow(0 0 1.5rem 0 rgba(0, 0, 0, 0.1));
|
||||
|
||||
[data-theme='dark'] & {
|
||||
background-color: $header-background-color-dark;
|
||||
border-color: $global-border-color-dark;
|
||||
@include box-shadow(0 0 1.5rem 0 rgba(255, 255, 255, 0.1));
|
||||
}
|
||||
|
||||
@include box-shadow(0 0 1.5rem 0 rgba(0, 0, 0, 0.1));
|
||||
|
||||
.menu-item {
|
||||
height: $header-height*0.5;
|
||||
line-height: $header-height*0.5;
|
||||
@@ -351,9 +363,18 @@ header {
|
||||
background: $header-background-color;
|
||||
border-top: 2px solid $global-border-color;
|
||||
display: none;
|
||||
padding: 0.5rem 0 0;
|
||||
overflow-y: overlay;
|
||||
max-height: 70vh;
|
||||
@include box-shadow(0 0.125rem 0.25rem rgba(0, 0, 0, 0.1));
|
||||
|
||||
[data-theme='dark'] & {
|
||||
@include box-shadow(0 0.125rem 0.25rem rgba(255, 255, 255, 0.1));
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
width: 0;
|
||||
}
|
||||
|
||||
.search-wrapper {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
@@ -361,6 +382,14 @@ header {
|
||||
box-sizing: border-box;
|
||||
padding: ($header-height - 2.5rem) / 2 1rem;
|
||||
line-height: 2.5rem;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
background-color: $header-background-color;
|
||||
@include z-index(0, 50);
|
||||
|
||||
[data-theme='dark'] & {
|
||||
background-color: $header-background-color-dark;
|
||||
}
|
||||
}
|
||||
|
||||
.search {
|
||||
@@ -392,7 +421,7 @@ header {
|
||||
line-height: 2.5rem;
|
||||
padding: 0 1rem;
|
||||
|
||||
&:hover {
|
||||
&:not(.menu-system):hover {
|
||||
background-color: lighten($global-font-secondary-color, 24%);
|
||||
|
||||
[data-theme='dark'] & {
|
||||
@@ -417,19 +446,37 @@ header {
|
||||
max-width: 80%;
|
||||
}
|
||||
}
|
||||
|
||||
&.theme-switch,
|
||||
&.language {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.menu-system {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 0.25rem;
|
||||
position: sticky;
|
||||
bottom: 0;
|
||||
line-height: 2.5rem;
|
||||
padding: 0 1rem;
|
||||
background-color: $header-background-color;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
background-color: $header-background-color-dark;
|
||||
}
|
||||
|
||||
.language-select {
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
.menu-system-item {
|
||||
padding-inline: 0.5rem;
|
||||
}
|
||||
|
||||
.language-switch {
|
||||
position: relative;
|
||||
|
||||
.language-select {
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -483,10 +530,14 @@ header {
|
||||
|
||||
.search-dropdown {
|
||||
position: fixed;
|
||||
z-index: 200;
|
||||
top: $header-height;
|
||||
@include z-index(2);
|
||||
@include box-shadow(0 0.125rem 0.25rem rgba(0, 0, 0, 0.1));
|
||||
|
||||
[data-theme='dark'] & {
|
||||
@include box-shadow(0 0.125rem 0.25rem rgba(255, 255, 255, 0.1));
|
||||
}
|
||||
|
||||
&.desktop {
|
||||
right: 2rem;
|
||||
width: 30rem;
|
||||
|
||||
@@ -8,28 +8,34 @@
|
||||
main {
|
||||
flex: 1 0 auto;
|
||||
|
||||
aside:first-child {
|
||||
order: 2;
|
||||
aside {
|
||||
flex: 1;
|
||||
padding: 0.5rem;
|
||||
|
||||
&:not(:has(~ aside)) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
&.container {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: center;
|
||||
padding: 0 1rem;
|
||||
padding-inline: 1rem;
|
||||
gap: 0.5rem;
|
||||
|
||||
&.container-reverse {
|
||||
flex-direction: row-reverse;
|
||||
}
|
||||
|
||||
&:has(.home:not(.posts)) {
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
&.container-reverse {
|
||||
@extend .container;
|
||||
flex-direction: row-reverse;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@import "_core/header";
|
||||
@import "_core/footer";
|
||||
@import "_core/pagination";
|
||||
@import "_header";
|
||||
@import "_breadcrumb";
|
||||
@import "_footer";
|
||||
@import "_pagination";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@media only screen and (min-width: 1441px) {
|
||||
.page {
|
||||
%page-style {
|
||||
width: 60%;
|
||||
|
||||
[data-page-style='wide'] & {
|
||||
@@ -10,40 +10,20 @@
|
||||
max-width: 800px;
|
||||
}
|
||||
}
|
||||
|
||||
aside {
|
||||
width: 20%;
|
||||
|
||||
[data-page-style='wide'] & {
|
||||
width: 18%;
|
||||
}
|
||||
|
||||
[data-page-style='narrow'] & {
|
||||
width: calc(50% - 400px);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 1440px) {
|
||||
.page {
|
||||
%page-style {
|
||||
width: 56%;
|
||||
|
||||
[data-page-style='wide'] & {
|
||||
width: 60%;
|
||||
}
|
||||
}
|
||||
|
||||
aside {
|
||||
width: 22%;
|
||||
|
||||
[data-page-style='wide'] & {
|
||||
width: 20%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 1200px) {
|
||||
.page {
|
||||
%page-style {
|
||||
width: 52%;
|
||||
|
||||
[data-page-style='wide'] & {
|
||||
@@ -51,14 +31,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
aside {
|
||||
width: 24%;
|
||||
|
||||
[data-page-style='wide'] & {
|
||||
width: 22%;
|
||||
}
|
||||
}
|
||||
|
||||
#header-desktop .header-wrapper {
|
||||
padding-right: 1rem;
|
||||
}
|
||||
@@ -69,6 +41,10 @@
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 960px) {
|
||||
%page-style {
|
||||
width: 80% !important;
|
||||
}
|
||||
|
||||
aside {
|
||||
display: none !important;
|
||||
}
|
||||
@@ -77,15 +53,28 @@
|
||||
display: block;
|
||||
}
|
||||
|
||||
.page {
|
||||
width: 80% !important;
|
||||
}
|
||||
|
||||
#header-desktop .header-wrapper {
|
||||
padding-left: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@media only screen and (min-width: 681px) {
|
||||
.breadcrumb-container.sticky {
|
||||
body:not([data-header-desktop='sticky']) & {
|
||||
top: 0;
|
||||
}
|
||||
// adjust the scroll margin top of the content anchors on the page
|
||||
body:not([data-header-desktop='auto']) &+.container .content [id] {
|
||||
scroll-margin-top: calc(var(--#{$prefix}scroll-mt) + var(--#{$prefix}breadcrumb-height));
|
||||
}
|
||||
}
|
||||
|
||||
[data-header-desktop='normal'] .page .content [id] {
|
||||
--#{$prefix}scroll-mt: #{$global-scroll-margin-top};
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 680px) {
|
||||
#header-desktop {
|
||||
display: none;
|
||||
@@ -100,18 +89,27 @@
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.page {
|
||||
width: 100% !important;
|
||||
|
||||
.content {
|
||||
[id] {
|
||||
[data-header-mobile='normal'] & {
|
||||
scroll-margin-top: 0;
|
||||
}
|
||||
}
|
||||
.breadcrumb-container.sticky {
|
||||
body:not([data-header-mobile='sticky']) & {
|
||||
top: 0;
|
||||
}
|
||||
// adjust the scroll margin top of the content anchors on the page
|
||||
body:not([data-header-mobile='auto']) &+.container .content [id] {
|
||||
scroll-margin-top: calc(var(--#{$prefix}scroll-mt) + var(--#{$prefix}breadcrumb-height));
|
||||
}
|
||||
}
|
||||
|
||||
.categories-card {
|
||||
[data-header-mobile='normal'] .page .content [id] {
|
||||
--#{$prefix}scroll-mt: #{$global-scroll-margin-top};
|
||||
}
|
||||
|
||||
%page-style {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.page {
|
||||
.categories-card,
|
||||
.collections-card {
|
||||
.card-item {
|
||||
width: 100%;
|
||||
}
|
||||
@@ -123,7 +121,7 @@
|
||||
font-size: 0.618rem;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.pagination .page-item {
|
||||
margin: 0 5px;
|
||||
}
|
||||
@@ -139,10 +137,12 @@
|
||||
width: 100% !important;
|
||||
padding-top: 0 !important;
|
||||
|
||||
.single-title,
|
||||
.single-subtitle,
|
||||
.post-meta {
|
||||
text-align: center;
|
||||
&.single {
|
||||
.single-title,
|
||||
.single-subtitle,
|
||||
.post-meta {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
h1:not(.single-title),
|
||||
@@ -155,21 +155,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
.print-d-none,
|
||||
header,
|
||||
footer .footer-line:not(.powered):not(.copyright),
|
||||
#toc-auto,
|
||||
.comment-visitors,
|
||||
.comment-count,
|
||||
.code-header>.ellipses,
|
||||
.code-header>.edit,
|
||||
.code-header>.copy,
|
||||
.post-info-share,
|
||||
.post-info-more section:last-child,
|
||||
.post-nav,
|
||||
.fixed-buttons,
|
||||
#comments,
|
||||
.github-corner {
|
||||
.print-d-none {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
/* Resolve style conflicts between third-party plugins */
|
||||
|
||||
@keyframes #{$prefix}pulse {
|
||||
from {
|
||||
@include transform(scale3d(1, 1, 1));
|
||||
}
|
||||
|
||||
50% {
|
||||
@include transform(scale3d(1.05, 1.05, 1.05));
|
||||
}
|
||||
|
||||
to {
|
||||
@include transform(scale3d(1, 1, 1));
|
||||
}
|
||||
}
|
||||
|
||||
.animate__pulse {
|
||||
-webkit-animation-name: #{$prefix}pulse !important;
|
||||
animation-name: #{$prefix}pulse !important;
|
||||
}
|
||||
@@ -5,7 +5,24 @@
|
||||
@each $color, $value in $theme-colors {
|
||||
--#{$prefix}#{$color}: #{$value};
|
||||
}
|
||||
@each $color, $value in $theme-colors {
|
||||
--#{$prefix}#{$color}-dark: #{darken($value, 5%)};
|
||||
}
|
||||
|
||||
// Scroll margin top and Stack sticky top related
|
||||
--#{$prefix}scroll-mt: calc(#{$header-height} + #{$global-scroll-margin-top});
|
||||
|
||||
// Set breadcrumb height to 0px if breadcrumb is disabled
|
||||
--#{$prefix}breadcrumb-height: 0px;
|
||||
|
||||
// hr style
|
||||
--#{$prefix}hr-background-color: #{darken($global-border-color, 5%)};
|
||||
--#{$prefix}hr-before-color: #{lighten($single-link-hover-color, 4%)};
|
||||
}
|
||||
|
||||
// Dark theme
|
||||
[data-theme=dark] {
|
||||
@each $color, $value in $theme-colors {
|
||||
--#{$prefix}#{$color}: #{darken($value, 5%)};
|
||||
}
|
||||
|
||||
--#{$prefix}hr-background-color: #{lighten($global-border-color-dark, 5%)};
|
||||
--#{$prefix}hr-before-color: #{darken($global-link-hover-color-dark, 4%)};
|
||||
}
|
||||
|
||||
@@ -99,3 +99,9 @@
|
||||
object-fit: $value;
|
||||
font-family: 'object-fit: #{$value};';
|
||||
}
|
||||
|
||||
@mixin user-select($value) {
|
||||
-webkit-user-select: $value !important;
|
||||
-moz-user-select: $value !important;
|
||||
user-select: $value !important;
|
||||
}
|
||||
|
||||
@@ -2,3 +2,4 @@
|
||||
@import '_link';
|
||||
@import '_blur';
|
||||
@import '_details';
|
||||
@import '_z-index';
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
@mixin link($light, $dark) {
|
||||
/**
|
||||
* Link mixin
|
||||
* @param {Boolean} $light use global link color
|
||||
* @param {Boolean} $dark use global link color dark
|
||||
* @param {String} $decoration text-decoration, default none
|
||||
*/
|
||||
@mixin link($light, $dark, $decoration: none) {
|
||||
a,
|
||||
a::before,
|
||||
a::after {
|
||||
text-decoration: none;
|
||||
text-decoration: $decoration;
|
||||
|
||||
@if $light {
|
||||
color: $global-link-color;
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
@mixin z-index($level, $diff: 0) {
|
||||
z-index: ($level * 100) + $diff;
|
||||
}
|
||||
@@ -34,7 +34,7 @@
|
||||
}
|
||||
.friend-link:hover {
|
||||
background: #fff;
|
||||
transform: scale(1.03);
|
||||
@include transform(scale(1.03));
|
||||
box-shadow: 0 0 3px #aaa;
|
||||
}
|
||||
.friend-avatar {
|
||||
|
||||
@@ -14,6 +14,10 @@
|
||||
@include box-shadow(0 0 0 0.3618em rgba(0, 0, 0, 0.05));
|
||||
@include transition(all 0.4s ease);
|
||||
|
||||
[data-theme='dark'] & {
|
||||
@include box-shadow(0 0 0 0.3618em rgba(255, 255, 255, 0.05));
|
||||
}
|
||||
|
||||
&:hover {
|
||||
position: relative;
|
||||
@include transform(translateY(-0.75rem));
|
||||
@@ -25,7 +29,10 @@
|
||||
font-size: 1.25rem;
|
||||
font-weight: bold;
|
||||
margin: 0;
|
||||
padding: 0.5rem;
|
||||
|
||||
&:not(:empty) {
|
||||
padding: 0.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
.home-subtitle {
|
||||
@@ -90,7 +97,8 @@
|
||||
|
||||
.featured-image-preview {
|
||||
width: 100%;
|
||||
padding: 30% 0 0;
|
||||
// use the same proportions as the cover image of https://dev.to/
|
||||
aspect-ratio: auto 1000 / 420;
|
||||
position: relative;
|
||||
margin: 0.6rem auto;
|
||||
@include transition(transform 0.4s ease);
|
||||
@@ -101,10 +109,7 @@
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
|
||||
&.lazyloaded {
|
||||
@include object-fit(cover);
|
||||
}
|
||||
@include object-fit(cover);
|
||||
}
|
||||
|
||||
&:hover {
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
.page {
|
||||
position: relative;
|
||||
@extend %page-style;
|
||||
|
||||
.content {
|
||||
[id] {
|
||||
scroll-margin-top: $header-height;
|
||||
|
||||
[data-header-desktop='normal'] & {
|
||||
scroll-margin-top: 0;
|
||||
}
|
||||
scroll-margin-top: var(--#{$prefix}scroll-mt);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
@import '../_partials/_single/toc';
|
||||
@import '../_partials/_single/fixit-decryptor';
|
||||
@import '../_partials/_single/collections';
|
||||
|
||||
.single {
|
||||
.single-title {
|
||||
@@ -8,16 +9,20 @@
|
||||
font-size: 1.6rem;
|
||||
font-weight: bold;
|
||||
line-height: 140%;
|
||||
|
||||
.icon-repost {
|
||||
color: var(--#{$prefix}success);
|
||||
|
||||
.icon-pin {
|
||||
display: inline-block;
|
||||
width: max-content;
|
||||
margin-right: 0.25rem;
|
||||
transform: rotate(30deg);
|
||||
margin-right: 0.25em;
|
||||
color: var(--#{$prefix}danger);
|
||||
}
|
||||
|
||||
[data-theme='dark'] & {
|
||||
color: var(--#{$prefix}success-dark);
|
||||
}
|
||||
.icon-repost {
|
||||
display: inline-block;
|
||||
width: max-content;
|
||||
margin-right: 0.25em;
|
||||
color: var(--#{$prefix}success);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +37,11 @@
|
||||
font-size: 0.875rem;
|
||||
color: $global-font-secondary-color;
|
||||
|
||||
.comment-visitors,
|
||||
.comment-count {
|
||||
@extend .print-d-none;
|
||||
}
|
||||
|
||||
span {
|
||||
display: inline-block;
|
||||
}
|
||||
@@ -44,7 +54,7 @@
|
||||
|
||||
.author {
|
||||
font-size: 1.05rem;
|
||||
|
||||
|
||||
img.avatar {
|
||||
width: 1.3rem;
|
||||
height: 1.3rem;
|
||||
@@ -67,14 +77,11 @@
|
||||
|
||||
img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
margin: 0 auto;
|
||||
overflow: hidden;
|
||||
|
||||
&.lazyloaded {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,71 +94,100 @@
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
hr {
|
||||
position: relative;
|
||||
height: 1em;
|
||||
background: linear-gradient(to right, var(--#{$prefix}hr-background-color) 50%, transparent 50%);
|
||||
background-size: 10px 2px;
|
||||
background-position: center;
|
||||
background-repeat: repeat-x;
|
||||
border: none;
|
||||
|
||||
&.awesome-hr {
|
||||
margin-block: 0.5em;
|
||||
|
||||
&::before {
|
||||
display: inline-block;
|
||||
font-weight: 600;
|
||||
font-family: 'Font Awesome 6 Free';
|
||||
text-rendering: auto;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
position: absolute;
|
||||
left: 5%;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
z-index: 1;
|
||||
color: var(--#{$prefix}hr-before-color);
|
||||
content: '\f0c4';
|
||||
font-size: 20px;
|
||||
line-height: 1;
|
||||
transition: left 1s ease-in-out, color 0.3s ease, border-color 0.3s ease;
|
||||
}
|
||||
|
||||
&:hover::before {
|
||||
left: calc(95% - 20px);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
> h1,
|
||||
> h2 {
|
||||
font-size: 1.5rem;
|
||||
|
||||
& code {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
font-size: 1.5em;
|
||||
padding-bottom: 0.3em;
|
||||
border-bottom: 1px solid $global-border-color;
|
||||
}
|
||||
|
||||
> h3 {
|
||||
font-size: 1.375rem;
|
||||
|
||||
& code {
|
||||
font-size: 1.125rem;
|
||||
}
|
||||
font-size: 1.25em;
|
||||
}
|
||||
|
||||
> h4 {
|
||||
font-size: 1.25rem;
|
||||
|
||||
& code {
|
||||
font-size: 1rem;
|
||||
}
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
> h5 {
|
||||
font-size: 1.125rem;
|
||||
font-size: 0.875em;
|
||||
}
|
||||
|
||||
> h6 {
|
||||
font-size: 1rem;
|
||||
font-size: 0.85em;
|
||||
}
|
||||
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
> .heading-element {
|
||||
display: flex;
|
||||
font-weight: bold;
|
||||
margin: 1.2rem 0;
|
||||
line-height: 1.25;
|
||||
margin-top: 1.5rem;
|
||||
margin-bottom: 1rem;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
font-weight: bolder;
|
||||
}
|
||||
}
|
||||
|
||||
> h2,
|
||||
> h3,
|
||||
> h4,
|
||||
> h5,
|
||||
> h6 {
|
||||
> .header-mark::before {
|
||||
content: '|';
|
||||
margin-right: 0.3125rem;
|
||||
color: $single-link-color;
|
||||
code {
|
||||
padding: 0 .2em;
|
||||
font-size: inherit;
|
||||
}
|
||||
|
||||
[data-theme='dark'] & {
|
||||
color: $single-link-color-dark;
|
||||
&:hover {
|
||||
> .heading-mark {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
> h2 > .header-mark::before {
|
||||
content: '#';
|
||||
> .heading-mark {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
opacity: 0;
|
||||
padding-inline: 0.5rem;
|
||||
transition: all 0.2s ease-in-out;
|
||||
@include link(false, false);
|
||||
|
||||
svg {
|
||||
fill: currentColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
p {
|
||||
@@ -185,15 +221,24 @@
|
||||
}
|
||||
|
||||
ul,
|
||||
ol {
|
||||
margin: 0.5rem 0;
|
||||
padding-left: 2.5rem;
|
||||
ol,
|
||||
dl {
|
||||
margin-block: 0.5em;
|
||||
}
|
||||
|
||||
ul {
|
||||
list-style-type: disc;
|
||||
}
|
||||
|
||||
dl {
|
||||
dt {
|
||||
font-weight: bold;
|
||||
}
|
||||
dd {
|
||||
margin: 0.25em 0 1em;
|
||||
}
|
||||
}
|
||||
|
||||
ruby {
|
||||
background: $code-background-color;
|
||||
|
||||
@@ -249,7 +294,7 @@
|
||||
background-color: lighten($table-background-color-dark, 2.75%);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
& tr:hover {
|
||||
background: darken($table-background-color, 4.5%);
|
||||
|
||||
@@ -275,9 +320,35 @@
|
||||
max-width: 100%;
|
||||
min-height: 1em;
|
||||
|
||||
&:not([data-h]) {
|
||||
&:not([height]) {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
&[loading='lazy'][srcset]:not([data-lazyloaded]) {
|
||||
&:not(.suffix-invalid__small) {
|
||||
width: var(--width-small, var(--width));
|
||||
aspect-ratio: var(--aspect-ratio-small, var(--aspect-ratio));
|
||||
}
|
||||
|
||||
&:not(.suffix-invalid) {
|
||||
@media (min-resolution: 1.01dppx) and (max-resolution: 1.5dppx) {
|
||||
width: calc(var(--width) / 1.5);
|
||||
aspect-ratio: var(--aspect-ratio);
|
||||
}
|
||||
}
|
||||
|
||||
&:not(.suffix-invalid__large) {
|
||||
@media (min-resolution: 1.51dppx) {
|
||||
width: calc(var(--width-large, var(--width)) / 2);
|
||||
aspect-ratio: var(--aspect-ratio-large, var(--aspect-ratio));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.version {
|
||||
height: 1.25em;
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
}
|
||||
svg {
|
||||
max-width: 100%;
|
||||
@@ -301,10 +372,6 @@
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
overflow: hidden;
|
||||
|
||||
&.lazyloaded:not([data-w]) {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -320,6 +387,10 @@
|
||||
padding-left: 1.5em;
|
||||
}
|
||||
|
||||
dl dd {
|
||||
margin-inline-start: 0.25em;
|
||||
}
|
||||
|
||||
[data-theme='dark'] & {
|
||||
color: $blockquote-color-dark;
|
||||
border-left-color: $global-border-color-dark;
|
||||
@@ -328,11 +399,40 @@
|
||||
@include link(false, true);
|
||||
}
|
||||
|
||||
.footnotes {
|
||||
color: $global-font-secondary-color;
|
||||
sup[id^='fnref:']:has(.footnote-ref) {
|
||||
padding: 2px 4px;
|
||||
background-color: rgba(238, 238, 238, 0.7);
|
||||
color: #555555;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
color: $global-font-secondary-color-dark;
|
||||
background-color: rgba(56, 139, 253, 0.1);
|
||||
color: #58a6ff;
|
||||
}
|
||||
|
||||
@include link(true, false);
|
||||
}
|
||||
|
||||
.footnotes {
|
||||
font-size: 0.75rem;
|
||||
white-space: normal;
|
||||
color: darken($global-font-secondary-color, 5%);
|
||||
|
||||
ol {
|
||||
margin-block: 1em;
|
||||
padding-left: 1rem;
|
||||
}
|
||||
|
||||
a:not(.footnote-backref) {
|
||||
color: inherit;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
@include link(false, true);
|
||||
|
||||
[data-theme='dark'] & {
|
||||
color: lighten($global-font-secondary-color-dark, 5%);
|
||||
}
|
||||
|
||||
p {
|
||||
@@ -340,17 +440,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
@import '../_partials/_single/code';
|
||||
@import '../_shortcodes';
|
||||
|
||||
hr {
|
||||
margin: 1rem 0;
|
||||
position: relative;
|
||||
border-top: 1px dashed $global-border-color;
|
||||
border-bottom: none;
|
||||
margin-block: 0;
|
||||
}
|
||||
|
||||
[data-theme='dark'] & {
|
||||
border-top: 1px dashed $global-border-color-dark;
|
||||
.footnotes {
|
||||
hr {
|
||||
background-color: var(--#{$prefix}hr-background-color);
|
||||
height: 1px;
|
||||
margin-block: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -359,26 +457,22 @@
|
||||
padding: 0 0.25rem;
|
||||
background-color: $global-background-color;
|
||||
border: 1px solid $global-border-color;
|
||||
border-bottom-color: $global-border-color;
|
||||
@include border-radius($global-border-radius);
|
||||
@include box-shadow(inset 0 -1px 0 $global-border-color);
|
||||
font-size: 0.8rem;
|
||||
font-family: $code-font-family;
|
||||
color: $code-color;
|
||||
@include border-radius($global-border-radius);
|
||||
@include box-shadow(inset 0 -1px 0 $global-border-color);
|
||||
|
||||
[data-theme='dark'] & {
|
||||
background-color: $global-background-color-dark;
|
||||
border: 1px solid $global-border-color-dark;
|
||||
border-bottom-color: $global-border-color-dark;
|
||||
@include box-shadow(inset 0 -1px 0 $global-border-color-dark);
|
||||
color: $code-color-dark;
|
||||
@include box-shadow(inset 0 -1px 0 $global-border-color-dark);
|
||||
}
|
||||
}
|
||||
|
||||
.version {
|
||||
height: 1.25em;
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
@import '../_partials/_single/code';
|
||||
@import '../_shortcodes';
|
||||
}
|
||||
|
||||
@import '../_partials/_single/reward';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
.categories-card {
|
||||
.categories-card,
|
||||
.collections-card {
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
|
||||
@@ -10,17 +10,19 @@ svg.icon {
|
||||
}
|
||||
|
||||
img.emoji {
|
||||
display: inline-block;
|
||||
height: 1em;
|
||||
width: 1em;
|
||||
margin: 0 0.05em 0 0.1em;
|
||||
vertical-align: -0.1em;
|
||||
}
|
||||
|
||||
.hugo-icon,
|
||||
.fixit-icon {
|
||||
display: inline-block;
|
||||
height: 1.5em;
|
||||
width: 1.5em;
|
||||
line-height: 1.5em;
|
||||
height: 1.2em;
|
||||
width: 1.2em;
|
||||
line-height: 1.2em;
|
||||
position: relative;
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,3 @@
|
||||
img {
|
||||
@include border-radius($global-border-radius/2);
|
||||
|
||||
&.lazyload,
|
||||
&.lazyloading {
|
||||
@include object-fit(scale-down);
|
||||
}
|
||||
|
||||
&.lazyloaded {
|
||||
@include object-fit(contain);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: -1;
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
@include z-index(0, -1);
|
||||
|
||||
.blur & {
|
||||
z-index: 100;
|
||||
@include z-index(1);
|
||||
background-color: rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ code {
|
||||
}
|
||||
|
||||
// indented code
|
||||
pre {
|
||||
pre:not(.mermaid[data-processed='true']) {
|
||||
margin: 0;
|
||||
line-height: 1.45em;
|
||||
padding: 0.5rem;
|
||||
@@ -100,6 +100,12 @@ pre {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ellipses,
|
||||
.edit,
|
||||
.copy {
|
||||
@extend .print-d-none;
|
||||
}
|
||||
|
||||
.code-title {
|
||||
width: 100%;
|
||||
padding: 0.4rem;
|
||||
@@ -108,6 +114,12 @@ pre {
|
||||
padding: 0 0.2rem;
|
||||
@include transition(transform 0.2s ease);
|
||||
}
|
||||
|
||||
.title-inner {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
}
|
||||
|
||||
.code-title::after {
|
||||
@@ -181,9 +193,11 @@ pre {
|
||||
.lntd:first-child {
|
||||
min-width: 1.6rem;
|
||||
text-align: right;
|
||||
position: sticky;
|
||||
left: 0;
|
||||
|
||||
pre {
|
||||
padding-right: 0;
|
||||
@include user-select(none);
|
||||
}
|
||||
}
|
||||
// code content
|
||||
|
||||
@@ -0,0 +1,232 @@
|
||||
// Collection Navigation
|
||||
.collection-card {
|
||||
font-size: 0.875rem;
|
||||
background-color: darken($global-background-color, 3%);
|
||||
margin-block: 2rem -1rem;
|
||||
padding: 1rem 1.25rem;
|
||||
position: relative;
|
||||
@include border-radius($global-border-radius * 1.5);
|
||||
@include user-select(none);
|
||||
@extend .print-d-none;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
background-color: lighten($global-background-color-dark, 3%);
|
||||
}
|
||||
|
||||
&:has(.collection-nav-item:nth-child(2))::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
bottom: 0.75rem;
|
||||
width: 1px;
|
||||
height: 2rem;
|
||||
background: linear-gradient(to bottom, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.05) 50%, rgba(0, 0, 0, 0.03) 100%);
|
||||
|
||||
[data-theme='dark'] & {
|
||||
background: linear-gradient(
|
||||
to bottom,
|
||||
rgba(255, 255, 255, 0.03),
|
||||
rgba(255, 255, 255, 0.05) 50%,
|
||||
rgba(255, 255, 255, 0.03) 100%
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
.collection-title {
|
||||
@include link(false, false);
|
||||
}
|
||||
|
||||
.collection-nav {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
|
||||
&:not(:empty) {
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
.collection-nav-item {
|
||||
flex-grow: 1;
|
||||
max-width: calc(50% - 0.5rem);
|
||||
font-weight: 500;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@include transition(all 0.3s ease-out);
|
||||
|
||||
&:only-child {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
i {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
span {
|
||||
flex-grow: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
&[rel='next'] {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
&[rel='prev']:hover {
|
||||
@include transform(translateX(-4px));
|
||||
}
|
||||
|
||||
&[rel='next']:hover {
|
||||
@include transform(translateX(4px));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Collection aside container
|
||||
.aside-collection {
|
||||
position: sticky;
|
||||
top: calc(#{$header-height} + var(--#{$prefix}breadcrumb-height));
|
||||
box-sizing: border-box;
|
||||
@include overflow-wrap(break-word);
|
||||
@include blur;
|
||||
@extend .print-d-none;
|
||||
}
|
||||
|
||||
// Collection List
|
||||
.collection-details {
|
||||
&:not(:last-of-type) {
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
&.open {
|
||||
.collection-summary {
|
||||
background-color: darken($global-background-color, 4%);
|
||||
|
||||
[data-theme='dark'] & {
|
||||
background-color: lighten($global-background-color-dark, 4%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.collection-summary {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 0.25em;
|
||||
padding: 0.2em 0.5em;
|
||||
background-color: darken($global-background-color, 3%);
|
||||
|
||||
[data-theme='dark'] & {
|
||||
background-color: lighten($global-background-color-dark, 3%);
|
||||
}
|
||||
|
||||
> i.fa-layer-group {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.collection-name {
|
||||
flex-grow: 1;
|
||||
font-weight: bold;
|
||||
|
||||
&::before {
|
||||
content: attr(data-collections) '・';
|
||||
}
|
||||
}
|
||||
|
||||
.collection-count {
|
||||
flex-shrink: 0;
|
||||
color: var(--#{$prefix}secondary);
|
||||
}
|
||||
|
||||
.details-icon {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
@include user-select(none);
|
||||
}
|
||||
|
||||
.collection-content {
|
||||
font-size: $toc-content-font-size;
|
||||
background-color: darken($global-background-color, 2%);
|
||||
|
||||
[data-theme='dark'] & {
|
||||
background-color: lighten($global-background-color-dark, 2%);
|
||||
}
|
||||
|
||||
.collection-list {
|
||||
margin: 0;
|
||||
padding-inline: 1.6em 0.8em;
|
||||
padding-block: 0.4em;
|
||||
text-indent: -0.8em;
|
||||
list-style: none;
|
||||
overflow-y: scroll;
|
||||
max-height: 60vh;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
width: 0;
|
||||
}
|
||||
|
||||
.collection-item > a::before,
|
||||
.collection-item > span::before {
|
||||
content: '|';
|
||||
font-weight: 600;
|
||||
margin-right: 0.5em;
|
||||
position: relative;
|
||||
bottom: 2px;
|
||||
color: $single-link-color;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
color: $single-link-color-dark;
|
||||
}
|
||||
}
|
||||
|
||||
.collection-item > .active {
|
||||
font-weight: bold;
|
||||
color: $single-link-color;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
color: $single-link-color-dark;
|
||||
}
|
||||
|
||||
&::before {
|
||||
color: $single-link-hover-color;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
color: $single-link-hover-color-dark;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.collection-nav-simple {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.5em;
|
||||
background-color: darken($global-background-color, 3%);
|
||||
|
||||
[data-theme='dark'] & {
|
||||
background-color: lighten($global-background-color-dark, 3%);
|
||||
}
|
||||
|
||||
a.collection-nav-item {
|
||||
padding-inline: 2px;
|
||||
border-radius: 50%;
|
||||
@include transition(background-color 0.3s ease-out);
|
||||
|
||||
&:hover {
|
||||
background-color: darken($global-background-color, 10%);
|
||||
|
||||
[data-theme='dark'] & {
|
||||
background-color: lighten($global-background-color-dark, 10%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
> i.collection-nav-item {
|
||||
padding: 4px 2px;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,8 @@
|
||||
#comments {
|
||||
>#comments {
|
||||
padding: 2rem 0;
|
||||
@extend .print-d-none;
|
||||
|
||||
iframe {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,12 +3,8 @@
|
||||
text-align: center;
|
||||
margin-top: 3rem;
|
||||
|
||||
.fixit-encryptor-shortcode & {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
#fixit-decryptor-input,
|
||||
.fixit-decryptor-input,
|
||||
.fixit-decryptor-btn,
|
||||
.fixit-encryptor-btn {
|
||||
display: inline-block;
|
||||
box-sizing: border-box;
|
||||
@@ -40,9 +36,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
#fixit-decryptor-input,
|
||||
.fixit-decryptor-input {
|
||||
width: clamp(50%, 400px, 100%);
|
||||
width: calc(clamp(50%, 450px, 100%) - 100px);
|
||||
height: 3rem;
|
||||
padding-left: 1rem;
|
||||
padding-right: 1rem;
|
||||
@@ -53,10 +48,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
.fixit-decryptor-btn,
|
||||
.fixit-encryptor-btn {
|
||||
cursor: pointer;
|
||||
@include transition(all 0.1s ease-out);
|
||||
padding: 0.6rem 1rem;
|
||||
padding: 0.8rem 1rem;
|
||||
|
||||
background-color: $header-background-color;
|
||||
|
||||
@@ -65,3 +61,21 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// fixit-encryptor shortcodes
|
||||
fixit-encryptor {
|
||||
.fixit-decryptor-container {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
&.decrypted > .fixit-decryptor-container {
|
||||
.fixit-decryptor-loading,
|
||||
.fixit-decryptor-input,
|
||||
.fixit-decryptor-btn {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.encrypted-hidden {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
.post-footer {
|
||||
margin: 2rem 0;
|
||||
|
||||
&:has(~.post-reward) {
|
||||
margin-bottom: 0;
|
||||
&~.post-reward {
|
||||
margin-block: -2rem 0;
|
||||
}
|
||||
|
||||
.post-info {
|
||||
border-bottom: 1px solid $global-border-color;
|
||||
padding: 1rem 0 0.3rem;
|
||||
padding: 0.3rem 0;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
border-bottom: 1px solid $global-border-color-dark;
|
||||
@@ -53,6 +53,7 @@
|
||||
}
|
||||
|
||||
.post-info-share {
|
||||
@extend .print-d-none;
|
||||
a * {
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
@@ -61,10 +62,14 @@
|
||||
}
|
||||
|
||||
.post-info-more {
|
||||
padding: 0.3rem 0 1rem;
|
||||
padding: 0.3rem 0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 0.9rem;
|
||||
|
||||
section:last-child {
|
||||
@extend .print-d-none;
|
||||
}
|
||||
}
|
||||
|
||||
.post-tags {
|
||||
@@ -86,6 +91,8 @@
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 1.5rem;
|
||||
padding-block: 0.5rem;
|
||||
@extend .print-d-none;
|
||||
|
||||
.post-nav-item {
|
||||
flex: 1;
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
.post-reward {
|
||||
padding: 1rem;
|
||||
text-align: center;
|
||||
|
||||
&~.post-footer {
|
||||
margin-top: 0;
|
||||
}
|
||||
margin-bottom: -1rem;
|
||||
@extend .print-d-none;
|
||||
|
||||
&:has(.reward-ways:empty) {
|
||||
display: none;
|
||||
@@ -15,8 +13,53 @@
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.reward-ways {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.reward-input:checked~.reward-ways {
|
||||
display: block;
|
||||
padding-top: 20px;
|
||||
|
||||
div {
|
||||
display: inline-block;
|
||||
@include user-select(none);
|
||||
|
||||
span {
|
||||
display: block;
|
||||
}
|
||||
|
||||
&:hover span[data-animation] {
|
||||
animation: var(--animation-reward, jackInTheBox) 0.8s infinite linear;
|
||||
// The animation may affect :hover of img in dark mode
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
img {
|
||||
display: inline-block;
|
||||
margin: 0.8em 2em 0;
|
||||
max-width: 100%;
|
||||
width: $reward-img-width;
|
||||
}
|
||||
}
|
||||
|
||||
// `fixed` mode only supports desktop
|
||||
&[data-mode='fixed'] {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
padding: 1rem;
|
||||
background-color: $global-background-color;
|
||||
@include z-index(2);
|
||||
@include border-radius($global-border-radius);
|
||||
@include box-shadow(0 0 1.5rem 0 rgba(0, 0, 0, 0.2));
|
||||
|
||||
[data-theme='dark'] & {
|
||||
background-color: $global-background-color-dark;
|
||||
@include box-shadow(0 0 1.5rem 0 rgba(255, 255, 255, 0.2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.reward-button {
|
||||
@@ -27,11 +70,11 @@
|
||||
color: lighten($reward-color, 5%);
|
||||
border: 2px solid lighten($reward-color, 10%);
|
||||
border-radius: $global-border-radius;
|
||||
@include transition(all 0.3s ease-out);
|
||||
padding: 0.6rem 1rem;
|
||||
background-color: $global-background-color;
|
||||
vertical-align: text-top;
|
||||
line-height: 1rem;
|
||||
@include transition(all 0.3s ease-out);
|
||||
|
||||
&:active,
|
||||
&:hover {
|
||||
@@ -53,29 +96,3 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.reward-ways {
|
||||
display: none;
|
||||
padding-top: 20px;
|
||||
|
||||
div {
|
||||
display: inline-block;
|
||||
|
||||
span {
|
||||
display: block;
|
||||
}
|
||||
|
||||
&:hover span[data-animation] {
|
||||
animation: var(--animation-reward, jackInTheBox) 0.8s infinite linear;
|
||||
// The animation may affect :hover of img in dark mode
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
|
||||
img {
|
||||
display: inline-block;
|
||||
margin: .8em 2em 0;
|
||||
max-width: 100%;
|
||||
width: $reward-img-width;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,14 +9,16 @@
|
||||
font-size: $toc-content-font-size;
|
||||
|
||||
ul {
|
||||
text-indent: -0.8rem;
|
||||
padding-left: 0.8rem;
|
||||
text-indent: -0.8em;
|
||||
padding-left: 0.8em;
|
||||
list-style: none;
|
||||
|
||||
a:first-child::before {
|
||||
content: '|';
|
||||
font-weight: bolder;
|
||||
margin-right: 0.5rem;
|
||||
margin-right: 0.5em;
|
||||
position: relative;
|
||||
bottom: 2px;
|
||||
color: $single-link-color;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
@@ -25,7 +27,24 @@
|
||||
}
|
||||
|
||||
ul {
|
||||
padding-left: 1.5rem;
|
||||
padding-left: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
ol {
|
||||
margin: 0;
|
||||
padding-left: 2.25em;
|
||||
|
||||
ol {
|
||||
padding-left: 1.25em;
|
||||
}
|
||||
|
||||
li:has(> a:hover)::marker {
|
||||
color: $single-link-color;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
color: $single-link-color-dark;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -50,23 +69,28 @@
|
||||
#toc-auto {
|
||||
display: block;
|
||||
position: sticky;
|
||||
top: $header-height + 0.5rem;
|
||||
padding-left: 1rem;
|
||||
padding-right: 1rem;
|
||||
@include overflow-wrap(break-word);
|
||||
top: calc(#{$header-height} + var(--#{$prefix}breadcrumb-height));
|
||||
box-sizing: border-box;
|
||||
visibility: hidden;
|
||||
|
||||
@include overflow-wrap(break-word);
|
||||
@include blur;
|
||||
@extend .print-d-none;
|
||||
|
||||
[data-header-desktop='normal'] & {
|
||||
--#{$prefix}scroll-mt: #{$global-scroll-margin-top};
|
||||
}
|
||||
|
||||
.toc-title {
|
||||
margin: 0.5rem 0;
|
||||
margin-block: 0 0.5em;
|
||||
cursor: pointer;
|
||||
@include user-select(none);
|
||||
|
||||
&::before {
|
||||
content: '|';
|
||||
font-weight: bolder;
|
||||
margin-right: 0.5rem;
|
||||
margin-right: 0.5em;
|
||||
position: relative;
|
||||
bottom: 2px;
|
||||
color: $global-border-color;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
@@ -87,8 +111,13 @@
|
||||
.toc-content {
|
||||
overflow-y: scroll;
|
||||
max-height: calc(100vh - #{2*$header-height});
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
width: 0;
|
||||
}
|
||||
|
||||
&.always-active ul {
|
||||
&.always-active ul,
|
||||
&.always-active ol {
|
||||
display: block;
|
||||
}
|
||||
|
||||
@@ -96,6 +125,29 @@
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
li.has-active {
|
||||
&::marker {
|
||||
color: $single-link-color;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
color: $single-link-color-dark;
|
||||
}
|
||||
}
|
||||
|
||||
&:has(> .active)::marker {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
> a {
|
||||
color: $single-link-color;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
color: $single-link-color-dark;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// for unordered list automatically collapsed
|
||||
ul {
|
||||
ul {
|
||||
display: none;
|
||||
@@ -104,17 +156,8 @@
|
||||
.has-active > ul {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
a.active {
|
||||
font-weight: bold;
|
||||
color: $single-link-color;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
color: $single-link-color-dark;
|
||||
}
|
||||
|
||||
&::before {
|
||||
a.active::before {
|
||||
color: $single-link-hover-color;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
@@ -122,12 +165,27 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// for ordered list automatically collapsed
|
||||
ol {
|
||||
ol {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.has-active > ol {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
a.active {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#toc-static {
|
||||
display: none;
|
||||
margin: 0.8rem 0;
|
||||
margin: 0.8em 0;
|
||||
|
||||
&[data-kept='true'] {
|
||||
display: block;
|
||||
@@ -137,7 +195,7 @@
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
line-height: 2em;
|
||||
padding: 0 0.75rem;
|
||||
padding: 0 0.75em;
|
||||
background: darken($code-background-color, 3%);
|
||||
|
||||
[data-theme='dark'] & {
|
||||
@@ -148,9 +206,33 @@
|
||||
.toc-content {
|
||||
background-color: $code-background-color;
|
||||
|
||||
> nav > ul {
|
||||
margin: 0;
|
||||
padding: 0.4rem 1rem 0.4rem 1.8rem;
|
||||
> nav {
|
||||
> ul {
|
||||
margin: 0;
|
||||
padding: 0.4em 1em 0.4em 1.8em;
|
||||
|
||||
a:hover {
|
||||
font-weight: bold;
|
||||
|
||||
&::before {
|
||||
color: $single-link-hover-color;
|
||||
|
||||
[data-theme='dark'] & {
|
||||
color: $single-link-hover-color-dark;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
> ol {
|
||||
margin: 0;
|
||||
padding: 0.4em 1em 0.4em 2.25em;
|
||||
|
||||
li:has(> a:hover)::marker,
|
||||
a:hover {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[data-theme='dark'] & {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
.fixed-button {
|
||||
z-index: 100;
|
||||
position: fixed;
|
||||
right: 1.5rem;
|
||||
font-size: 1rem;
|
||||
@@ -7,10 +6,11 @@
|
||||
padding: 0.5rem 0.625rem;
|
||||
color: $global-font-secondary-color;
|
||||
background-color: $header-background-color;
|
||||
@include z-index(1);
|
||||
@include border-radius(1.25rem);
|
||||
@include transition(color 0.4s ease);
|
||||
|
||||
@include blur;
|
||||
@extend .print-d-none;
|
||||
|
||||
&:hover,
|
||||
&:active {
|
||||
|
||||
@@ -1,22 +1,23 @@
|
||||
@keyframes octocat-wave {
|
||||
0%,
|
||||
100% {
|
||||
transform: rotate(0);
|
||||
@include transform(rotate(0));
|
||||
}
|
||||
20%,
|
||||
60% {
|
||||
transform: rotate(-25deg);
|
||||
@include transform(rotate(-25deg));
|
||||
}
|
||||
40%,
|
||||
80% {
|
||||
transform: rotate(10deg);
|
||||
@include transform(rotate(10deg));
|
||||
}
|
||||
}
|
||||
|
||||
.github-corner {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
z-index: 150;
|
||||
@include z-index(2);
|
||||
@extend .print-d-none;
|
||||
|
||||
:hover .octo-arm {
|
||||
animation: octocat-wave 560ms ease-in-out;
|
||||
@@ -37,7 +38,7 @@
|
||||
left: 0;
|
||||
|
||||
svg {
|
||||
transform: scale(-1, 1);
|
||||
@include transform(scale(-1, 1));
|
||||
}
|
||||
}
|
||||
&.right {
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
position: fixed;
|
||||
text-align: center;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
z-index: 150;
|
||||
@include z-index(2);
|
||||
|
||||
[data-theme='dark'] & {
|
||||
background-color: var(--#{$prefix}danger-dark);
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
height: var(--progress-h, 2px);
|
||||
width: var(--progress);
|
||||
background-color: var(--bg-progress, var(--#{$prefix}info));
|
||||
z-index: 150;
|
||||
position: fixed;
|
||||
@include z-index(2);
|
||||
@extend .print-d-none;
|
||||
|
||||
[data-theme="dark"] & {
|
||||
background-color: var(--bg-progress-dark, var(--#{$prefix}info-dark));
|
||||
|
||||
@@ -76,11 +76,27 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
&icon-globe {
|
||||
&shortcut-icon {
|
||||
width: 4rem;
|
||||
height: 4rem;
|
||||
flex-shrink: 0;
|
||||
margin-left: 0.25rem;
|
||||
|
||||
&:is(i) {
|
||||
text-align: center;
|
||||
font-size: 3rem;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
&shortcut-image {
|
||||
width: 4rem;
|
||||
height: 4rem !important;
|
||||
flex-shrink: 0;
|
||||
margin-left: 0.25rem;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
[data-theme='dark'] & {
|
||||
|
||||
@@ -5,3 +5,4 @@
|
||||
@import '_echarts';
|
||||
@import '_instagram';
|
||||
@import '_mapbox';
|
||||
@import '_mermaid';
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
.mermaid {
|
||||
&[data-processed='true'] {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
svg {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,9 @@ $global-font-size: 16px !default;
|
||||
$global-font-weight: 400 !default;
|
||||
$global-line-height: 1.5rem !default;
|
||||
|
||||
// scroll-margin-top of content anchor
|
||||
$global-scroll-margin-top: 0.5rem;
|
||||
|
||||
// Radius of the border
|
||||
$global-border-radius: 5px !default;
|
||||
|
||||
@@ -94,7 +97,7 @@ $single-link-color-dark: #1781b5 !default; // 釉蓝
|
||||
|
||||
// Color of the hover single link
|
||||
$single-link-hover-color: #ea517f !default; // 莲瓣红
|
||||
$single-link-hover-color-dark: #619ac3 !default; // 羽扇豆蓝
|
||||
$single-link-hover-color-dark: #cc5595 !default; // 龙须红
|
||||
|
||||
// Color of the table background
|
||||
$table-background-color: #fff !default;
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
@import "_core/base";
|
||||
@import "_core/layout";
|
||||
@import "_core/common";
|
||||
@import "_core/patch";
|
||||
@import "_page";
|
||||
@import "_core/media";
|
||||
@import "_custom";
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
|
||||
prefix:
|
||||
libFiles: https://cdn.jsdelivr.net/npm/
|
||||
# simple-icons@7.12.0 https://github.com/simple-icons/simple-icons
|
||||
simpleIcons: https://cdn.jsdelivr.net/npm/simple-icons@7.12.0/icons/
|
||||
# simple-icons@9.19.0 https://github.com/simple-icons/simple-icons
|
||||
simpleIcons: https://cdn.jsdelivr.net/npm/simple-icons@9.19.0/icons/
|
||||
libFiles:
|
||||
# algoliasearch@4.14.2 https://github.com/algolia/algoliasearch-client-javascript
|
||||
algoliasearchJS: algoliasearch@4.14.2/dist/algoliasearch-lite.umd.min.js
|
||||
# algoliasearch@4.20.0 https://github.com/algolia/algoliasearch-client-javascript
|
||||
algoliasearchJS: algoliasearch@4.20.0/dist/algoliasearch-lite.umd.min.js
|
||||
# animate.css@4.1.1 https://github.com/daneden/animate.css
|
||||
animateCSS: animate.css@4.1.1/animate.min.css
|
||||
# aplayer@1.10.1 https://github.com/MoePlayer/APlayer
|
||||
aplayerCSS: aplayer@1.10.1/dist/APlayer.min.css
|
||||
aplayerJS: aplayer@1.10.1/dist/APlayer.min.js
|
||||
# artalk@2.3.4 https://github.com/ArtalkJS/Artalk
|
||||
artalkCSS: artalk@2.3.4/dist/Artalk.min.css
|
||||
artalkJS: artalk@2.3.4/dist/Artalk.min.js
|
||||
# artalk@latest https://github.com/ArtalkJS/Artalk
|
||||
artalkCSS: artalk@latest/dist/Artalk.css
|
||||
artalkJS: artalk@latest/dist/Artalk.js
|
||||
# autocomplete-js@0.38.1 https://github.com/algolia/autocomplete
|
||||
# TODO update autocompleteJS: '@algolia/autocomplete-js@1.7.1/dist/umd/index.production.js'
|
||||
autocompleteJS: autocomplete.js@0.38.1/dist/autocomplete.min.js
|
||||
@@ -31,35 +31,32 @@ libFiles:
|
||||
cryptoSha256JS: crypto-js@4.1.1/sha256.js
|
||||
# echarts@5.3.3 https://github.com/apache/echarts
|
||||
echartsJS: echarts@5.3.3/dist/echarts.min.js
|
||||
# eruda@2.5.0 https://github.com/liriliri/eruda
|
||||
erudaJS: eruda@2.5.0/eruda.js
|
||||
# fontawesome-free@6.2.0 https://github.com/FortAwesome/Font-Awesome
|
||||
fontawesomeFreeCSS: '@fortawesome/fontawesome-free@6.2.0/css/all.min.css'
|
||||
# eruda@3.0.1 https://github.com/liriliri/eruda
|
||||
erudaJS: eruda@3.0.1/eruda.js
|
||||
# fontawesome-free@6.4.2 https://github.com/FortAwesome/Font-Awesome
|
||||
fontawesomeFreeCSS: '@fortawesome/fontawesome-free@6.4.2/css/all.min.css'
|
||||
# fusejs@6.6.2 https://github.com/krisk/fuse
|
||||
fuseJS: fuse.js@6.6.2/dist/fuse.min.js
|
||||
# gitalk@1.7.2 https://github.com/gitalk/gitalk
|
||||
gitalkCSS: gitalk@1.7.2/dist/gitalk.min.css
|
||||
gitalkJS: gitalk@1.7.2/dist/gitalk.min.js
|
||||
# katex@0.16.2 https://github.com/KaTeX/KaTeX
|
||||
katexAutoRenderJS: katex@0.16.2/dist/contrib/auto-render.min.js
|
||||
katexCopyTexJS: katex@0.16.2/dist/contrib/copy-tex.min.js
|
||||
katexCSS: katex@0.16.2/dist/katex.min.css
|
||||
katexJS: katex@0.16.2/dist/katex.min.js
|
||||
katexMhchemJS: katex@0.16.2/dist/contrib/mhchem.min.js
|
||||
# lazysizes@5.3.2 https://github.com/aFarkas/lazysizes
|
||||
lazysizesJS: lazysizes@5.3.2/lazysizes.min.js
|
||||
# lightgallery@2.6.1 https://github.com/sachinchoolur/lightgallery
|
||||
lightgalleryCSS: lightgallery@2.6.1/css/lightgallery-bundle.min.css
|
||||
lightgalleryJS: lightgallery@2.6.1/lightgallery.min.js
|
||||
lightgalleryThumbnailJS: lightgallery@2.6.1/plugins/thumbnail/lg-thumbnail.min.js
|
||||
lightgalleryZoomJS: lightgallery@2.6.1/plugins/zoom/lg-zoom.min.js
|
||||
# lunr.js@2.3.9 https://github.com/olivernn/lunr.js
|
||||
lunrJS: lunr@2.3.9/lunr.min.js
|
||||
# instant.page@5.2.0 https://github.com/instantpage/instant.page
|
||||
instantPage: instant.page@5.2.0/instantpage.min.js
|
||||
# katex@0.16.9 https://github.com/KaTeX/KaTeX
|
||||
katexAutoRenderJS: katex@0.16.9/dist/contrib/auto-render.min.js
|
||||
katexCopyTexJS: katex@0.16.9/dist/contrib/copy-tex.min.js
|
||||
katexCSS: katex@0.16.9/dist/katex.min.css
|
||||
katexJS: katex@0.16.9/dist/katex.min.js
|
||||
katexMhchemJS: katex@0.16.9/dist/contrib/mhchem.min.js
|
||||
# lightgallery@2.7.2 https://github.com/sachinchoolur/lightgallery
|
||||
lightgalleryCSS: lightgallery@2.7.2/css/lightgallery-bundle.min.css
|
||||
lightgalleryJS: lightgallery@2.7.2/lightgallery.min.js
|
||||
lightgalleryThumbnailJS: lightgallery@2.7.2/plugins/thumbnail/lg-thumbnail.min.js
|
||||
lightgalleryZoomJS: lightgallery@2.7.2/plugins/zoom/lg-zoom.min.js
|
||||
# mapbox-gl@2.10.0 https://docs.mapbox.com/mapbox-gl-js
|
||||
# TODO update to 3.x
|
||||
mapboxGLCSS: mapbox-gl@2.10.0/dist/mapbox-gl.css
|
||||
mapboxGLJS: mapbox-gl@2.10.0/dist/mapbox-gl.js
|
||||
# mermaid@9.1.7 https://github.com/mermaid-js/mermaid
|
||||
mermaidJS: mermaid@9.1.7/dist/mermaid.min.js
|
||||
# meting@2.0.1 https://github.com/metowolf/MetingJS
|
||||
metingJS: meting@2.0.1/dist/Meting.min.js
|
||||
# object-fit-images@3.2.4 https://github.com/fregante/object-fit-images
|
||||
@@ -68,19 +65,19 @@ libFiles:
|
||||
panguJS: pangu@4.0.7/dist/browser/pangu.min.js
|
||||
# pace-js@1.2.4 https://github.com/CodeByZach/pace
|
||||
paceJS: pace-js@1.2.4
|
||||
# sharer.js@0.4.2 https://github.com/ellisonleao/sharer.js
|
||||
# sharer.js@0.5.1 https://github.com/ellisonleao/sharer.js
|
||||
sharerJS: sharer.js@0.5.1/sharer.min.js
|
||||
# twemoji@13.1.0 https://github.com/twitter/twemoji
|
||||
# twemoji@14.0.2 https://github.com/twitter/twemoji
|
||||
twemojiJS: twemoji@14.0.2/dist/twemoji.min.js
|
||||
# twikoo@1.6.8 https://github.com/imaegoo/twikoo
|
||||
twikooJS: twikoo@1.6.8/dist/twikoo.all.min.js
|
||||
# typeit@8.7.0 https://github.com/alexmacarthur/typeit
|
||||
typeitJS: typeit@8.7.0/dist/index.umd.js
|
||||
# twikoo@1.6.22 https://github.com/imaegoo/twikoo
|
||||
twikooJS: twikoo@1.6.22/dist/twikoo.all.min.js
|
||||
# typeit@8.7.1 https://github.com/alexmacarthur/typeit
|
||||
typeitJS: typeit@8.7.1/dist/index.umd.js
|
||||
# valine@1.5.1 https://github.com/xCss/Valine
|
||||
valineJS: valine@1.5.1/dist/Valine.min.js
|
||||
# vconsole@3.14.6 https://github.com/Tencent/vConsole
|
||||
vconsoleJS: vconsole@3.14.6/dist/vconsole.min.js
|
||||
# waline@2.10.0 https://github.com/walinejs/waline
|
||||
walineCSS: '@waline/client@2.10.0/dist/waline.css'
|
||||
walineJS: '@waline/client@2.10.0/dist/waline.js'
|
||||
# vconsole@3.15.1 https://github.com/Tencent/vConsole
|
||||
vconsoleJS: vconsole@3.15.1/dist/vconsole.min.js
|
||||
# waline@2.15.8 https://github.com/walinejs/waline
|
||||
walineCSS: '@waline/client@2.15.8/dist/waline.css'
|
||||
walineJS: '@waline/client@2.15.8/dist/waline.js'
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
|
||||
prefix:
|
||||
libFiles: https://unpkg.com/
|
||||
# simple-icons@7.12.0 https://github.com/simple-icons/simple-icons
|
||||
simpleIcons: https://unpkg.com/simple-icons@7.12.0/icons/
|
||||
# simple-icons@9.19.0 https://github.com/simple-icons/simple-icons
|
||||
simpleIcons: https://unpkg.com/simple-icons@9.19.0/icons/
|
||||
libFiles:
|
||||
# algoliasearch@4.14.2 https://github.com/algolia/algoliasearch-client-javascript
|
||||
algoliasearchJS: algoliasearch@4.14.2/dist/algoliasearch-lite.umd.min.js
|
||||
# algoliasearch@4.20.0 https://github.com/algolia/algoliasearch-client-javascript
|
||||
algoliasearchJS: algoliasearch@4.20.0/dist/algoliasearch-lite.umd.js
|
||||
# animate.css@4.1.1 https://github.com/daneden/animate.css
|
||||
animateCSS: animate.css@4.1.1/animate.min.css
|
||||
# aplayer@1.10.1 https://github.com/MoePlayer/APlayer
|
||||
aplayerCSS: aplayer@1.10.1/dist/APlayer.min.css
|
||||
aplayerJS: aplayer@1.10.1/dist/APlayer.min.js
|
||||
# artalk@2.3.4 https://github.com/ArtalkJS/Artalk
|
||||
artalkCSS: artalk@2.3.4/dist/Artalk.css
|
||||
artalkJS: artalk@2.3.4/dist/Artalk.js
|
||||
# artalk@latest https://github.com/ArtalkJS/Artalk
|
||||
artalkCSS: artalk@latest/dist/Artalk.css
|
||||
artalkJS: artalk@latest/dist/Artalk.js
|
||||
# autocomplete-js@0.38.1 https://github.com/algolia/autocomplete
|
||||
# TODO update autocompleteJS: '@algolia/autocomplete-js@1.7.1/dist/umd/index.production.js'
|
||||
autocompleteJS: autocomplete.js@0.38.1/dist/autocomplete.min.js
|
||||
@@ -31,35 +31,32 @@ libFiles:
|
||||
cryptoSha256JS: crypto-js@4.1.1/sha256.js
|
||||
# echarts@5.3.3 https://github.com/apache/echarts
|
||||
echartsJS: echarts@5.3.3/dist/echarts.min.js
|
||||
# eruda@2.5.0 https://github.com/liriliri/eruda
|
||||
erudaJS: eruda@2.5.0/eruda.js
|
||||
# fontawesome-free@6.2.0 https://github.com/FortAwesome/Font-Awesome
|
||||
fontawesomeFreeCSS: '@fortawesome/fontawesome-free@6.2.0/css/all.min.css'
|
||||
# eruda@3.0.1 https://github.com/liriliri/eruda
|
||||
erudaJS: eruda@3.0.1/eruda.js
|
||||
# fontawesome-free@6.4.2 https://github.com/FortAwesome/Font-Awesome
|
||||
fontawesomeFreeCSS: '@fortawesome/fontawesome-free@6.4.2/css/all.min.css'
|
||||
# fusejs@6.6.2 https://github.com/krisk/fuse
|
||||
fuseJS: fuse.js@6.6.2/dist/fuse.min.js
|
||||
# gitalk@1.7.2 https://github.com/gitalk/gitalk
|
||||
gitalkCSS: gitalk@1.7.2/dist/gitalk.min.css
|
||||
gitalkJS: gitalk@1.7.2/dist/gitalk.min.js
|
||||
# katex@0.16.2 https://github.com/KaTeX/KaTeX
|
||||
katexAutoRenderJS: katex@0.16.2/dist/contrib/auto-render.min.js
|
||||
katexCopyTexJS: katex@0.16.2/dist/contrib/copy-tex.min.js
|
||||
katexCSS: katex@0.16.2/dist/katex.min.css
|
||||
katexJS: katex@0.16.2/dist/katex.min.js
|
||||
katexMhchemJS: katex@0.16.2/dist/contrib/mhchem.min.js
|
||||
# lazysizes@5.3.2 https://github.com/aFarkas/lazysizes
|
||||
lazysizesJS: lazysizes@5.3.2/lazysizes.min.js
|
||||
# lightgallery@2.6.1 https://github.com/sachinchoolur/lightgallery
|
||||
lightgalleryCSS: lightgallery@2.6.1/css/lightgallery-bundle.min.css
|
||||
lightgalleryJS: lightgallery@2.6.1/lightgallery.min.js
|
||||
lightgalleryThumbnailJS: lightgallery@2.6.1/plugins/thumbnail/lg-thumbnail.min.js
|
||||
lightgalleryZoomJS: lightgallery@2.6.1/plugins/zoom/lg-zoom.min.js
|
||||
# lunr.js@2.3.9 https://github.com/olivernn/lunr.js
|
||||
lunrJS: lunr@2.3.9/lunr.min.js
|
||||
# instant.page@5.2.0 https://github.com/instantpage/instant.page
|
||||
instantPage: instant.page@5.2.0/instantpage.js
|
||||
# katex@0.16.9 https://github.com/KaTeX/KaTeX
|
||||
katexAutoRenderJS: katex@0.16.9/dist/contrib/auto-render.min.js
|
||||
katexCopyTexJS: katex@0.16.9/dist/contrib/copy-tex.min.js
|
||||
katexCSS: katex@0.16.9/dist/katex.min.css
|
||||
katexJS: katex@0.16.9/dist/katex.min.js
|
||||
katexMhchemJS: katex@0.16.9/dist/contrib/mhchem.min.js
|
||||
# lightgallery@2.7.2 https://github.com/sachinchoolur/lightgallery
|
||||
lightgalleryCSS: lightgallery@2.7.2/css/lightgallery-bundle.min.css
|
||||
lightgalleryJS: lightgallery@2.7.2/lightgallery.min.js
|
||||
lightgalleryThumbnailJS: lightgallery@2.7.2/plugins/thumbnail/lg-thumbnail.min.js
|
||||
lightgalleryZoomJS: lightgallery@2.7.2/plugins/zoom/lg-zoom.min.js
|
||||
# mapbox-gl@2.10.0 https://docs.mapbox.com/mapbox-gl-js
|
||||
# TODO update to 3.x
|
||||
mapboxGLCSS: mapbox-gl@2.10.0/dist/mapbox-gl.css
|
||||
mapboxGLJS: mapbox-gl@2.10.0/dist/mapbox-gl.js
|
||||
# mermaid@9.1.7 https://github.com/mermaid-js/mermaid
|
||||
mermaidJS: mermaid@9.1.7/dist/mermaid.min.js
|
||||
# meting@2.0.1 https://github.com/metowolf/MetingJS
|
||||
metingJS: meting@2.0.1/dist/Meting.min.js
|
||||
# object-fit-images@3.2.4 https://github.com/fregante/object-fit-images
|
||||
@@ -68,19 +65,19 @@ libFiles:
|
||||
panguJS: pangu@4.0.7/dist/browser/pangu.min.js
|
||||
# pace-js@1.2.4 https://github.com/CodeByZach/pace
|
||||
paceJS: pace-js@1.2.4
|
||||
# sharer.js@0.4.2 https://github.com/ellisonleao/sharer.js
|
||||
# sharer.js@0.5.1 https://github.com/ellisonleao/sharer.js
|
||||
sharerJS: sharer.js@0.5.1/sharer.min.js
|
||||
# twemoji@13.1.0 https://github.com/twitter/twemoji
|
||||
# twemoji@14.0.2 https://github.com/twitter/twemoji
|
||||
twemojiJS: twemoji@14.0.2/dist/twemoji.min.js
|
||||
# twikoo@1.6.8 https://github.com/imaegoo/twikoo
|
||||
twikooJS: twikoo@1.6.8/dist/twikoo.all.min.js
|
||||
# typeit@8.7.0 https://github.com/alexmacarthur/typeit
|
||||
typeitJS: typeit@8.7.0/dist/index.umd.js
|
||||
# twikoo@1.6.22 https://github.com/imaegoo/twikoo
|
||||
twikooJS: twikoo@1.6.22/dist/twikoo.all.min.js
|
||||
# typeit@8.7.1 https://github.com/alexmacarthur/typeit
|
||||
typeitJS: typeit@8.7.1/dist/index.umd.js
|
||||
# valine@1.5.1 https://github.com/xCss/Valine
|
||||
valineJS: valine@1.5.1/dist/Valine.min.js
|
||||
# vconsole@3.14.6 https://github.com/Tencent/vConsole
|
||||
vconsoleJS: vconsole@3.14.6/dist/vconsole.min.js
|
||||
# waline@2.10.0 https://github.com/walinejs/waline
|
||||
walineCSS: '@waline/client@2.10.0/dist/waline.css'
|
||||
walineJS: '@waline/client@2.10.0/dist/waline.js'
|
||||
# vconsole@3.15.1 https://github.com/Tencent/vConsole
|
||||
vconsoleJS: vconsole@3.15.1/dist/vconsole.min.js
|
||||
# waline@2.15.8 https://github.com/walinejs/waline
|
||||
walineCSS: '@waline/client@2.15.8/dist/waline.css'
|
||||
walineJS: '@waline/client@2.15.8/dist/waline.js'
|
||||
|
||||
@@ -547,7 +547,7 @@ qqgroup:
|
||||
Template: https://qm.qq.com/cgi-bin/qm/qr?k=%v&jump_from=webapi
|
||||
Title: QQ Group
|
||||
Icon:
|
||||
Class: fa-solid fa-users
|
||||
Simpleicons: tencentqq
|
||||
|
||||
# 070: Diaspora
|
||||
diaspora:
|
||||
@@ -562,7 +562,7 @@ csdn:
|
||||
Prefix: https://blog.csdn.net/
|
||||
Title: CSDN
|
||||
Icon:
|
||||
Src: svg/icons/csdn.svg
|
||||
Src: images/icons/csdn.svg
|
||||
|
||||
# 072: Discord User Profile
|
||||
discord:
|
||||
@@ -573,7 +573,7 @@ discord:
|
||||
Class: fa-brands fa-discord fa-fw
|
||||
|
||||
# 073: Discord Server Invite Link
|
||||
discordInvite:
|
||||
discordinvite:
|
||||
Weight: 73
|
||||
Prefix: https://discord.gg/
|
||||
Title: Discord
|
||||
@@ -615,13 +615,13 @@ plume:
|
||||
Weight: 78
|
||||
Title: Plume
|
||||
Icon:
|
||||
Src: svg/icons/plume.svg
|
||||
Src: images/icons/plume.svg
|
||||
|
||||
# 079: Hack The Box
|
||||
hackthebox:
|
||||
Weight: 79
|
||||
Title: Hack The Box
|
||||
Prefix: https://app.hackthebox.com/profile/
|
||||
Prefix: https://app.hackthebox.com/users/
|
||||
Icon:
|
||||
Simpleicons: hackthebox
|
||||
|
||||
@@ -631,7 +631,7 @@ rootme:
|
||||
Title: Root-Me
|
||||
Prefix: https://www.root-me.org/
|
||||
Icon:
|
||||
Src: svg/icons/rootme.svg
|
||||
Src: images/icons/rootme.svg
|
||||
|
||||
# 081: Feishu
|
||||
feishu:
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" version="1.1"><defs><style>.fixit-ban{opacity:.9;}</style></defs><path d="M159.12 338.69l24.8-16.54a78.87 78.87 0 0 1-6.77-22.72l-30.88 4.41a16 16 0 0 1-4.54-31.68l34.27-4.9v-.76l98.94 98.95a76.89 76.89 0 0 1-71.68-17.73l-26.39 17.59c-.15.11-.31.21-.47.31a16 16 0 0 1-17.28-26.93zm224.72-48.42a16 16 0 0 0-13.57-18.11l-34.27-4.9V244.9l34.27-4.9a16 16 0 1 0-4.54-31.68l-30.54 4.36a79.31 79.31 0 0 0-6.85-22.85l24.54-16.36a16 16 0 1 0-17.29-26.93l-.46.31-26 17.34a79.9 79.9 0 0 0-102.64-3l139.83 139.88 19.41 2.77a16 16 0 0 0 18.11-13.57z" fill="#358C3C" class="fixit-bug"/><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 432c-101.46 0-184-82.54-184-184a182.84 182.84 0 0 1 33.38-105.37l256 256A182.86 182.86 0 0 1 256 440zm150.62-78.63l-256-256A182.84 182.84 0 0 1 256 72c101.46 0 184 82.54 184 184a182.84 182.84 0 0 1-33.38 105.37z" fill="#FF6347" class="fixit-ban"/></svg>
|
||||
|
Before Width: | Height: | Size: 968 B |
@@ -0,0 +1,11 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" version="1.1">
|
||||
<defs>
|
||||
<style>.fixit-ban{opacity:.9;}</style>
|
||||
</defs>
|
||||
<path
|
||||
d="M159.12 338.69l24.8-16.54a78.87 78.87 0 0 1-6.77-22.72l-30.88 4.41a16 16 0 0 1-4.54-31.68l34.27-4.9v-.76l98.94 98.95a76.89 76.89 0 0 1-71.68-17.73l-26.39 17.59c-.15.11-.31.21-.47.31a16 16 0 0 1-17.28-26.93zm224.72-48.42a16 16 0 0 0-13.57-18.11l-34.27-4.9V244.9l34.27-4.9a16 16 0 1 0-4.54-31.68l-30.54 4.36a79.31 79.31 0 0 0-6.85-22.85l24.54-16.36a16 16 0 1 0-17.29-26.93l-.46.31-26 17.34a79.9 79.9 0 0 0-102.64-3l139.83 139.88 19.41 2.77a16 16 0 0 0 18.11-13.57z"
|
||||
fill="#358C3C" class="fixit-bug" />
|
||||
<path
|
||||
d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 432c-101.46 0-184-82.54-184-184a182.84 182.84 0 0 1 33.38-105.37l256 256A182.86 182.86 0 0 1 256 440zm150.62-78.63l-256-256A182.84 182.84 0 0 1 256 72c101.46 0 184 82.54 184 184a182.84 182.84 0 0 1-33.38 105.37z"
|
||||
fill="#FF6347" class="fixit-ban" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1004 B |
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
viewBox="0 0 370 391" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#FF4088;stroke:#C9177E;stroke-width:27;}
|
||||
.st1{fill-rule:evenodd;clip-rule:evenodd;fill:#FFFFFF;}
|
||||
</style>
|
||||
<path class="st0" d="M207.5,22.4L321.9,89c13.5,7.9,21.9,22.4,21.9,38v136.4c0,17.3-9.3,33.3-24.5,41.8l-113.5,63.9
|
||||
c-15.1,8.5-33.5,8.4-48.5-0.2L52.8,308.8c-16.4-9.5-26.6-27-26.6-45.9V133.4c0-19.1,9.9-36.8,26.1-46.8l102.8-63.5
|
||||
C171.1,13.2,191.3,13,207.5,22.4z"/>
|
||||
<polygon class="st1" points="105.6,298.2 105.6,91 149,91 149,166.5 220.9,166.5 220.9,91 264.4,91 264.4,298.2 220.9,298.2
|
||||
220.9,207.6 149,207.6 149,298.2 "/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 787 B |
|
Before Width: | Height: | Size: 547 B After Width: | Height: | Size: 547 B |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 503 B After Width: | Height: | Size: 503 B |
@@ -1,35 +1,35 @@
|
||||
/**
|
||||
* Custom javascript for FixIt site.
|
||||
* Custom JavaScript for FixIt blog site.
|
||||
* @author @Lruihao https://lruihao.cn
|
||||
*/
|
||||
const FixItCustom = new (function () {
|
||||
class FixItBlog {
|
||||
/**
|
||||
* Hello World
|
||||
* You can define your own functions below.
|
||||
* @returns {FixItCustom}
|
||||
* say hello
|
||||
* you can define your own functions below
|
||||
* @returns {FixItBlog}
|
||||
*/
|
||||
this.hello = () => {
|
||||
console.log('FixItCustom echo: Hello FixIt!');
|
||||
hello() {
|
||||
console.log('custom.js: Hello FixIt!');
|
||||
return this;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize.
|
||||
* @returns {FixItCustom}
|
||||
* initialize
|
||||
* @returns {FixItBlog}
|
||||
*/
|
||||
this.init = () => {
|
||||
// Custom infos.
|
||||
init() {
|
||||
this.hello();
|
||||
return this;
|
||||
};
|
||||
})();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Immediate.
|
||||
* immediate execution
|
||||
*/
|
||||
(() => {
|
||||
FixItCustom.init();
|
||||
// It will be executed when the DOM tree is built.
|
||||
window.fixitBlog = new FixItBlog();
|
||||
// it will be executed when the DOM tree is built
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
// FixItCustom.init();
|
||||
window.fixitBlog.init();
|
||||
});
|
||||
})();
|
||||
|
||||
@@ -12,86 +12,125 @@ FixItDecryptor = function (options = {}) {
|
||||
this.options = options || {};
|
||||
this.options.duration = this.options.duration || 24 * 60 * 60; // default cache one day
|
||||
this.decryptedEventSet = new Set();
|
||||
this.partialDecryptedEventSet = new Set();
|
||||
this.resetEventSet = new Set();
|
||||
this.$el = document.querySelector('.fixit-decryptor-container');
|
||||
|
||||
/**
|
||||
* decrypt content
|
||||
* @param {String} base64EncodeContent encrypted content
|
||||
* @param {Element} $content content element
|
||||
* @param {String} salt salt string
|
||||
* @param {Boolean} [isAll=true] whether to decrypt all content
|
||||
*/
|
||||
var _decryptContent = (base64EncodeContent) => {
|
||||
var _decryptContent = ($content, salt, isAll=true) => {
|
||||
try {
|
||||
this.$el.querySelector('.fixit-decryptor-loading').classList.add('d-none');
|
||||
this.$el.querySelector('#fixit-decryptor-input').classList.add('d-none');
|
||||
this.$el.querySelector('.fixit-encryptor-btn').classList.remove('d-none');
|
||||
document.querySelector('#content').insertAdjacentHTML(
|
||||
if (isAll) {
|
||||
// decrypt all content
|
||||
this.$el.querySelector('.fixit-decryptor-loading').classList.add('d-none');
|
||||
this.$el.querySelector('.fixit-decryptor-input').classList.add('d-none');
|
||||
this.$el.querySelector('.fixit-decryptor-btn').classList.add('d-none');
|
||||
this.$el.querySelector('.fixit-encryptor-btn').classList.remove('d-none');
|
||||
} else {
|
||||
// decrypt shortcode content
|
||||
$content.parentElement.classList.add('decrypted');
|
||||
}
|
||||
$content.insertAdjacentHTML(
|
||||
'afterbegin',
|
||||
CryptoJS.enc.Base64.parse(base64EncodeContent).toString(CryptoJS.enc.Utf8)
|
||||
CryptoJS.enc.Base64
|
||||
.parse($content.getAttribute('data-content').replace(salt, ''))
|
||||
.toString(CryptoJS.enc.Utf8)
|
||||
);
|
||||
} catch (err) {
|
||||
return console.error(err);
|
||||
}
|
||||
// decrypted hook
|
||||
console.log(this.decryptedEventSet)
|
||||
for (const event of this.decryptedEventSet) {
|
||||
event();
|
||||
}
|
||||
const eventSet = isAll ? this.decryptedEventSet : this.partialDecryptedEventSet;
|
||||
for (const event of eventSet) {
|
||||
event($content);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* validate password
|
||||
* @param {Element} $decryptor decryptor element
|
||||
* @param {Element} $content content element
|
||||
* @param {Function} callback callback function after password validation
|
||||
* @returns
|
||||
*/
|
||||
var _validatePassword = ($decryptor, $content, callback) => {
|
||||
const password = $content.getAttribute('data-password');
|
||||
const inputEl = $decryptor.querySelector('.fixit-decryptor-input');
|
||||
const input = inputEl.value.trim();
|
||||
const inputMd5 = CryptoJS.MD5(input).toString();
|
||||
const inputSha256 = CryptoJS.SHA256(input).toString();
|
||||
const saltLen = input.length % 2 ? input.length : input.length + 1;
|
||||
|
||||
inputEl.value = '';
|
||||
inputEl.blur();
|
||||
if (!input) {
|
||||
alert('Please enter the correct password!');
|
||||
return console.warn('Please enter the correct password!');
|
||||
}
|
||||
if (inputMd5 !== password) {
|
||||
alert(`Password error: ${input} not the correct password!`);
|
||||
return console.warn(`Password error: ${input} not the correct password!`);
|
||||
}
|
||||
callback(inputMd5, inputSha256.slice(saltLen));
|
||||
}
|
||||
|
||||
/**
|
||||
* initialize FixIt decryptor
|
||||
*/
|
||||
_proto.init = () => {
|
||||
this.addEventListener('decrypted', this.options?.decrypted);
|
||||
this.addEventListener('partial-decrypted', this.options?.partialDecrypted);
|
||||
this.addEventListener('reset', this.options?.reset);
|
||||
this.validateCache();
|
||||
|
||||
const _decryptor = this;
|
||||
this.$el.querySelector('#fixit-decryptor-input')?.addEventListener('keydown', function (e) {
|
||||
if (e.key === 'Enter') {
|
||||
e.preventDefault();
|
||||
const $content = document.querySelector('#content');
|
||||
const password = $content.getAttribute('data-password');
|
||||
const input = this.value.trim();
|
||||
const saltLen = input.length % 2 ? input.length : input.length + 1;
|
||||
const inputMd5 = CryptoJS.MD5(input).toString();
|
||||
const inputSha256 = CryptoJS.SHA256(input).toString();
|
||||
|
||||
this.value = '';
|
||||
this.blur();
|
||||
if (!input) {
|
||||
alert('Please enter the correct password!');
|
||||
return console.warn('Please enter the correct password!');
|
||||
}
|
||||
if (inputMd5 !== password) {
|
||||
alert(`Password error: ${input} not the correct password!`);
|
||||
return console.warn(`Password error: ${input} not the correct password!`);
|
||||
}
|
||||
const decryptorHandler = () => {
|
||||
const $content = document.querySelector('#content');
|
||||
_validatePassword(this.$el, $content, (passwordMD5, salt) => {
|
||||
// cache decryption statistics
|
||||
window.localStorage?.setItem(
|
||||
`fixit-decryptor/#${location.pathname}`,
|
||||
JSON.stringify({
|
||||
expiration: Math.ceil(Date.now() / 1000) + _decryptor.options.duration,
|
||||
md5: inputMd5,
|
||||
sha256: inputSha256.slice(saltLen)
|
||||
expiration: Math.ceil(Date.now() / 1000) + this.options.duration,
|
||||
password: passwordMD5,
|
||||
salt,
|
||||
})
|
||||
);
|
||||
_decryptContent($content.getAttribute('data-content').replace(inputSha256.slice(saltLen), ''));
|
||||
_decryptContent($content, salt);
|
||||
});
|
||||
};
|
||||
|
||||
// bind decryptor input enter keydown event
|
||||
this.$el.querySelector('#fixit-decryptor-input')?.addEventListener('keydown', (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
e.preventDefault();
|
||||
decryptorHandler();
|
||||
}
|
||||
});
|
||||
|
||||
this.$el.querySelector('.fixit-encryptor-btn')?.addEventListener('click', function (e) {
|
||||
|
||||
// bind decryptor button click event
|
||||
this.$el.querySelector('.fixit-decryptor-btn')?.addEventListener('click', (e) => {
|
||||
e.preventDefault();
|
||||
this.classList.add('d-none')
|
||||
_decryptor.$el.querySelector('#fixit-decryptor-input').classList.remove('d-none');
|
||||
decryptorHandler();
|
||||
});
|
||||
|
||||
// bind encryptor button click event
|
||||
this.$el.querySelector('.fixit-encryptor-btn')?.addEventListener('click', (e) => {
|
||||
e.preventDefault();
|
||||
e.target.classList.add('d-none')
|
||||
this.$el.querySelector('.fixit-decryptor-input').classList.remove('d-none');
|
||||
this.$el.querySelector('.fixit-decryptor-btn').classList.remove('d-none');
|
||||
document.querySelector('#content').innerHTML = '';
|
||||
document.querySelector('#content').insertAdjacentElement(
|
||||
'afterbegin',
|
||||
_decryptor.$el
|
||||
this.$el
|
||||
);
|
||||
window.localStorage?.removeItem(`fixit-decryptor/#${location.pathname}`);
|
||||
// reset hook
|
||||
for (const event of _decryptor.resetEventSet) {
|
||||
for (const event of this.resetEventSet) {
|
||||
event();
|
||||
}
|
||||
});
|
||||
@@ -101,50 +140,31 @@ FixItDecryptor = function (options = {}) {
|
||||
* initialize fixit-encryptor shortcodes
|
||||
*/
|
||||
_proto.initShortcodes = () => {
|
||||
// TODO TODO shortcode decrypted event
|
||||
// this.addEventListener('decrypted', this.options?.decrypted);
|
||||
const _decryptor = this;
|
||||
const $shortcodes = document.querySelectorAll('fixit-encryptor:not(.decrypted)');
|
||||
customElements.get('fixit-encryptor') || customElements.define('fixit-encryptor', class extends HTMLElement {});
|
||||
const $shortcodes = document.querySelectorAll('fixit-encryptor:not(:has(.decrypted))');
|
||||
|
||||
$shortcodes.forEach($shortcode => {
|
||||
const decryptorHandler = () => {
|
||||
const $decryptor = $shortcode.querySelector('.fixit-decryptor-container');
|
||||
const $content = $shortcode.querySelector('[data-password][data-content]');
|
||||
_validatePassword($decryptor, $content, (passwordMD5, salt) => {
|
||||
_decryptContent($content, salt, false);
|
||||
});
|
||||
};
|
||||
|
||||
// bind decryptor input enter keydown event
|
||||
$shortcode.querySelector('.fixit-decryptor-input')?.addEventListener('keydown', function (e) {
|
||||
if (e.key === 'Enter') {
|
||||
e.preventDefault();
|
||||
const $decryptor = this.parentElement.parentElement;
|
||||
const $content = $decryptor.nextElementSibling;
|
||||
const password = $content.getAttribute('data-password');
|
||||
const input = this.value.trim();
|
||||
const saltLen = input.length % 2 ? input.length : input.length + 1;
|
||||
const inputMd5 = CryptoJS.MD5(input).toString();
|
||||
const inputSha256 = CryptoJS.SHA256(input).toString();
|
||||
|
||||
this.value = '';
|
||||
this.blur();
|
||||
if (!input) {
|
||||
alert('Please enter the correct password!');
|
||||
return console.warn('Please enter the correct password!');
|
||||
}
|
||||
if (inputMd5 !== password) {
|
||||
alert(`Password error: ${input} not the correct password!`);
|
||||
return console.warn(`Password error: ${input} not the correct password!`);
|
||||
}
|
||||
try {
|
||||
const base64EncodeContent = $content.getAttribute('data-content').replace(inputSha256.slice(saltLen), '');
|
||||
$decryptor.querySelector('.fixit-decryptor-input').classList.add('d-none');
|
||||
$content.insertAdjacentHTML(
|
||||
'afterbegin',
|
||||
CryptoJS.enc.Base64.parse(base64EncodeContent).toString(CryptoJS.enc.Utf8)
|
||||
);
|
||||
$decryptor.parentElement.classList.add('decrypted');
|
||||
} catch (err) {
|
||||
return console.error(err);
|
||||
}
|
||||
// TODO shortcode decrypted hook
|
||||
// for (const event of _decryptor.decryptedEventSet) {
|
||||
// event();
|
||||
// }
|
||||
decryptorHandler();
|
||||
}
|
||||
});
|
||||
|
||||
// bind decryptor button click event
|
||||
$shortcode.querySelector('.fixit-decryptor-btn')?.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
decryptorHandler();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
@@ -159,17 +179,18 @@ FixItDecryptor = function (options = {}) {
|
||||
|
||||
if (!cachedStat) {
|
||||
this.$el.querySelector('.fixit-decryptor-loading').classList.add('d-none');
|
||||
this.$el.querySelector('#fixit-decryptor-input').classList.remove('d-none');
|
||||
this.$el.querySelector('.fixit-decryptor-input').classList.remove('d-none');
|
||||
this.$el.querySelector('.fixit-decryptor-btn').classList.remove('d-none');
|
||||
return this;
|
||||
}
|
||||
if (cachedStat?.md5 !== password || Number(cachedStat?.expiration) < Math.ceil(Date.now() / 1000)) {
|
||||
if (cachedStat?.password !== password || Number(cachedStat?.expiration) < Math.ceil(Date.now() / 1000)) {
|
||||
this.$el.querySelector('.fixit-decryptor-loading').classList.add('d-none');
|
||||
this.$el.querySelector('#fixit-decryptor-input').classList.remove('d-none');
|
||||
this.$el.querySelector('.fixit-decryptor-input').classList.remove('d-none');
|
||||
window.localStorage?.removeItem(`fixit-decryptor/#${location.pathname}`);
|
||||
console.warn('The password has expired, please re-enter!');
|
||||
return this;
|
||||
}
|
||||
_decryptContent($content.getAttribute('data-content').replace(cachedStat.sha256, ''));
|
||||
_decryptContent($content, cachedStat.salt);
|
||||
return this;
|
||||
};
|
||||
|
||||
@@ -187,6 +208,9 @@ FixItDecryptor = function (options = {}) {
|
||||
case 'decrypted':
|
||||
this.decryptedEventSet.add(listener);
|
||||
break;
|
||||
case 'partial-decrypted':
|
||||
this.partialDecryptedEventSet.add(listener);
|
||||
break;
|
||||
case 'reset':
|
||||
this.resetEventSet.add(listener);
|
||||
break;
|
||||
@@ -211,6 +235,9 @@ FixItDecryptor = function (options = {}) {
|
||||
case 'decrypted':
|
||||
this.decryptedEventSet.delete(listener);
|
||||
break;
|
||||
case 'partial-decrypted':
|
||||
this.partialDecryptedEventSet.delete(listener);
|
||||
break;
|
||||
case 'reset':
|
||||
this.resetEventSet.delete(listener);
|
||||
break;
|
||||
|
||||
@@ -8,14 +8,12 @@ const BASE_CACHE_FILES = [
|
||||
'/css/style.min.css',
|
||||
'/js/theme.min.js',
|
||||
'/site.webmanifest',
|
||||
'/fixit.min.svg'
|
||||
];
|
||||
|
||||
const OFFLINE_CACHE_FILES = [
|
||||
'/css/style.min.css',
|
||||
'/js/theme.min.js',
|
||||
'/site.webmanifest',
|
||||
'/fixit.min.svg',
|
||||
'/offline/'
|
||||
];
|
||||
|
||||
@@ -23,7 +21,6 @@ const NOT_FOUND_CACHE_FILES = [
|
||||
'/css/style.min.css',
|
||||
'/js/theme.min.js',
|
||||
'/site.webmanifest',
|
||||
'/fixit.min.svg',
|
||||
'/404.html'
|
||||
];
|
||||
|
||||
|
||||
@@ -1,66 +1,8 @@
|
||||
class Util {
|
||||
forEach(elements, handler) {
|
||||
elements = elements || [];
|
||||
for (let i = 0; i < elements.length; i++) {
|
||||
handler(elements[i]);
|
||||
}
|
||||
}
|
||||
|
||||
getScrollTop() {
|
||||
return (document.documentElement ?? document.body).scrollTop;
|
||||
}
|
||||
|
||||
isMobile() {
|
||||
return window.matchMedia('only screen and (max-width: 680px)').matches;
|
||||
}
|
||||
|
||||
isTocStatic() {
|
||||
return window.matchMedia('only screen and (max-width: 960px)').matches;
|
||||
}
|
||||
|
||||
/**
|
||||
* add animate to element
|
||||
* @param {Element} element animate element
|
||||
* @param {String|Array<String>} animation animation name
|
||||
* @param {Boolean} reserved reserved animation
|
||||
* @param {Function} callback remove callback
|
||||
*/
|
||||
animateCSS(element, animation, reserved, callback) {
|
||||
!Array.isArray(animation) && (animation = [animation]);
|
||||
element.classList.add('animate__animated', ...animation);
|
||||
element.addEventListener('animationend', () => {
|
||||
!reserved && element.classList.remove('animate__animated', ...animation);
|
||||
typeof callback === 'function' && callback();
|
||||
}, { once: true });
|
||||
}
|
||||
|
||||
/**
|
||||
* date validator
|
||||
* @param {*} date may be date or not
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
isValidDate(date) {
|
||||
return date instanceof Date && !isNaN(date.getTime());
|
||||
}
|
||||
|
||||
/**
|
||||
* scroll some element into view
|
||||
* @param {String} selector element to scroll
|
||||
*/
|
||||
scrollIntoView(selector) {
|
||||
const element = selector.startsWith('#')
|
||||
? document.getElementById(selector.slice(1))
|
||||
: document.querySelector(selector);
|
||||
element?.scrollIntoView({
|
||||
behavior: 'smooth'
|
||||
});
|
||||
}
|
||||
}
|
||||
import Util from './util';
|
||||
|
||||
class FixIt {
|
||||
constructor() {
|
||||
this.config = window.config;
|
||||
this.data = this.config.data;
|
||||
this.isDark = document.body.dataset.theme === 'dark';
|
||||
this.util = new Util();
|
||||
this.newScrollTop = this.util.getScrollTop();
|
||||
@@ -69,6 +11,7 @@ class FixIt {
|
||||
this.resizeEventSet = new Set();
|
||||
this.switchThemeEventSet = new Set();
|
||||
this.clickMaskEventSet = new Set();
|
||||
this.beforeprintEventSet = new Set();
|
||||
this.disableScrollEvent = false;
|
||||
window.objectFitImages && objectFitImages();
|
||||
}
|
||||
@@ -87,13 +30,13 @@ class FixIt {
|
||||
|
||||
initSVGIcon() {
|
||||
this.util.forEach(document.querySelectorAll('[data-svg-src]'), ($icon) => {
|
||||
fetch($icon.getAttribute('data-svg-src'))
|
||||
fetch($icon.dataset.svgSrc)
|
||||
.then((response) => response.text())
|
||||
.then((svg) => {
|
||||
const $temp = document.createElement('div');
|
||||
$temp.insertAdjacentHTML('afterbegin', svg);
|
||||
const $svg = $temp.firstChild;
|
||||
$svg.setAttribute('data-svg-src', $icon.getAttribute('data-svg-src'));
|
||||
$svg.dataset.svgSrc = $icon.dataset.svgSrc
|
||||
$svg.classList.add('icon');
|
||||
const $titleElements = $svg.getElementsByTagName('title');
|
||||
$titleElements.length && $svg.removeChild($titleElements[0]);
|
||||
@@ -105,8 +48,8 @@ class FixIt {
|
||||
});
|
||||
}
|
||||
|
||||
initTwemoji() {
|
||||
this.config.twemoji && twemoji.parse(document.body);
|
||||
initTwemoji(target = document.body) {
|
||||
this.config.twemoji && twemoji.parse(target);
|
||||
}
|
||||
|
||||
initMenu() {
|
||||
@@ -115,7 +58,7 @@ class FixIt {
|
||||
}
|
||||
|
||||
initMenuDesktop() {
|
||||
this.util.forEach(document.querySelectorAll('.has-children, #header-desktop .language'), ($item) => {
|
||||
this.util.forEach(document.querySelectorAll('.has-children'), ($item) => {
|
||||
$item.querySelector('.sub-menu').style.minWidth = `${$item.offsetWidth - 8}px`;
|
||||
});
|
||||
}
|
||||
@@ -150,7 +93,7 @@ class FixIt {
|
||||
this.isDark = !this.isDark;
|
||||
window.localStorage?.setItem('theme', this.isDark ? 'dark' : 'light');
|
||||
for (let event of this.switchThemeEventSet) {
|
||||
event();
|
||||
event(this.isDark);
|
||||
}
|
||||
}, false);
|
||||
});
|
||||
@@ -254,74 +197,7 @@ class FixIt {
|
||||
$searchClear.style.display = 'inline';
|
||||
callback(results);
|
||||
};
|
||||
if (searchConfig.type === 'lunr') {
|
||||
const search = () => {
|
||||
if (lunr.queryHandler) {
|
||||
query = lunr.queryHandler(query);
|
||||
}
|
||||
const results = {};
|
||||
this._index.search(query).forEach(({ ref, matchData: { metadata } }) => {
|
||||
const matchData = this._indexData[ref];
|
||||
let { uri, title, content: context } = matchData;
|
||||
if (results[uri]) {
|
||||
return;
|
||||
}
|
||||
let position = 0;
|
||||
Object.values(metadata).forEach(({ content }) => {
|
||||
if (content) {
|
||||
const matchPosition = content.position[0][0];
|
||||
if (matchPosition < position || position === 0) {
|
||||
position = matchPosition;
|
||||
}
|
||||
}
|
||||
});
|
||||
position -= snippetLength / 5;
|
||||
if (position > 0) {
|
||||
position += context.substr(position, 20).lastIndexOf(' ') + 1;
|
||||
context = '...' + context.substr(position, snippetLength);
|
||||
} else {
|
||||
context = context.substr(0, snippetLength);
|
||||
}
|
||||
Object.keys(metadata).forEach((key) => {
|
||||
title = title.replace(new RegExp(`(${key})`, 'gi'), `<${highlightTag}>$1</${highlightTag}>`);
|
||||
context = context.replace(new RegExp(`(${key})`, 'gi'), `<${highlightTag}>$1</${highlightTag}>`);
|
||||
});
|
||||
results[uri] = {
|
||||
uri: uri,
|
||||
title: title,
|
||||
date: matchData.date,
|
||||
context: context
|
||||
};
|
||||
});
|
||||
return Object.values(results).slice(0, maxResultLength);
|
||||
};
|
||||
if (!this._index) {
|
||||
fetch(searchConfig.lunrIndexURL)
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
const indexData = {};
|
||||
this._index = lunr(function () {
|
||||
if (searchConfig.lunrLanguageCode) this.use(lunr[searchConfig.lunrLanguageCode]);
|
||||
this.ref('objectID');
|
||||
this.field('title', { boost: 50 });
|
||||
this.field('tags', { boost: 20 });
|
||||
this.field('categories', { boost: 20 });
|
||||
this.field('content', { boost: 10 });
|
||||
this.metadataWhitelist = ['position'];
|
||||
data.forEach((record) => {
|
||||
indexData[record.objectID] = record;
|
||||
this.add(record);
|
||||
});
|
||||
});
|
||||
this._indexData = indexData;
|
||||
finish(search());
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
finish([]);
|
||||
});
|
||||
} else finish(search());
|
||||
} else if (searchConfig.type === 'algolia') {
|
||||
if (searchConfig.type === 'algolia') {
|
||||
this._algoliaIndex =
|
||||
this._algoliaIndex || algoliasearch(searchConfig.algoliaAppID, searchConfig.algoliaSearchKey).initIndex(searchConfig.algoliaIndex);
|
||||
this._algoliaIndex
|
||||
@@ -357,7 +233,7 @@ class FixIt {
|
||||
const results = {};
|
||||
window._index.search(query).forEach(({ item, refIndex, matches }) => {
|
||||
let title = item.title;
|
||||
let content = item.content;
|
||||
let content = item.content.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')
|
||||
matches.forEach(({ indices, value, key }) => {
|
||||
if (key === 'content') {
|
||||
let offset = 0;
|
||||
@@ -427,17 +303,11 @@ class FixIt {
|
||||
icon: '<i class="fa-brands fa-algolia fa-fw" aria-hidden="true"></i>',
|
||||
href: 'https://www.algolia.com/'
|
||||
}
|
||||
: (searchConfig.type === 'lunr'
|
||||
? {
|
||||
searchType: 'Lunr.js',
|
||||
icon: '',
|
||||
href: 'https://lunrjs.com/'
|
||||
}
|
||||
: {
|
||||
searchType: 'Fuse.js',
|
||||
icon: '',
|
||||
href: 'https://fusejs.io/'
|
||||
})
|
||||
: {
|
||||
searchType: 'Fuse.js',
|
||||
icon: '',
|
||||
href: 'https://fusejs.io/'
|
||||
}
|
||||
return `<div class="search-footer">Search by <a href="${href}" rel="noopener noreferrer" target="_blank">${icon} ${searchType}</a></div>`;
|
||||
}
|
||||
}
|
||||
@@ -452,31 +322,19 @@ class FixIt {
|
||||
this._searchDesktop = autosearch;
|
||||
}
|
||||
};
|
||||
if (searchConfig.lunrSegmentitURL && !document.getElementById('lunr-segmentit')) {
|
||||
const script = document.createElement('script');
|
||||
script.id = 'lunr-segmentit';
|
||||
script.src = searchConfig.lunrSegmentitURL;
|
||||
script.async = true;
|
||||
if (script.readyState) {
|
||||
script.onreadystatechange = () => {
|
||||
if (script.readyState == 'loaded' || script.readyState == 'complete') {
|
||||
script.onreadystatechange = null;
|
||||
initAutosearch();
|
||||
}
|
||||
};
|
||||
} else {
|
||||
script.onload = () => {
|
||||
initAutosearch();
|
||||
};
|
||||
}
|
||||
document.body.appendChild(script);
|
||||
} else {
|
||||
initAutosearch();
|
||||
initAutosearch();
|
||||
}
|
||||
|
||||
initBreadcrumb() {
|
||||
const $breadcrumbContainer = document.querySelector('.breadcrumb-container.sticky')
|
||||
this.breadcrumbHeight = $breadcrumbContainer?.clientHeight ?? 0;
|
||||
if (this.breadcrumbHeight) {
|
||||
document.querySelector('main.container')?.style.setProperty('--fi-breadcrumb-height', `${this.breadcrumbHeight}px`);
|
||||
}
|
||||
}
|
||||
|
||||
initDetails() {
|
||||
this.util.forEach(document.getElementsByClassName('details'), ($details) => {
|
||||
initDetails(target = document) {
|
||||
this.util.forEach(target.getElementsByClassName('details'), ($details) => {
|
||||
const $summary = $details.querySelector('.details-summary');
|
||||
$summary.addEventListener('click', () => {
|
||||
$details.classList.toggle('open');
|
||||
@@ -486,7 +344,8 @@ class FixIt {
|
||||
|
||||
initLightGallery() {
|
||||
if (this.config.lightgallery) {
|
||||
lightGallery(document.getElementById('content'), {
|
||||
this.lg && this.lg.destroy(true);
|
||||
this.lg = lightGallery(document.getElementById('content'), {
|
||||
plugins: [lgThumbnail, lgZoom],
|
||||
selector: '.lightgallery',
|
||||
speed: 400,
|
||||
@@ -518,7 +377,7 @@ class FixIt {
|
||||
$preChroma.parentElement.replaceChild($chroma, $preChroma);
|
||||
$td.appendChild($preChroma);
|
||||
});
|
||||
this.util.forEach(document.querySelectorAll('.highlight > .chroma'), ($chroma) => {
|
||||
this.util.forEach(document.querySelectorAll('.highlight > .chroma:not(:has(.code-header))'), ($chroma) => {
|
||||
const $codeElements = $chroma.querySelectorAll('pre.chroma > code');
|
||||
if ($codeElements.length) {
|
||||
const $code = $codeElements[$codeElements.length - 1];
|
||||
@@ -527,7 +386,13 @@ class FixIt {
|
||||
// code title
|
||||
const $title = document.createElement('span');
|
||||
$title.classList.add('code-title');
|
||||
$title.insertAdjacentHTML('afterbegin', '<i class="arrow fa-solid fa-chevron-right fa-fw" aria-hidden="true"></i>');
|
||||
// insert code title inner
|
||||
$title.insertAdjacentHTML(
|
||||
'afterbegin',
|
||||
$chroma.parentNode.title
|
||||
? `<i class="arrow fa-solid fa-chevron-right fa-fw" aria-hidden="true"></i><span class="title-inner">${$chroma.parentNode.title}</span>`
|
||||
: '<i class="arrow fa-solid fa-chevron-right fa-fw" aria-hidden="true"></i>'
|
||||
);
|
||||
$title.addEventListener('click', () => {
|
||||
$chroma.classList.toggle('open');
|
||||
}, false);
|
||||
@@ -591,8 +456,8 @@ class FixIt {
|
||||
});
|
||||
}
|
||||
|
||||
initTable() {
|
||||
this.util.forEach(document.querySelectorAll('.content table'), ($table) => {
|
||||
initTable(target = document) {
|
||||
this.util.forEach(target.querySelectorAll('.content table'), ($table) => {
|
||||
const $wrapper = document.createElement('div');
|
||||
$wrapper.className = 'table-wrapper';
|
||||
$table.parentElement.replaceChild($wrapper, $table);
|
||||
@@ -600,23 +465,21 @@ class FixIt {
|
||||
});
|
||||
}
|
||||
|
||||
initHeaderLink() {
|
||||
for (let num = 1; num <= 6; num++) {
|
||||
this.util.forEach(document.querySelectorAll('.single .content > h' + num), ($header) => {
|
||||
$header.classList.add('header-link');
|
||||
$header.insertAdjacentHTML('afterbegin', `<a href="#${$header.id}" class="header-mark"></a>`);
|
||||
});
|
||||
}
|
||||
}
|
||||
/**
|
||||
* init table of contents
|
||||
*/
|
||||
initToc() {
|
||||
const $tocCore = document.getElementById('TableOfContents');
|
||||
let $tocCore = document.getElementById('TableOfContents');
|
||||
if ($tocCore === null) {
|
||||
return;
|
||||
}
|
||||
if (document.getElementById('toc-static').getAttribute('data-kept') === 'true' || this.util.isTocStatic()) {
|
||||
// It's a dirty hack to fix the bug of APlayer, see https://github.com/hugo-fixit/FixIt/issues/292
|
||||
if (typeof APlayer === 'function') {
|
||||
const $newTocCore = $tocCore.cloneNode(true);
|
||||
$tocCore.parentElement.replaceChild($newTocCore, $tocCore);
|
||||
$tocCore = $newTocCore;
|
||||
}
|
||||
if (document.getElementById('toc-static').dataset.kept === 'true' || this.util.isTocStatic()) {
|
||||
const $tocContentStatic = document.getElementById('toc-content-static');
|
||||
if ($tocCore.parentElement !== $tocContentStatic) {
|
||||
$tocCore.parentElement.removeChild($tocCore);
|
||||
@@ -636,8 +499,7 @@ class FixIt {
|
||||
$toc.style.marginTop = `${$postMeta.offsetTop + $postMeta.clientHeight}px`;
|
||||
const $tocLinkElements = $tocCore.querySelectorAll('a:first-child');
|
||||
const $tocLiElements = $tocCore.getElementsByTagName('li');
|
||||
const $headerLinkElements = document.getElementsByClassName('header-link');
|
||||
const headerIsFixed = document.body.getAttribute('data-header-desktop') !== 'normal';
|
||||
const $headingElements = document.getElementsByClassName('heading-element');
|
||||
const headerHeight = document.getElementById('header-desktop').offsetHeight;
|
||||
document.querySelector('.container').addEventListener('resize', () => {
|
||||
$toc.style.marginBottom = `${document.querySelector('.container').clientHeight - document.querySelector('.post-footer').offsetTop}px`;
|
||||
@@ -650,17 +512,17 @@ class FixIt {
|
||||
this.util.forEach($tocLiElements, ($tocLi) => {
|
||||
$tocLi.classList.remove('has-active');
|
||||
});
|
||||
const INDEX_SPACING = 20 + (headerIsFixed ? headerHeight : 0);
|
||||
let activeTocIndex = $headerLinkElements.length - 1;
|
||||
for (let i = 0; i < $headerLinkElements.length - 1; i++) {
|
||||
const thisTop = $headerLinkElements[i].getBoundingClientRect().top;
|
||||
const nextTop = $headerLinkElements[i + 1].getBoundingClientRect().top;
|
||||
const INDEX_SPACING = 20 + (document.body.dataset.headerDesktop !== 'normal' ? headerHeight : 0) + this.breadcrumbHeight;
|
||||
let activeTocIndex = $headingElements.length - 1;
|
||||
for (let i = 0; i < $headingElements.length - 1; i++) {
|
||||
const thisTop = $headingElements[i].getBoundingClientRect().top;
|
||||
const nextTop = $headingElements[i + 1].getBoundingClientRect().top;
|
||||
if ((i == 0 && thisTop > INDEX_SPACING) || (thisTop <= INDEX_SPACING && nextTop > INDEX_SPACING)) {
|
||||
activeTocIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (activeTocIndex !== -1) {
|
||||
if (activeTocIndex !== -1 && $tocLinkElements[activeTocIndex]) {
|
||||
$tocLinkElements[activeTocIndex].classList.add('active');
|
||||
let $parent = $tocLinkElements[activeTocIndex].parentElement;
|
||||
while ($parent !== $tocCore) {
|
||||
@@ -687,27 +549,38 @@ class FixIt {
|
||||
}, false);
|
||||
}
|
||||
|
||||
initMath() {
|
||||
initMath(target = document.body) {
|
||||
if (this.config.math) {
|
||||
renderMathInElement(document.body, this.config.math);
|
||||
renderMathInElement(target, this.config.math);
|
||||
}
|
||||
}
|
||||
|
||||
initMermaid() {
|
||||
this._mermaidOnSwitchTheme = this._mermaidOnSwitchTheme || (() => {
|
||||
const $mermaidElements = document.getElementsByClassName('mermaid');
|
||||
if ($mermaidElements.length) {
|
||||
const themes = this.config.mermaid.themes ?? ['neutral', 'dark'];
|
||||
mermaid.initialize({startOnLoad: false, theme: this.isDark ? themes[1] : themes[0], securityLevel: 'loose'});
|
||||
this.util.forEach($mermaidElements, $mermaid => {
|
||||
mermaid.render('svg-' + $mermaid.id, this.data[$mermaid.id], svgCode => {
|
||||
$mermaid.innerHTML = svgCode;
|
||||
}, $mermaid);
|
||||
});
|
||||
}
|
||||
if (!window.mermaid?.initialize) {
|
||||
return;
|
||||
}
|
||||
const _initializeAndRun = () => {
|
||||
const themes = window.mermaid.themes ?? ['default', 'dark'];
|
||||
window.mermaid.initialize({
|
||||
securityLevel: 'loose',
|
||||
startOnLoad: false,
|
||||
theme: this.isDark ? themes[1] : themes[0],
|
||||
});
|
||||
window.mermaid.run()
|
||||
}
|
||||
_initializeAndRun()
|
||||
this.switchThemeEventSet.add(() => {
|
||||
// Reinitialize and run mermaid when theme changes.
|
||||
this.util.forEach(document.querySelectorAll('.mermaid[data-processed]'), ($mermaid) => {
|
||||
$mermaid.dataset.processed = ''
|
||||
$mermaid.innerHTML = ''
|
||||
$mermaid.appendChild($mermaid.nextElementSibling.content.cloneNode(true))
|
||||
})
|
||||
_initializeAndRun()
|
||||
});
|
||||
this.beforeprintEventSet.add(() => {
|
||||
// Set the theme to neutral when printing.
|
||||
});
|
||||
this.switchThemeEventSet.add(this._mermaidOnSwitchTheme);
|
||||
this._mermaidOnSwitchTheme();
|
||||
}
|
||||
|
||||
initEcharts() {
|
||||
@@ -722,11 +595,16 @@ class FixIt {
|
||||
this._echartsArr[i].dispose();
|
||||
}
|
||||
this._echartsArr = [];
|
||||
const stagingDOM = this.util.getStagingDOM()
|
||||
this.util.forEach(document.getElementsByClassName('echarts'), ($echarts) => {
|
||||
const chart = echarts.init($echarts, this.isDark ? 'dark' : 'light', { renderer: 'svg' });
|
||||
chart.setOption(JSON.parse(this.data[$echarts.id]));
|
||||
this._echartsArr.push(chart);
|
||||
if ($echarts.nextElementSibling.tagName === 'TEMPLATE') {
|
||||
const chart = echarts.init($echarts, this.isDark ? 'dark' : 'light', { renderer: 'svg' });
|
||||
stagingDOM.stage($echarts.nextElementSibling.content.cloneNode(true));
|
||||
chart.setOption(stagingDOM.contentAsJson());
|
||||
this._echartsArr.push(chart);
|
||||
}
|
||||
});
|
||||
stagingDOM.destroy();
|
||||
});
|
||||
this.switchThemeEventSet.add(this._echartsOnSwitchTheme);
|
||||
this._echartsOnSwitchTheme();
|
||||
@@ -740,11 +618,13 @@ class FixIt {
|
||||
|
||||
initMapbox() {
|
||||
if (this.config.mapbox) {
|
||||
mapboxgl.accessToken = this.config.mapbox.accessToken;
|
||||
mapboxgl.setRTLTextPlugin(this.config.mapbox.RTLTextPlugin);
|
||||
this._mapboxArr = this._mapboxArr || [];
|
||||
this.util.forEach(document.getElementsByClassName('mapbox'), ($mapbox) => {
|
||||
const { lng, lat, zoom, lightStyle, darkStyle, marked, navigation, geolocate, scale, fullscreen } = this.data[$mapbox.id];
|
||||
if (!mapboxgl.accessToken) {
|
||||
mapboxgl.accessToken = this.config.mapbox.accessToken;
|
||||
mapboxgl.setRTLTextPlugin(this.config.mapbox.RTLTextPlugin);
|
||||
this._mapboxArr = this._mapboxArr || [];
|
||||
}
|
||||
this.util.forEach(document.querySelectorAll('.mapbox:empty'), ($mapbox) => {
|
||||
const { lng, lat, zoom, lightStyle, darkStyle, marked, navigation, geolocate, scale, fullscreen } = JSON.parse($mapbox.dataset.options);
|
||||
const mapbox = new mapboxgl.Map({
|
||||
container: $mapbox,
|
||||
center: [lng, lat],
|
||||
@@ -783,7 +663,7 @@ class FixIt {
|
||||
this._mapboxOnSwitchTheme = this._mapboxOnSwitchTheme || (() => {
|
||||
this.util.forEach(this._mapboxArr, (mapbox) => {
|
||||
const $mapbox = mapbox.getContainer();
|
||||
const { lightStyle, darkStyle } = this.data[$mapbox.id];
|
||||
const { lightStyle, darkStyle } = JSON.parse($mapbox.dataset.options);
|
||||
mapbox.setStyle(this.isDark ? darkStyle : lightStyle);
|
||||
mapbox.addControl(new MapboxLanguage());
|
||||
});
|
||||
@@ -792,22 +672,45 @@ class FixIt {
|
||||
}
|
||||
}
|
||||
|
||||
initTypeit() {
|
||||
initTypeit(target = document) {
|
||||
if (this.config.typeit) {
|
||||
const typeitConfig = this.config.typeit;
|
||||
const speed = typeitConfig.speed || 100;
|
||||
const cursorSpeed = typeitConfig.cursorSpeed || 1000;
|
||||
const cursorChar = typeitConfig.cursorChar || '|';
|
||||
Object.values(typeitConfig.data).forEach((group) => {
|
||||
const loop = typeitConfig.loop ?? false;
|
||||
// divide them into different groups according to the data-group attribute value of the element
|
||||
// results in an object like {group1: [ele1, ele2], group2: [ele3, ele4]}
|
||||
const typeitElements = target.querySelectorAll('.typeit')
|
||||
const groupMap = Array.from(typeitElements).reduce((acc, ele) => {
|
||||
const group = ele.dataset.group || ele.id || Math.random().toString(36).substring(2);
|
||||
acc[group] = acc[group] || [];
|
||||
acc[group].push(ele);
|
||||
return acc;
|
||||
}, {});
|
||||
const stagingDOM = this.util.getStagingDOM()
|
||||
|
||||
Object.values(groupMap).forEach((group) => {
|
||||
const typeone = (i) => {
|
||||
const id = group[i];
|
||||
const instance = new TypeIt(`#${id}`, {
|
||||
strings: this.data[id],
|
||||
const typeitElement = group[i];
|
||||
const singleLoop = typeitElement.dataset.loop;
|
||||
stagingDOM.stage(typeitElement.querySelector('template').content.cloneNode(true));
|
||||
// for shortcodes usage
|
||||
let targetEle = typeitElement.firstElementChild
|
||||
// for system elements usage
|
||||
if (typeitElement.firstElementChild.tagName === 'TEMPLATE') {
|
||||
typeitElement.innerHTML = '';
|
||||
targetEle = typeitElement
|
||||
}
|
||||
// create a new instance of TypeIt for each element
|
||||
const instance = new TypeIt(targetEle, {
|
||||
strings: stagingDOM.$el.querySelector('pre')?.innerHTML || stagingDOM.contentAsHtml(),
|
||||
speed: speed,
|
||||
lifeLike: true,
|
||||
cursorSpeed: cursorSpeed,
|
||||
cursorChar: cursorChar,
|
||||
waitUntilVisible: true,
|
||||
loop: singleLoop ? JSON.parse(singleLoop) : loop,
|
||||
afterComplete: () => {
|
||||
if (i === group.length - 1) {
|
||||
if (typeitConfig.duration >= 0) {
|
||||
@@ -824,6 +727,7 @@ class FixIt {
|
||||
};
|
||||
typeone(0);
|
||||
});
|
||||
stagingDOM.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -872,7 +776,7 @@ class FixIt {
|
||||
countEl: this.config.comment.artalk.countEl
|
||||
})
|
||||
}
|
||||
const artalk = new Artalk(this.config.comment.artalk);
|
||||
const artalk = Artalk.init(this.config.comment.artalk);
|
||||
artalk.setDarkMode(this.isDark);
|
||||
this.switchThemeEventSet.add(() => {
|
||||
artalk.setDarkMode(this.isDark);
|
||||
@@ -953,15 +857,13 @@ class FixIt {
|
||||
document.querySelector('.giscus-frame')?.contentWindow.postMessage({ giscus: message }, 'https://giscus.app');
|
||||
});
|
||||
this.switchThemeEventSet.add(this._giscusOnSwitchTheme);
|
||||
const _this = this;
|
||||
_this.giscus2parentMsg = window.addEventListener('message', (event) => {
|
||||
this.giscus2parentMsg = window.addEventListener('message', (event) => {
|
||||
const $script = document.querySelector('#giscus>script');
|
||||
if ($script){
|
||||
_this._giscusOnSwitchTheme();
|
||||
this._giscusOnSwitchTheme();
|
||||
$script.parentElement.removeChild($script);
|
||||
}
|
||||
window.removeEventListener('message', _this.giscus2parentMsg);
|
||||
});
|
||||
}, { once: true });
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1022,7 +924,7 @@ class FixIt {
|
||||
this.config.watermark?.enable &&
|
||||
new Watermark({
|
||||
content: this.config.watermark.content || `${document.querySelector('footer .fixit-icon')?.outerHTML ?? ''} FixIt Theme`,
|
||||
appendTo: this.config.watermark.appendto || '.wrapper>main',
|
||||
appendTo: '.widgets',
|
||||
opacity: this.config.watermark.opacity,
|
||||
width: this.config.watermark.width,
|
||||
height: this.config.watermark.height,
|
||||
@@ -1053,7 +955,6 @@ class FixIt {
|
||||
}
|
||||
|
||||
initFixItDecryptor() {
|
||||
const $tocNodes = document.querySelectorAll('#toc-auto>.d-none, #toc-static.d-none');
|
||||
this.decryptor = new FixItDecryptor({
|
||||
decrypted: () => {
|
||||
this.initTwemoji();
|
||||
@@ -1061,22 +962,37 @@ class FixIt {
|
||||
this.initLightGallery();
|
||||
this.initHighlight();
|
||||
this.initTable();
|
||||
this.initHeaderLink();
|
||||
this.initMath();
|
||||
this.initMermaid();
|
||||
this.initEcharts();
|
||||
this.initTypeit();
|
||||
this.initMapbox();
|
||||
this.util.forEach($tocNodes, ($element) => {
|
||||
$element.classList.remove('d-none');
|
||||
});
|
||||
this.initToc();
|
||||
this.initTocListener();
|
||||
this.initPangu();
|
||||
this.util.forEach(document.querySelectorAll('.encrypted-hidden'), ($element) => {
|
||||
$element.classList.replace('encrypted-hidden', 'decrypted-shown');
|
||||
});
|
||||
},
|
||||
partialDecrypted: ($content) => {
|
||||
this.initTwemoji($content);
|
||||
this.initDetails($content);
|
||||
this.initLightGallery();
|
||||
this.initHighlight();
|
||||
this.initTable($content);
|
||||
this.initMath($content);
|
||||
this.initMermaid();
|
||||
this.initEcharts();
|
||||
this.initTypeit($content);
|
||||
this.initMapbox();
|
||||
this.initPangu();
|
||||
this.util.forEach($content.querySelectorAll('.encrypted-hidden'), ($element) => {
|
||||
$element.classList.replace('encrypted-hidden', 'decrypted-shown');
|
||||
});
|
||||
},
|
||||
reset: () => {
|
||||
this.util.forEach($tocNodes, ($element) => {
|
||||
$element.classList.add('d-none');
|
||||
this.util.forEach(document.querySelectorAll('.decrypted-shown'), ($element) => {
|
||||
$element.classList.replace('decrypted-shown', 'encrypted-hidden');
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -1084,6 +1000,9 @@ class FixIt {
|
||||
this.decryptor.addEventListener('decrypted', () => {
|
||||
this.decryptor.initShortcodes();
|
||||
})
|
||||
this.decryptor.addEventListener('partial-decrypted', () => {
|
||||
this.decryptor.initShortcodes();
|
||||
})
|
||||
this.decryptor.initShortcodes();
|
||||
}
|
||||
this.config.encryption?.all && this.decryptor.init();
|
||||
@@ -1132,12 +1051,43 @@ class FixIt {
|
||||
}
|
||||
}
|
||||
|
||||
initReward() {
|
||||
const $rewards = document.querySelectorAll('.post-reward [data-mode="fixed"]');
|
||||
if (!$rewards.length) {
|
||||
return;
|
||||
}
|
||||
// `fixed` mode only supports desktop
|
||||
if (this.util.isMobile()) {
|
||||
this.util.forEach($rewards, ($reward) => {
|
||||
$reward.removeAttribute('data-mode');
|
||||
});
|
||||
return;
|
||||
}
|
||||
// Close post reward images exclude special id
|
||||
const _closeRewardExclude = (id) => {
|
||||
this.util.forEach($rewards, ($reward) => {
|
||||
const $rewardInput = $reward.parentElement.querySelector('.reward-input');
|
||||
if ($rewardInput.id !== id) {
|
||||
$rewardInput.checked = false;
|
||||
}
|
||||
});
|
||||
};
|
||||
// Add additional click event to reward buttons
|
||||
this.util.forEach($rewards, ($reward) => {
|
||||
$reward.previousElementSibling.addEventListener('click', function () {
|
||||
_closeRewardExclude(this.getAttribute('for'));
|
||||
}, false)
|
||||
});
|
||||
this.scrollEventSet.add(_closeRewardExclude);
|
||||
}
|
||||
|
||||
onScroll() {
|
||||
const $headers = [];
|
||||
const ACCURACY = 20;
|
||||
const $fixedButtons = document.querySelector('.fixed-buttons');
|
||||
const $backToTop = document.querySelector('.back-to-top');
|
||||
const $readingProgressBar = document.querySelector('.reading-progress-bar');
|
||||
let scrollTimer = void 0;
|
||||
if (document.body.dataset.headerDesktop === 'auto') {
|
||||
$headers.push(document.getElementById('header-desktop'));
|
||||
}
|
||||
@@ -1156,6 +1106,12 @@ class FixIt {
|
||||
const $mask = document.getElementById('mask');
|
||||
this.newScrollTop = this.util.getScrollTop();
|
||||
const scroll = this.newScrollTop - this.oldScrollTop;
|
||||
// body scrollbar style
|
||||
document.body.toggleAttribute('data-scroll', true);
|
||||
scrollTimer && window.clearTimeout(scrollTimer);
|
||||
scrollTimer = window.setTimeout(() => {
|
||||
document.body.toggleAttribute('data-scroll');
|
||||
}, 500);
|
||||
// header animation
|
||||
this.util.forEach($headers, ($header) => {
|
||||
if (scroll > ACCURACY) {
|
||||
@@ -1205,7 +1161,6 @@ class FixIt {
|
||||
event();
|
||||
}
|
||||
this.initToc();
|
||||
this.initMermaid();
|
||||
this.initSearch();
|
||||
|
||||
const isMobile = this.util.isMobile()
|
||||
@@ -1231,17 +1186,28 @@ class FixIt {
|
||||
}, false);
|
||||
}
|
||||
|
||||
beforeprint() {
|
||||
window.addEventListener('beforeprint', () => {
|
||||
this.util.forEach(document.querySelectorAll('.chroma'), ($el) => {
|
||||
$el.classList.toggle('open', true)
|
||||
});
|
||||
for (let event of this.beforeprintEventSet) {
|
||||
event();
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
|
||||
init() {
|
||||
try {
|
||||
if (this.config.encryption) {
|
||||
this.initFixItDecryptor();
|
||||
} else if (!this.config.encryption?.all) {
|
||||
}
|
||||
if (!this.config.encryption?.all) {
|
||||
this.initTwemoji();
|
||||
this.initDetails();
|
||||
this.initLightGallery();
|
||||
this.initHighlight();
|
||||
this.initTable();
|
||||
this.initHeaderLink();
|
||||
this.initMath();
|
||||
this.initMermaid();
|
||||
this.initEcharts();
|
||||
@@ -1254,12 +1220,14 @@ class FixIt {
|
||||
this.initMenu();
|
||||
this.initSwitchTheme();
|
||||
this.initSearch();
|
||||
this.initBreadcrumb();
|
||||
this.initCookieconsent();
|
||||
this.initSiteTime();
|
||||
this.initServiceWorker();
|
||||
this.initWatermark();
|
||||
this.initMDevtools();
|
||||
this.initAutoMark();
|
||||
this.initReward();
|
||||
|
||||
window.setTimeout(() => {
|
||||
this.initComment();
|
||||
@@ -1270,6 +1238,7 @@ class FixIt {
|
||||
this.onScroll();
|
||||
this.onResize();
|
||||
this.onClickMask();
|
||||
this.beforeprint();
|
||||
}, 100);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
@@ -0,0 +1,89 @@
|
||||
export default class Util {
|
||||
forEach(elements, handler) {
|
||||
elements = elements || [];
|
||||
for (let i = 0; i < elements.length; i++) {
|
||||
handler(elements[i]);
|
||||
}
|
||||
}
|
||||
|
||||
getScrollTop() {
|
||||
return (document.documentElement ?? document.body).scrollTop;
|
||||
}
|
||||
|
||||
isMobile() {
|
||||
return window.matchMedia('only screen and (max-width: 680px)').matches;
|
||||
}
|
||||
|
||||
isTocStatic() {
|
||||
return window.matchMedia('only screen and (max-width: 960px)').matches;
|
||||
}
|
||||
|
||||
/**
|
||||
* add animate to element
|
||||
* @param {Element} element animate element
|
||||
* @param {String|Array<String>} animation animation name
|
||||
* @param {Boolean} reserved reserved animation
|
||||
* @param {Function} callback remove callback
|
||||
*/
|
||||
animateCSS(element, animation, reserved, callback) {
|
||||
!Array.isArray(animation) && (animation = [animation]);
|
||||
element.classList.add('animate__animated', ...animation);
|
||||
element.addEventListener('animationend', () => {
|
||||
!reserved && element.classList.remove('animate__animated', ...animation);
|
||||
typeof callback === 'function' && callback();
|
||||
}, { once: true });
|
||||
}
|
||||
|
||||
/**
|
||||
* date validator
|
||||
* @param {*} date may be date or not
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
isValidDate(date) {
|
||||
return date instanceof Date && !isNaN(date.getTime());
|
||||
}
|
||||
|
||||
/**
|
||||
* scroll some element into view
|
||||
* @param {String} selector element to scroll
|
||||
*/
|
||||
scrollIntoView(selector) {
|
||||
const element = selector.startsWith('#')
|
||||
? document.getElementById(selector.slice(1))
|
||||
: document.querySelector(selector);
|
||||
element?.scrollIntoView({
|
||||
behavior: 'smooth'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* get a hidden element for temporary use
|
||||
* @returns {Object} { $el: Element, destroy: Function }
|
||||
*/
|
||||
getStagingDOM() {
|
||||
const stagingElement = document.createElement('div')
|
||||
stagingElement.style.display = 'none';
|
||||
stagingElement.dataset.stagingId = Math.random().toString(36).slice(2);
|
||||
document.body.appendChild(stagingElement);
|
||||
|
||||
return {
|
||||
$el: stagingElement,
|
||||
stage(dom) {
|
||||
stagingElement.innerHTML = '';
|
||||
stagingElement.appendChild(dom);
|
||||
},
|
||||
contentAsHtml() {
|
||||
return stagingElement.innerHTML;
|
||||
},
|
||||
contentAsText() {
|
||||
return stagingElement.innerText;
|
||||
},
|
||||
contentAsJson() {
|
||||
return JSON.parse(stagingElement.innerHTML);
|
||||
},
|
||||
destroy() {
|
||||
document.body.removeChild(stagingElement);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,32 +1,31 @@
|
||||
algoliasearch@4.14.2 https://github.com/algolia/algoliasearch-client-javascript
|
||||
algoliasearch@4.20.0 https://github.com/algolia/algoliasearch-client-javascript
|
||||
animate.css@4.1.1 https://github.com/daneden/animate.css
|
||||
aplayer@1.10.1 https://github.com/MoePlayer/APlayer
|
||||
artalk@2.3.4 https://github.com/ArtalkJS/Artalk
|
||||
artalk@latest https://github.com/ArtalkJS/Artalk
|
||||
autocomplete-js@0.38.1 https://github.com/algolia/autocomplete
|
||||
cell-watermark@1.0.3 https://github.com/Lruihao/watermark
|
||||
cookieconsent@3.1.1 https://github.com/osano/cookieconsent
|
||||
crypto-js@4.1.1 https://github.com/brix/crypto-js
|
||||
echarts@5.3.3 https://github.com/apache/echarts
|
||||
TODO update emoji-data to 15.x
|
||||
emoji-data@14.0.0 https://github.com/iamcal/emoji-data
|
||||
eruda@2.5.0 https://github.com/liriliri/eruda
|
||||
fontawesome-free@6.2.0 https://github.com/FortAwesome/Font-Awesome
|
||||
eruda@3.0.1 https://github.com/liriliri/eruda
|
||||
fontawesome-free@6.4.2 https://github.com/FortAwesome/Font-Awesome
|
||||
fusejs@6.6.2 https://github.com/krisk/fuse
|
||||
gitalk@1.7.2 https://github.com/gitalk/gitalk
|
||||
katex@0.16.2 https://github.com/KaTeX/KaTeX
|
||||
lazysizes@5.3.2 https://github.com/aFarkas/lazysizes
|
||||
lightgallery@2.6.1 https://github.com/sachinchoolur/lightgallery
|
||||
lunr.js@2.3.9 https://github.com/olivernn/lunr.js
|
||||
instant.page@5.2.0 https://github.com/instantpage/instant.page
|
||||
katex@0.16.9 https://github.com/KaTeX/KaTeX
|
||||
lightgallery@2.7.2 https://github.com/sachinchoolur/lightgallery
|
||||
mapbox-gl@2.10.0 https://github.com/mapbox/mapbox-gl-js
|
||||
mermaid@9.1.7 https://github.com/mermaid-js/mermaid
|
||||
meting@2.0.1 https://github.com/metowolf/MetingJS
|
||||
normalize.css@8.0.1 https://github.com/necolas/normalize.css
|
||||
object-fit-images@3.2.4 https://github.com/fregante/object-fit-images [archived]
|
||||
pangu.js@4.0.7 https://github.com/vinta/pangu.js
|
||||
sharer.js@0.5.1 https://github.com/ellisonleao/sharer.js
|
||||
simple-icons@7.12.0 https://github.com/simple-icons/simple-icons
|
||||
simple-icons@9.19.0 https://github.com/simple-icons/simple-icons
|
||||
twemoji@14.0.2 https://github.com/twitter/twemoji
|
||||
twikoo@1.6.8 https://github.com/imaegoo/twikoo
|
||||
typeit@8.7.0 https://github.com/alexmacarthur/typeit
|
||||
twikoo@1.6.22 https://github.com/imaegoo/twikoo
|
||||
typeit@8.7.1 https://github.com/alexmacarthur/typeit
|
||||
valine@1.5.1 https://github.com/xCss/Valine
|
||||
vconsole@3.14.6 https://github.com/Tencent/vConsole
|
||||
waline@2.10.0 https://github.com/walinejs/waline
|
||||
vconsole@3.15.1 https://github.com/Tencent/vConsole
|
||||
waline@2.15.8 https://github.com/walinejs/waline
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* Minified by jsDelivr using Terser v5.15.1.
|
||||
* Original file: /npm/instant.page@5.2.0/instantpage.js
|
||||
*
|
||||
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
||||
*/
|
||||
/*! instant.page v5.2.0 - (C) 2019-2023 Alexandre Dieulot - https://instant.page/license */
|
||||
let _allowQueryString,_allowExternalLinks,_useWhitelist,_lastTouchTimestamp,_mouseoverTimer,_chromiumMajorVersionInUserAgent=null,_delayOnHover=65,_preloadedList=new Set;const DELAY_TO_NOT_BE_CONSIDERED_A_TOUCH_INITIATED_ACTION=1111;function init(){if(!document.createElement("link").relList.supports("prefetch"))return;const e="instantVaryAccept"in document.body.dataset||"Shopify"in window,t=navigator.userAgent.indexOf("Chrome/");if(t>-1&&(_chromiumMajorVersionInUserAgent=parseInt(navigator.userAgent.substring(t+"Chrome/".length))),e&&_chromiumMajorVersionInUserAgent&&_chromiumMajorVersionInUserAgent<110)return;const n="instantMousedownShortcut"in document.body.dataset;_allowQueryString="instantAllowQueryString"in document.body.dataset,_allowExternalLinks="instantAllowExternalLinks"in document.body.dataset,_useWhitelist="instantWhitelist"in document.body.dataset;const o={capture:!0,passive:!0};let i=!1,r=!1,s=!1;if("instantIntensity"in document.body.dataset){const e=document.body.dataset.instantIntensity;if(e.startsWith("mousedown"))i=!0,"mousedown-only"==e&&(r=!0);else if(e.startsWith("viewport")){const t=navigator.connection&&navigator.connection.saveData,n=navigator.connection&&navigator.connection.effectiveType&&navigator.connection.effectiveType.includes("2g");t||n||("viewport"==e?document.documentElement.clientWidth*document.documentElement.clientHeight<45e4&&(s=!0):"viewport-all"==e&&(s=!0))}else{const t=parseInt(e);isNaN(t)||(_delayOnHover=t)}}if(r||document.addEventListener("touchstart",touchstartListener,o),i?n||document.addEventListener("mousedown",mousedownListener,o):document.addEventListener("mouseover",mouseoverListener,o),n&&document.addEventListener("mousedown",mousedownShortcutListener,o),s){let e=window.requestIdleCallback;e||(e=e=>{e()}),e((function(){const e=new IntersectionObserver((t=>{t.forEach((t=>{if(t.isIntersecting){const n=t.target;e.unobserve(n),preload(n.href)}}))}));document.querySelectorAll("a").forEach((t=>{isPreloadable(t)&&e.observe(t)}))}),{timeout:1500})}}function touchstartListener(e){_lastTouchTimestamp=performance.now();const t=e.target.closest("a");isPreloadable(t)&&preload(t.href,"high")}function mouseoverListener(e){if(performance.now()-_lastTouchTimestamp<1111)return;if(!("closest"in e.target))return;const t=e.target.closest("a");isPreloadable(t)&&(t.addEventListener("mouseout",mouseoutListener,{passive:!0}),_mouseoverTimer=setTimeout((()=>{preload(t.href,"high"),_mouseoverTimer=void 0}),_delayOnHover))}function mousedownListener(e){const t=e.target.closest("a");isPreloadable(t)&&preload(t.href,"high")}function mouseoutListener(e){e.relatedTarget&&e.target.closest("a")==e.relatedTarget.closest("a")||_mouseoverTimer&&(clearTimeout(_mouseoverTimer),_mouseoverTimer=void 0)}function mousedownShortcutListener(e){if(performance.now()-_lastTouchTimestamp<1111)return;const t=e.target.closest("a");if(e.which>1||e.metaKey||e.ctrlKey)return;if(!t)return;t.addEventListener("click",(function(e){1337!=e.detail&&e.preventDefault()}),{capture:!0,passive:!1,once:!0});const n=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!1,detail:1337});t.dispatchEvent(n)}function isPreloadable(e){if(e&&e.href&&(!_useWhitelist||"instant"in e.dataset)){if(e.origin!=location.origin){if(!(_allowExternalLinks||"instant"in e.dataset)||!_chromiumMajorVersionInUserAgent)return}if(["http:","https:"].includes(e.protocol)&&("http:"!=e.protocol||"https:"!=location.protocol)&&(_allowQueryString||!e.search||"instant"in e.dataset)&&!(e.hash&&e.pathname+e.search==location.pathname+location.search||"noInstant"in e.dataset))return!0}}function preload(e,t="auto"){if(_preloadedList.has(e))return;const n=document.createElement("link");n.rel="prefetch",n.href=e,n.fetchPriority=t,n.as="document",document.head.appendChild(n),_preloadedList.add(e)}init();
|
||||
//# sourceMappingURL=/sm/60fb95dda2409979534f889b11a4279c9602c20254de5a856d5c95159338bab2.map
|
||||
@@ -1,206 +0,0 @@
|
||||
/**
|
||||
* export the module via AMD, CommonJS or as a browser global
|
||||
* Export code from https://github.com/umdjs/umd/blob/master/returnExports.js
|
||||
*/
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(factory)
|
||||
} else if (typeof exports === 'object') {
|
||||
/**
|
||||
* Node. Does not work with strict CommonJS, but
|
||||
* only CommonJS-like environments that support module.exports,
|
||||
* like Node.
|
||||
*/
|
||||
module.exports = factory()
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
factory()(root.lunr);
|
||||
}
|
||||
}(this, function () {
|
||||
/**
|
||||
* Just return a value to define the module export.
|
||||
* This example returns an object, but the module
|
||||
* can return a function as the exported value.
|
||||
*/
|
||||
|
||||
return function(lunr) {
|
||||
// TinySegmenter 0.1 -- Super compact Japanese tokenizer in Javascript
|
||||
// (c) 2008 Taku Kudo <taku@chasen.org>
|
||||
// TinySegmenter is freely distributable under the terms of a new BSD licence.
|
||||
// For details, see http://chasen.org/~taku/software/TinySegmenter/LICENCE.txt
|
||||
|
||||
function TinySegmenter() {
|
||||
var patterns = {
|
||||
"[一二三四五六七八九十百千万億兆]":"M",
|
||||
"[一-龠々〆ヵヶ]":"H",
|
||||
"[ぁ-ん]":"I",
|
||||
"[ァ-ヴーア-ン゙ー]":"K",
|
||||
"[a-zA-Za-zA-Z]":"A",
|
||||
"[0-90-9]":"N"
|
||||
}
|
||||
this.chartype_ = [];
|
||||
for (var i in patterns) {
|
||||
var regexp = new RegExp(i);
|
||||
this.chartype_.push([regexp, patterns[i]]);
|
||||
}
|
||||
|
||||
this.BIAS__ = -332
|
||||
this.BC1__ = {"HH":6,"II":2461,"KH":406,"OH":-1378};
|
||||
this.BC2__ = {"AA":-3267,"AI":2744,"AN":-878,"HH":-4070,"HM":-1711,"HN":4012,"HO":3761,"IA":1327,"IH":-1184,"II":-1332,"IK":1721,"IO":5492,"KI":3831,"KK":-8741,"MH":-3132,"MK":3334,"OO":-2920};
|
||||
this.BC3__ = {"HH":996,"HI":626,"HK":-721,"HN":-1307,"HO":-836,"IH":-301,"KK":2762,"MK":1079,"MM":4034,"OA":-1652,"OH":266};
|
||||
this.BP1__ = {"BB":295,"OB":304,"OO":-125,"UB":352};
|
||||
this.BP2__ = {"BO":60,"OO":-1762};
|
||||
this.BQ1__ = {"BHH":1150,"BHM":1521,"BII":-1158,"BIM":886,"BMH":1208,"BNH":449,"BOH":-91,"BOO":-2597,"OHI":451,"OIH":-296,"OKA":1851,"OKH":-1020,"OKK":904,"OOO":2965};
|
||||
this.BQ2__ = {"BHH":118,"BHI":-1159,"BHM":466,"BIH":-919,"BKK":-1720,"BKO":864,"OHH":-1139,"OHM":-181,"OIH":153,"UHI":-1146};
|
||||
this.BQ3__ = {"BHH":-792,"BHI":2664,"BII":-299,"BKI":419,"BMH":937,"BMM":8335,"BNN":998,"BOH":775,"OHH":2174,"OHM":439,"OII":280,"OKH":1798,"OKI":-793,"OKO":-2242,"OMH":-2402,"OOO":11699};
|
||||
this.BQ4__ = {"BHH":-3895,"BIH":3761,"BII":-4654,"BIK":1348,"BKK":-1806,"BMI":-3385,"BOO":-12396,"OAH":926,"OHH":266,"OHK":-2036,"ONN":-973};
|
||||
this.BW1__ = {",と":660,",同":727,"B1あ":1404,"B1同":542,"、と":660,"、同":727,"」と":1682,"あっ":1505,"いう":1743,"いっ":-2055,"いる":672,"うし":-4817,"うん":665,"から":3472,"がら":600,"こう":-790,"こと":2083,"こん":-1262,"さら":-4143,"さん":4573,"した":2641,"して":1104,"すで":-3399,"そこ":1977,"それ":-871,"たち":1122,"ため":601,"った":3463,"つい":-802,"てい":805,"てき":1249,"でき":1127,"です":3445,"では":844,"とい":-4915,"とみ":1922,"どこ":3887,"ない":5713,"なっ":3015,"など":7379,"なん":-1113,"にし":2468,"には":1498,"にも":1671,"に対":-912,"の一":-501,"の中":741,"ませ":2448,"まで":1711,"まま":2600,"まる":-2155,"やむ":-1947,"よっ":-2565,"れた":2369,"れで":-913,"をし":1860,"を見":731,"亡く":-1886,"京都":2558,"取り":-2784,"大き":-2604,"大阪":1497,"平方":-2314,"引き":-1336,"日本":-195,"本当":-2423,"毎日":-2113,"目指":-724,"B1あ":1404,"B1同":542,"」と":1682};
|
||||
this.BW2__ = {"..":-11822,"11":-669,"――":-5730,"−−":-13175,"いう":-1609,"うか":2490,"かし":-1350,"かも":-602,"から":-7194,"かれ":4612,"がい":853,"がら":-3198,"きた":1941,"くな":-1597,"こと":-8392,"この":-4193,"させ":4533,"され":13168,"さん":-3977,"しい":-1819,"しか":-545,"した":5078,"して":972,"しな":939,"その":-3744,"たい":-1253,"たた":-662,"ただ":-3857,"たち":-786,"たと":1224,"たは":-939,"った":4589,"って":1647,"っと":-2094,"てい":6144,"てき":3640,"てく":2551,"ては":-3110,"ても":-3065,"でい":2666,"でき":-1528,"でし":-3828,"です":-4761,"でも":-4203,"とい":1890,"とこ":-1746,"とと":-2279,"との":720,"とみ":5168,"とも":-3941,"ない":-2488,"なが":-1313,"など":-6509,"なの":2614,"なん":3099,"にお":-1615,"にし":2748,"にな":2454,"によ":-7236,"に対":-14943,"に従":-4688,"に関":-11388,"のか":2093,"ので":-7059,"のに":-6041,"のの":-6125,"はい":1073,"はが":-1033,"はず":-2532,"ばれ":1813,"まし":-1316,"まで":-6621,"まれ":5409,"めて":-3153,"もい":2230,"もの":-10713,"らか":-944,"らし":-1611,"らに":-1897,"りし":651,"りま":1620,"れた":4270,"れて":849,"れば":4114,"ろう":6067,"われ":7901,"を通":-11877,"んだ":728,"んな":-4115,"一人":602,"一方":-1375,"一日":970,"一部":-1051,"上が":-4479,"会社":-1116,"出て":2163,"分の":-7758,"同党":970,"同日":-913,"大阪":-2471,"委員":-1250,"少な":-1050,"年度":-8669,"年間":-1626,"府県":-2363,"手権":-1982,"新聞":-4066,"日新":-722,"日本":-7068,"日米":3372,"曜日":-601,"朝鮮":-2355,"本人":-2697,"東京":-1543,"然と":-1384,"社会":-1276,"立て":-990,"第に":-1612,"米国":-4268,"11":-669};
|
||||
this.BW3__ = {"あた":-2194,"あり":719,"ある":3846,"い.":-1185,"い。":-1185,"いい":5308,"いえ":2079,"いく":3029,"いた":2056,"いっ":1883,"いる":5600,"いわ":1527,"うち":1117,"うと":4798,"えと":1454,"か.":2857,"か。":2857,"かけ":-743,"かっ":-4098,"かに":-669,"から":6520,"かり":-2670,"が,":1816,"が、":1816,"がき":-4855,"がけ":-1127,"がっ":-913,"がら":-4977,"がり":-2064,"きた":1645,"けど":1374,"こと":7397,"この":1542,"ころ":-2757,"さい":-714,"さを":976,"し,":1557,"し、":1557,"しい":-3714,"した":3562,"して":1449,"しな":2608,"しま":1200,"す.":-1310,"す。":-1310,"する":6521,"ず,":3426,"ず、":3426,"ずに":841,"そう":428,"た.":8875,"た。":8875,"たい":-594,"たの":812,"たり":-1183,"たる":-853,"だ.":4098,"だ。":4098,"だっ":1004,"った":-4748,"って":300,"てい":6240,"てお":855,"ても":302,"です":1437,"でに":-1482,"では":2295,"とう":-1387,"とし":2266,"との":541,"とも":-3543,"どう":4664,"ない":1796,"なく":-903,"など":2135,"に,":-1021,"に、":-1021,"にし":1771,"にな":1906,"には":2644,"の,":-724,"の、":-724,"の子":-1000,"は,":1337,"は、":1337,"べき":2181,"まし":1113,"ます":6943,"まっ":-1549,"まで":6154,"まれ":-793,"らし":1479,"られ":6820,"るる":3818,"れ,":854,"れ、":854,"れた":1850,"れて":1375,"れば":-3246,"れる":1091,"われ":-605,"んだ":606,"んで":798,"カ月":990,"会議":860,"入り":1232,"大会":2217,"始め":1681,"市":965,"新聞":-5055,"日,":974,"日、":974,"社会":2024,"カ月":990};
|
||||
this.TC1__ = {"AAA":1093,"HHH":1029,"HHM":580,"HII":998,"HOH":-390,"HOM":-331,"IHI":1169,"IOH":-142,"IOI":-1015,"IOM":467,"MMH":187,"OOI":-1832};
|
||||
this.TC2__ = {"HHO":2088,"HII":-1023,"HMM":-1154,"IHI":-1965,"KKH":703,"OII":-2649};
|
||||
this.TC3__ = {"AAA":-294,"HHH":346,"HHI":-341,"HII":-1088,"HIK":731,"HOH":-1486,"IHH":128,"IHI":-3041,"IHO":-1935,"IIH":-825,"IIM":-1035,"IOI":-542,"KHH":-1216,"KKA":491,"KKH":-1217,"KOK":-1009,"MHH":-2694,"MHM":-457,"MHO":123,"MMH":-471,"NNH":-1689,"NNO":662,"OHO":-3393};
|
||||
this.TC4__ = {"HHH":-203,"HHI":1344,"HHK":365,"HHM":-122,"HHN":182,"HHO":669,"HIH":804,"HII":679,"HOH":446,"IHH":695,"IHO":-2324,"IIH":321,"III":1497,"IIO":656,"IOO":54,"KAK":4845,"KKA":3386,"KKK":3065,"MHH":-405,"MHI":201,"MMH":-241,"MMM":661,"MOM":841};
|
||||
this.TQ1__ = {"BHHH":-227,"BHHI":316,"BHIH":-132,"BIHH":60,"BIII":1595,"BNHH":-744,"BOHH":225,"BOOO":-908,"OAKK":482,"OHHH":281,"OHIH":249,"OIHI":200,"OIIH":-68};
|
||||
this.TQ2__ = {"BIHH":-1401,"BIII":-1033,"BKAK":-543,"BOOO":-5591};
|
||||
this.TQ3__ = {"BHHH":478,"BHHM":-1073,"BHIH":222,"BHII":-504,"BIIH":-116,"BIII":-105,"BMHI":-863,"BMHM":-464,"BOMH":620,"OHHH":346,"OHHI":1729,"OHII":997,"OHMH":481,"OIHH":623,"OIIH":1344,"OKAK":2792,"OKHH":587,"OKKA":679,"OOHH":110,"OOII":-685};
|
||||
this.TQ4__ = {"BHHH":-721,"BHHM":-3604,"BHII":-966,"BIIH":-607,"BIII":-2181,"OAAA":-2763,"OAKK":180,"OHHH":-294,"OHHI":2446,"OHHO":480,"OHIH":-1573,"OIHH":1935,"OIHI":-493,"OIIH":626,"OIII":-4007,"OKAK":-8156};
|
||||
this.TW1__ = {"につい":-4681,"東京都":2026};
|
||||
this.TW2__ = {"ある程":-2049,"いった":-1256,"ころが":-2434,"しょう":3873,"その後":-4430,"だって":-1049,"ていた":1833,"として":-4657,"ともに":-4517,"もので":1882,"一気に":-792,"初めて":-1512,"同時に":-8097,"大きな":-1255,"対して":-2721,"社会党":-3216};
|
||||
this.TW3__ = {"いただ":-1734,"してい":1314,"として":-4314,"につい":-5483,"にとっ":-5989,"に当た":-6247,"ので,":-727,"ので、":-727,"のもの":-600,"れから":-3752,"十二月":-2287};
|
||||
this.TW4__ = {"いう.":8576,"いう。":8576,"からな":-2348,"してい":2958,"たが,":1516,"たが、":1516,"ている":1538,"という":1349,"ました":5543,"ません":1097,"ようと":-4258,"よると":5865};
|
||||
this.UC1__ = {"A":484,"K":93,"M":645,"O":-505};
|
||||
this.UC2__ = {"A":819,"H":1059,"I":409,"M":3987,"N":5775,"O":646};
|
||||
this.UC3__ = {"A":-1370,"I":2311};
|
||||
this.UC4__ = {"A":-2643,"H":1809,"I":-1032,"K":-3450,"M":3565,"N":3876,"O":6646};
|
||||
this.UC5__ = {"H":313,"I":-1238,"K":-799,"M":539,"O":-831};
|
||||
this.UC6__ = {"H":-506,"I":-253,"K":87,"M":247,"O":-387};
|
||||
this.UP1__ = {"O":-214};
|
||||
this.UP2__ = {"B":69,"O":935};
|
||||
this.UP3__ = {"B":189};
|
||||
this.UQ1__ = {"BH":21,"BI":-12,"BK":-99,"BN":142,"BO":-56,"OH":-95,"OI":477,"OK":410,"OO":-2422};
|
||||
this.UQ2__ = {"BH":216,"BI":113,"OK":1759};
|
||||
this.UQ3__ = {"BA":-479,"BH":42,"BI":1913,"BK":-7198,"BM":3160,"BN":6427,"BO":14761,"OI":-827,"ON":-3212};
|
||||
this.UW1__ = {",":156,"、":156,"「":-463,"あ":-941,"う":-127,"が":-553,"き":121,"こ":505,"で":-201,"と":-547,"ど":-123,"に":-789,"の":-185,"は":-847,"も":-466,"や":-470,"よ":182,"ら":-292,"り":208,"れ":169,"を":-446,"ん":-137,"・":-135,"主":-402,"京":-268,"区":-912,"午":871,"国":-460,"大":561,"委":729,"市":-411,"日":-141,"理":361,"生":-408,"県":-386,"都":-718,"「":-463,"・":-135};
|
||||
this.UW2__ = {",":-829,"、":-829,"〇":892,"「":-645,"」":3145,"あ":-538,"い":505,"う":134,"お":-502,"か":1454,"が":-856,"く":-412,"こ":1141,"さ":878,"ざ":540,"し":1529,"す":-675,"せ":300,"そ":-1011,"た":188,"だ":1837,"つ":-949,"て":-291,"で":-268,"と":-981,"ど":1273,"な":1063,"に":-1764,"の":130,"は":-409,"ひ":-1273,"べ":1261,"ま":600,"も":-1263,"や":-402,"よ":1639,"り":-579,"る":-694,"れ":571,"を":-2516,"ん":2095,"ア":-587,"カ":306,"キ":568,"ッ":831,"三":-758,"不":-2150,"世":-302,"中":-968,"主":-861,"事":492,"人":-123,"会":978,"保":362,"入":548,"初":-3025,"副":-1566,"北":-3414,"区":-422,"大":-1769,"天":-865,"太":-483,"子":-1519,"学":760,"実":1023,"小":-2009,"市":-813,"年":-1060,"強":1067,"手":-1519,"揺":-1033,"政":1522,"文":-1355,"新":-1682,"日":-1815,"明":-1462,"最":-630,"朝":-1843,"本":-1650,"東":-931,"果":-665,"次":-2378,"民":-180,"気":-1740,"理":752,"発":529,"目":-1584,"相":-242,"県":-1165,"立":-763,"第":810,"米":509,"自":-1353,"行":838,"西":-744,"見":-3874,"調":1010,"議":1198,"込":3041,"開":1758,"間":-1257,"「":-645,"」":3145,"ッ":831,"ア":-587,"カ":306,"キ":568};
|
||||
this.UW3__ = {",":4889,"1":-800,"−":-1723,"、":4889,"々":-2311,"〇":5827,"」":2670,"〓":-3573,"あ":-2696,"い":1006,"う":2342,"え":1983,"お":-4864,"か":-1163,"が":3271,"く":1004,"け":388,"げ":401,"こ":-3552,"ご":-3116,"さ":-1058,"し":-395,"す":584,"せ":3685,"そ":-5228,"た":842,"ち":-521,"っ":-1444,"つ":-1081,"て":6167,"で":2318,"と":1691,"ど":-899,"な":-2788,"に":2745,"の":4056,"は":4555,"ひ":-2171,"ふ":-1798,"へ":1199,"ほ":-5516,"ま":-4384,"み":-120,"め":1205,"も":2323,"や":-788,"よ":-202,"ら":727,"り":649,"る":5905,"れ":2773,"わ":-1207,"を":6620,"ん":-518,"ア":551,"グ":1319,"ス":874,"ッ":-1350,"ト":521,"ム":1109,"ル":1591,"ロ":2201,"ン":278,"・":-3794,"一":-1619,"下":-1759,"世":-2087,"両":3815,"中":653,"主":-758,"予":-1193,"二":974,"人":2742,"今":792,"他":1889,"以":-1368,"低":811,"何":4265,"作":-361,"保":-2439,"元":4858,"党":3593,"全":1574,"公":-3030,"六":755,"共":-1880,"円":5807,"再":3095,"分":457,"初":2475,"別":1129,"前":2286,"副":4437,"力":365,"動":-949,"務":-1872,"化":1327,"北":-1038,"区":4646,"千":-2309,"午":-783,"協":-1006,"口":483,"右":1233,"各":3588,"合":-241,"同":3906,"和":-837,"員":4513,"国":642,"型":1389,"場":1219,"外":-241,"妻":2016,"学":-1356,"安":-423,"実":-1008,"家":1078,"小":-513,"少":-3102,"州":1155,"市":3197,"平":-1804,"年":2416,"広":-1030,"府":1605,"度":1452,"建":-2352,"当":-3885,"得":1905,"思":-1291,"性":1822,"戸":-488,"指":-3973,"政":-2013,"教":-1479,"数":3222,"文":-1489,"新":1764,"日":2099,"旧":5792,"昨":-661,"時":-1248,"曜":-951,"最":-937,"月":4125,"期":360,"李":3094,"村":364,"東":-805,"核":5156,"森":2438,"業":484,"氏":2613,"民":-1694,"決":-1073,"法":1868,"海":-495,"無":979,"物":461,"特":-3850,"生":-273,"用":914,"町":1215,"的":7313,"直":-1835,"省":792,"県":6293,"知":-1528,"私":4231,"税":401,"立":-960,"第":1201,"米":7767,"系":3066,"約":3663,"級":1384,"統":-4229,"総":1163,"線":1255,"者":6457,"能":725,"自":-2869,"英":785,"見":1044,"調":-562,"財":-733,"費":1777,"車":1835,"軍":1375,"込":-1504,"通":-1136,"選":-681,"郎":1026,"郡":4404,"部":1200,"金":2163,"長":421,"開":-1432,"間":1302,"関":-1282,"雨":2009,"電":-1045,"非":2066,"駅":1620,"1":-800,"」":2670,"・":-3794,"ッ":-1350,"ア":551,"グ":1319,"ス":874,"ト":521,"ム":1109,"ル":1591,"ロ":2201,"ン":278};
|
||||
this.UW4__ = {",":3930,".":3508,"―":-4841,"、":3930,"。":3508,"〇":4999,"「":1895,"」":3798,"〓":-5156,"あ":4752,"い":-3435,"う":-640,"え":-2514,"お":2405,"か":530,"が":6006,"き":-4482,"ぎ":-3821,"く":-3788,"け":-4376,"げ":-4734,"こ":2255,"ご":1979,"さ":2864,"し":-843,"じ":-2506,"す":-731,"ず":1251,"せ":181,"そ":4091,"た":5034,"だ":5408,"ち":-3654,"っ":-5882,"つ":-1659,"て":3994,"で":7410,"と":4547,"な":5433,"に":6499,"ぬ":1853,"ね":1413,"の":7396,"は":8578,"ば":1940,"ひ":4249,"び":-4134,"ふ":1345,"へ":6665,"べ":-744,"ほ":1464,"ま":1051,"み":-2082,"む":-882,"め":-5046,"も":4169,"ゃ":-2666,"や":2795,"ょ":-1544,"よ":3351,"ら":-2922,"り":-9726,"る":-14896,"れ":-2613,"ろ":-4570,"わ":-1783,"を":13150,"ん":-2352,"カ":2145,"コ":1789,"セ":1287,"ッ":-724,"ト":-403,"メ":-1635,"ラ":-881,"リ":-541,"ル":-856,"ン":-3637,"・":-4371,"ー":-11870,"一":-2069,"中":2210,"予":782,"事":-190,"井":-1768,"人":1036,"以":544,"会":950,"体":-1286,"作":530,"側":4292,"先":601,"党":-2006,"共":-1212,"内":584,"円":788,"初":1347,"前":1623,"副":3879,"力":-302,"動":-740,"務":-2715,"化":776,"区":4517,"協":1013,"参":1555,"合":-1834,"和":-681,"員":-910,"器":-851,"回":1500,"国":-619,"園":-1200,"地":866,"場":-1410,"塁":-2094,"士":-1413,"多":1067,"大":571,"子":-4802,"学":-1397,"定":-1057,"寺":-809,"小":1910,"屋":-1328,"山":-1500,"島":-2056,"川":-2667,"市":2771,"年":374,"庁":-4556,"後":456,"性":553,"感":916,"所":-1566,"支":856,"改":787,"政":2182,"教":704,"文":522,"方":-856,"日":1798,"時":1829,"最":845,"月":-9066,"木":-485,"来":-442,"校":-360,"業":-1043,"氏":5388,"民":-2716,"気":-910,"沢":-939,"済":-543,"物":-735,"率":672,"球":-1267,"生":-1286,"産":-1101,"田":-2900,"町":1826,"的":2586,"目":922,"省":-3485,"県":2997,"空":-867,"立":-2112,"第":788,"米":2937,"系":786,"約":2171,"経":1146,"統":-1169,"総":940,"線":-994,"署":749,"者":2145,"能":-730,"般":-852,"行":-792,"規":792,"警":-1184,"議":-244,"谷":-1000,"賞":730,"車":-1481,"軍":1158,"輪":-1433,"込":-3370,"近":929,"道":-1291,"選":2596,"郎":-4866,"都":1192,"野":-1100,"銀":-2213,"長":357,"間":-2344,"院":-2297,"際":-2604,"電":-878,"領":-1659,"題":-792,"館":-1984,"首":1749,"高":2120,"「":1895,"」":3798,"・":-4371,"ッ":-724,"ー":-11870,"カ":2145,"コ":1789,"セ":1287,"ト":-403,"メ":-1635,"ラ":-881,"リ":-541,"ル":-856,"ン":-3637};
|
||||
this.UW5__ = {",":465,".":-299,"1":-514,"E2":-32768,"]":-2762,"、":465,"。":-299,"「":363,"あ":1655,"い":331,"う":-503,"え":1199,"お":527,"か":647,"が":-421,"き":1624,"ぎ":1971,"く":312,"げ":-983,"さ":-1537,"し":-1371,"す":-852,"だ":-1186,"ち":1093,"っ":52,"つ":921,"て":-18,"で":-850,"と":-127,"ど":1682,"な":-787,"に":-1224,"の":-635,"は":-578,"べ":1001,"み":502,"め":865,"ゃ":3350,"ょ":854,"り":-208,"る":429,"れ":504,"わ":419,"を":-1264,"ん":327,"イ":241,"ル":451,"ン":-343,"中":-871,"京":722,"会":-1153,"党":-654,"務":3519,"区":-901,"告":848,"員":2104,"大":-1296,"学":-548,"定":1785,"嵐":-1304,"市":-2991,"席":921,"年":1763,"思":872,"所":-814,"挙":1618,"新":-1682,"日":218,"月":-4353,"査":932,"格":1356,"機":-1508,"氏":-1347,"田":240,"町":-3912,"的":-3149,"相":1319,"省":-1052,"県":-4003,"研":-997,"社":-278,"空":-813,"統":1955,"者":-2233,"表":663,"語":-1073,"議":1219,"選":-1018,"郎":-368,"長":786,"間":1191,"題":2368,"館":-689,"1":-514,"E2":-32768,"「":363,"イ":241,"ル":451,"ン":-343};
|
||||
this.UW6__ = {",":227,".":808,"1":-270,"E1":306,"、":227,"。":808,"あ":-307,"う":189,"か":241,"が":-73,"く":-121,"こ":-200,"じ":1782,"す":383,"た":-428,"っ":573,"て":-1014,"で":101,"と":-105,"な":-253,"に":-149,"の":-417,"は":-236,"も":-206,"り":187,"る":-135,"を":195,"ル":-673,"ン":-496,"一":-277,"中":201,"件":-800,"会":624,"前":302,"区":1792,"員":-1212,"委":798,"学":-960,"市":887,"広":-695,"後":535,"業":-697,"相":753,"社":-507,"福":974,"空":-822,"者":1811,"連":463,"郎":1082,"1":-270,"E1":306,"ル":-673,"ン":-496};
|
||||
|
||||
return this;
|
||||
}
|
||||
TinySegmenter.prototype.ctype_ = function(str) {
|
||||
for (var i in this.chartype_) {
|
||||
if (str.match(this.chartype_[i][0])) {
|
||||
return this.chartype_[i][1];
|
||||
}
|
||||
}
|
||||
return "O";
|
||||
}
|
||||
|
||||
TinySegmenter.prototype.ts_ = function(v) {
|
||||
if (v) { return v; }
|
||||
return 0;
|
||||
}
|
||||
|
||||
TinySegmenter.prototype.segment = function(input) {
|
||||
if (input == null || input == undefined || input == "") {
|
||||
return [];
|
||||
}
|
||||
var result = [];
|
||||
var seg = ["B3","B2","B1"];
|
||||
var ctype = ["O","O","O"];
|
||||
var o = input.split("");
|
||||
for (i = 0; i < o.length; ++i) {
|
||||
seg.push(o[i]);
|
||||
ctype.push(this.ctype_(o[i]))
|
||||
}
|
||||
seg.push("E1");
|
||||
seg.push("E2");
|
||||
seg.push("E3");
|
||||
ctype.push("O");
|
||||
ctype.push("O");
|
||||
ctype.push("O");
|
||||
var word = seg[3];
|
||||
var p1 = "U";
|
||||
var p2 = "U";
|
||||
var p3 = "U";
|
||||
for (var i = 4; i < seg.length - 3; ++i) {
|
||||
var score = this.BIAS__;
|
||||
var w1 = seg[i-3];
|
||||
var w2 = seg[i-2];
|
||||
var w3 = seg[i-1];
|
||||
var w4 = seg[i];
|
||||
var w5 = seg[i+1];
|
||||
var w6 = seg[i+2];
|
||||
var c1 = ctype[i-3];
|
||||
var c2 = ctype[i-2];
|
||||
var c3 = ctype[i-1];
|
||||
var c4 = ctype[i];
|
||||
var c5 = ctype[i+1];
|
||||
var c6 = ctype[i+2];
|
||||
score += this.ts_(this.UP1__[p1]);
|
||||
score += this.ts_(this.UP2__[p2]);
|
||||
score += this.ts_(this.UP3__[p3]);
|
||||
score += this.ts_(this.BP1__[p1 + p2]);
|
||||
score += this.ts_(this.BP2__[p2 + p3]);
|
||||
score += this.ts_(this.UW1__[w1]);
|
||||
score += this.ts_(this.UW2__[w2]);
|
||||
score += this.ts_(this.UW3__[w3]);
|
||||
score += this.ts_(this.UW4__[w4]);
|
||||
score += this.ts_(this.UW5__[w5]);
|
||||
score += this.ts_(this.UW6__[w6]);
|
||||
score += this.ts_(this.BW1__[w2 + w3]);
|
||||
score += this.ts_(this.BW2__[w3 + w4]);
|
||||
score += this.ts_(this.BW3__[w4 + w5]);
|
||||
score += this.ts_(this.TW1__[w1 + w2 + w3]);
|
||||
score += this.ts_(this.TW2__[w2 + w3 + w4]);
|
||||
score += this.ts_(this.TW3__[w3 + w4 + w5]);
|
||||
score += this.ts_(this.TW4__[w4 + w5 + w6]);
|
||||
score += this.ts_(this.UC1__[c1]);
|
||||
score += this.ts_(this.UC2__[c2]);
|
||||
score += this.ts_(this.UC3__[c3]);
|
||||
score += this.ts_(this.UC4__[c4]);
|
||||
score += this.ts_(this.UC5__[c5]);
|
||||
score += this.ts_(this.UC6__[c6]);
|
||||
score += this.ts_(this.BC1__[c2 + c3]);
|
||||
score += this.ts_(this.BC2__[c3 + c4]);
|
||||
score += this.ts_(this.BC3__[c4 + c5]);
|
||||
score += this.ts_(this.TC1__[c1 + c2 + c3]);
|
||||
score += this.ts_(this.TC2__[c2 + c3 + c4]);
|
||||
score += this.ts_(this.TC3__[c3 + c4 + c5]);
|
||||
score += this.ts_(this.TC4__[c4 + c5 + c6]);
|
||||
// score += this.ts_(this.TC5__[c4 + c5 + c6]);
|
||||
score += this.ts_(this.UQ1__[p1 + c1]);
|
||||
score += this.ts_(this.UQ2__[p2 + c2]);
|
||||
score += this.ts_(this.UQ3__[p3 + c3]);
|
||||
score += this.ts_(this.BQ1__[p2 + c2 + c3]);
|
||||
score += this.ts_(this.BQ2__[p2 + c3 + c4]);
|
||||
score += this.ts_(this.BQ3__[p3 + c2 + c3]);
|
||||
score += this.ts_(this.BQ4__[p3 + c3 + c4]);
|
||||
score += this.ts_(this.TQ1__[p2 + c1 + c2 + c3]);
|
||||
score += this.ts_(this.TQ2__[p2 + c2 + c3 + c4]);
|
||||
score += this.ts_(this.TQ3__[p3 + c1 + c2 + c3]);
|
||||
score += this.ts_(this.TQ4__[p3 + c2 + c3 + c4]);
|
||||
var p = "O";
|
||||
if (score > 0) {
|
||||
result.push(word);
|
||||
word = "";
|
||||
p = "B";
|
||||
}
|
||||
p1 = p2;
|
||||
p2 = p3;
|
||||
p3 = p;
|
||||
word += seg[i];
|
||||
}
|
||||
result.push(word);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
lunr.TinySegmenter = TinySegmenter;
|
||||
};
|
||||
|
||||
}));
|
||||
@@ -1,381 +0,0 @@
|
||||
/*!
|
||||
* Lunr languages, `Arabic` language
|
||||
* https://github.com/MihaiValentin/lunr-languages
|
||||
*
|
||||
* Copyright 2018, Dalia Al-Shahrabi
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
/*!
|
||||
* based on
|
||||
* Kazem Taghva, Rania Elkhoury, and Jeffrey Coombs (2005)
|
||||
* Meryeme Hadni, Abdelmonaime Lachkar, and S. Alaoui Ouatik (2012)
|
||||
*
|
||||
* Snowball JavaScript Library v0.3
|
||||
* http://code.google.com/p/urim/
|
||||
* http://snowball.tartarus.org/
|
||||
*
|
||||
* Copyright 2010, Oleg Mazko
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
|
||||
/**
|
||||
* export the module via AMD, CommonJS or as a browser global
|
||||
* Export code from https://github.com/umdjs/umd/blob/master/returnExports.js
|
||||
*/
|
||||
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(factory)
|
||||
} else if (typeof exports === 'object') {
|
||||
/**
|
||||
* Node. Does not work with strict CommonJS, but
|
||||
* only CommonJS-like environments that support module.exports,
|
||||
* like Node.
|
||||
*/
|
||||
module.exports = factory()
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
factory()(root.lunr);
|
||||
}
|
||||
}(this, function() {
|
||||
/**
|
||||
* Just return a value to define the module export.
|
||||
* This example returns an object, but the module
|
||||
* can return a function as the exported value.
|
||||
*/
|
||||
return function(lunr) {
|
||||
/* throw error if lunr is not yet included */
|
||||
if ('undefined' === typeof lunr) {
|
||||
throw new Error('Lunr is not present. Please include / require Lunr before this script.');
|
||||
}
|
||||
|
||||
/* throw error if lunr stemmer support is not yet included */
|
||||
if ('undefined' === typeof lunr.stemmerSupport) {
|
||||
throw new Error('Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.');
|
||||
}
|
||||
|
||||
/* register specific locale function */
|
||||
lunr.ar = function() {
|
||||
this.pipeline.reset();
|
||||
this.pipeline.add(
|
||||
lunr.ar.trimmer,
|
||||
lunr.ar.stopWordFilter,
|
||||
lunr.ar.stemmer
|
||||
);
|
||||
|
||||
// for lunr version 2
|
||||
// this is necessary so that every searched word is also stemmed before
|
||||
// in lunr <= 1 this is not needed, as it is done using the normal pipeline
|
||||
if (this.searchPipeline) {
|
||||
this.searchPipeline.reset();
|
||||
this.searchPipeline.add(lunr.ar.stemmer)
|
||||
}
|
||||
};
|
||||
|
||||
/* lunr trimmer function */
|
||||
lunr.ar.wordCharacters = "\u0621-\u065b\u0671\u0640";
|
||||
lunr.ar.trimmer = lunr.trimmerSupport.generateTrimmer(lunr.ar.wordCharacters);
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.ar.trimmer, 'trimmer-ar');
|
||||
|
||||
/* lunr stemmer function */
|
||||
lunr.ar.stemmer = (function() {
|
||||
var self = this;
|
||||
var word = '';
|
||||
self.result = false;
|
||||
self.preRemoved = false;
|
||||
self.sufRemoved = false;
|
||||
|
||||
//prefix data
|
||||
self.pre = {
|
||||
pre1: 'ف ك ب و س ل ن ا ي ت',
|
||||
pre2: 'ال لل',
|
||||
pre3: 'بال وال فال تال كال ولل',
|
||||
pre4: 'فبال كبال وبال وكال'
|
||||
};
|
||||
|
||||
//suffix data
|
||||
self.suf = {
|
||||
suf1: 'ه ك ت ن ا ي',
|
||||
suf2: 'نك نه ها وك يا اه ون ين تن تم نا وا ان كم كن ني نن ما هم هن تك ته ات يه',
|
||||
suf3: 'تين كهم نيه نهم ونه وها يهم ونا ونك وني وهم تكم تنا تها تني تهم كما كها ناه نكم هنا تان يها',
|
||||
suf4: 'كموه ناها ونني ونهم تكما تموه تكاه كماه ناكم ناهم نيها وننا'
|
||||
}
|
||||
|
||||
//arabic language patterns and alternative mapping for patterns
|
||||
self.patterns = JSON.parse('{"pt43":[{"pt":[{"c":"ا","l":1}]},{"pt":[{"c":"ا,ت,ن,ي","l":0}],"mPt":[{"c":"ف","l":0,"m":1},{"c":"ع","l":1,"m":2},{"c":"ل","l":2,"m":3}]},{"pt":[{"c":"و","l":2}],"mPt":[{"c":"ف","l":0,"m":0},{"c":"ع","l":1,"m":1},{"c":"ل","l":2,"m":3}]},{"pt":[{"c":"ا","l":2}]},{"pt":[{"c":"ي","l":2}],"mPt":[{"c":"ف","l":0,"m":0},{"c":"ع","l":1,"m":1},{"c":"ا","l":2},{"c":"ل","l":3,"m":3}]},{"pt":[{"c":"م","l":0}]}],"pt53":[{"pt":[{"c":"ت","l":0},{"c":"ا","l":2}]},{"pt":[{"c":"ا,ن,ت,ي","l":0},{"c":"ت","l":2}],"mPt":[{"c":"ا","l":0},{"c":"ف","l":1,"m":1},{"c":"ت","l":2},{"c":"ع","l":3,"m":3},{"c":"ا","l":4},{"c":"ل","l":5,"m":4}]},{"pt":[{"c":"ا","l":0},{"c":"ا","l":2}],"mPt":[{"c":"ا","l":0},{"c":"ف","l":1,"m":1},{"c":"ع","l":2,"m":3},{"c":"ل","l":3,"m":4},{"c":"ا","l":4},{"c":"ل","l":5,"m":4}]},{"pt":[{"c":"ا","l":0},{"c":"ا","l":3}],"mPt":[{"c":"ف","l":0,"m":1},{"c":"ع","l":1,"m":2},{"c":"ل","l":2,"m":4}]},{"pt":[{"c":"ا","l":3},{"c":"ن","l":4}]},{"pt":[{"c":"ت","l":0},{"c":"ي","l":3}]},{"pt":[{"c":"م","l":0},{"c":"و","l":3}]},{"pt":[{"c":"ا","l":1},{"c":"و","l":3}]},{"pt":[{"c":"و","l":1},{"c":"ا","l":2}]},{"pt":[{"c":"م","l":0},{"c":"ا","l":3}]},{"pt":[{"c":"م","l":0},{"c":"ي","l":3}]},{"pt":[{"c":"ا","l":2},{"c":"ن","l":3}]},{"pt":[{"c":"م","l":0},{"c":"ن","l":1}],"mPt":[{"c":"ا","l":0},{"c":"ن","l":1},{"c":"ف","l":2,"m":2},{"c":"ع","l":3,"m":3},{"c":"ا","l":4},{"c":"ل","l":5,"m":4}]},{"pt":[{"c":"م","l":0},{"c":"ت","l":2}],"mPt":[{"c":"ا","l":0},{"c":"ف","l":1,"m":1},{"c":"ت","l":2},{"c":"ع","l":3,"m":3},{"c":"ا","l":4},{"c":"ل","l":5,"m":4}]},{"pt":[{"c":"م","l":0},{"c":"ا","l":2}]},{"pt":[{"c":"م","l":1},{"c":"ا","l":3}]},{"pt":[{"c":"ي,ت,ا,ن","l":0},{"c":"ت","l":1}],"mPt":[{"c":"ف","l":0,"m":2},{"c":"ع","l":1,"m":3},{"c":"ا","l":2},{"c":"ل","l":3,"m":4}]},{"pt":[{"c":"ت,ي,ا,ن","l":0},{"c":"ت","l":2}],"mPt":[{"c":"ا","l":0},{"c":"ف","l":1,"m":1},{"c":"ت","l":2},{"c":"ع","l":3,"m":3},{"c":"ا","l":4},{"c":"ل","l":5,"m":4}]},{"pt":[{"c":"ا","l":2},{"c":"ي","l":3}]},{"pt":[{"c":"ا,ي,ت,ن","l":0},{"c":"ن","l":1}],"mPt":[{"c":"ا","l":0},{"c":"ن","l":1},{"c":"ف","l":2,"m":2},{"c":"ع","l":3,"m":3},{"c":"ا","l":4},{"c":"ل","l":5,"m":4}]},{"pt":[{"c":"ا","l":3},{"c":"ء","l":4}]}],"pt63":[{"pt":[{"c":"ا","l":0},{"c":"ت","l":2},{"c":"ا","l":4}]},{"pt":[{"c":"ا,ت,ن,ي","l":0},{"c":"س","l":1},{"c":"ت","l":2}],"mPt":[{"c":"ا","l":0},{"c":"س","l":1},{"c":"ت","l":2},{"c":"ف","l":3,"m":3},{"c":"ع","l":4,"m":4},{"c":"ا","l":5},{"c":"ل","l":6,"m":5}]},{"pt":[{"c":"ا,ن,ت,ي","l":0},{"c":"و","l":3}]},{"pt":[{"c":"م","l":0},{"c":"س","l":1},{"c":"ت","l":2}],"mPt":[{"c":"ا","l":0},{"c":"س","l":1},{"c":"ت","l":2},{"c":"ف","l":3,"m":3},{"c":"ع","l":4,"m":4},{"c":"ا","l":5},{"c":"ل","l":6,"m":5}]},{"pt":[{"c":"ي","l":1},{"c":"ي","l":3},{"c":"ا","l":4},{"c":"ء","l":5}]},{"pt":[{"c":"ا","l":0},{"c":"ن","l":1},{"c":"ا","l":4}]}],"pt54":[{"pt":[{"c":"ت","l":0}]},{"pt":[{"c":"ا,ي,ت,ن","l":0}],"mPt":[{"c":"ا","l":0},{"c":"ف","l":1,"m":1},{"c":"ع","l":2,"m":2},{"c":"ل","l":3,"m":3},{"c":"ر","l":4,"m":4},{"c":"ا","l":5},{"c":"ر","l":6,"m":4}]},{"pt":[{"c":"م","l":0}],"mPt":[{"c":"ا","l":0},{"c":"ف","l":1,"m":1},{"c":"ع","l":2,"m":2},{"c":"ل","l":3,"m":3},{"c":"ر","l":4,"m":4},{"c":"ا","l":5},{"c":"ر","l":6,"m":4}]},{"pt":[{"c":"ا","l":2}]},{"pt":[{"c":"ا","l":0},{"c":"ن","l":2}]}],"pt64":[{"pt":[{"c":"ا","l":0},{"c":"ا","l":4}]},{"pt":[{"c":"م","l":0},{"c":"ت","l":1}]}],"pt73":[{"pt":[{"c":"ا","l":0},{"c":"س","l":1},{"c":"ت","l":2},{"c":"ا","l":5}]}],"pt75":[{"pt":[{"c":"ا","l":0},{"c":"ا","l":5}]}]}');
|
||||
|
||||
self.execArray = [
|
||||
'cleanWord',
|
||||
'removeDiacritics',
|
||||
'cleanAlef',
|
||||
'removeStopWords',
|
||||
'normalizeHamzaAndAlef',
|
||||
'removeStartWaw',
|
||||
'removePre432',
|
||||
'removeEndTaa',
|
||||
'wordCheck'
|
||||
];
|
||||
|
||||
self.stem = function() {
|
||||
var counter = 0;
|
||||
self.result = false;
|
||||
self.preRemoved = false;
|
||||
self.sufRemoved = false;
|
||||
while (counter < self.execArray.length && self.result != true) {
|
||||
self.result = self[self.execArray[counter]]();
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
|
||||
self.setCurrent = function(word) {
|
||||
self.word = word;
|
||||
}
|
||||
|
||||
self.getCurrent = function() {
|
||||
return self.word
|
||||
}
|
||||
|
||||
/*remove elongating character and test that the word does not contain non-arabic characters.
|
||||
If the word contains special characters, don't stem. */
|
||||
self.cleanWord = function() {
|
||||
var wordCharacters = "\u0621-\u065b\u0671\u0640";
|
||||
var testRegex = new RegExp("[^" + wordCharacters + "]");
|
||||
self.word = self.word
|
||||
.replace('\u0640', '');
|
||||
if (testRegex.test(word)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
self.removeDiacritics = function() {
|
||||
var diacriticsRegex = new RegExp("[\u064b-\u065b]");
|
||||
self.word = self.word.replace(/[\u064b-\u065b]/gi, '');
|
||||
return false;
|
||||
}
|
||||
|
||||
/*Replace all variations of alef (آأإٱى) to a plain alef (ا)*/
|
||||
self.cleanAlef = function() {
|
||||
var alefRegex = new RegExp("[\u0622\u0623\u0625\u0671\u0649]");
|
||||
self.word = self.word.replace(alefRegex, "\u0627");
|
||||
return false;
|
||||
}
|
||||
|
||||
/* if the word is a stop word, don't stem*/
|
||||
self.removeStopWords = function() {
|
||||
var stopWords = '، اض امين اه اها اي ا اب اجل اجمع اخ اخذ اصبح اضحى اقبل اقل اكثر الا ام اما امامك امامك امسى اما ان انا انت انتم انتما انتن انت انشا انى او اوشك اولئك اولئكم اولاء اولالك اوه اي ايا اين اينما اي ان اي اف اذ اذا اذا اذما اذن الى اليكم اليكما اليكن اليك اليك الا اما ان انما اي اياك اياكم اياكما اياكن ايانا اياه اياها اياهم اياهما اياهن اياي ايه ان ا ابتدا اثر اجل احد اخرى اخلولق اذا اربعة ارتد استحال اطار اعادة اعلنت اف اكثر اكد الالاء الالى الا الاخيرة الان الاول الاولى التى التي الثاني الثانية الذاتي الذى الذي الذين السابق الف اللائي اللاتي اللتان اللتيا اللتين اللذان اللذين اللواتي الماضي المقبل الوقت الى اليوم اما امام امس ان انبرى انقلب انه انها او اول اي ايار ايام ايضا ب بات باسم بان بخ برس بسبب بس بشكل بضع بطان بعد بعض بك بكم بكما بكن بل بلى بما بماذا بمن بن بنا به بها بي بيد بين بس بله بئس تان تانك تبدل تجاه تحول تلقاء تلك تلكم تلكما تم تينك تين ته تي ثلاثة ثم ثم ثمة ثم جعل جلل جميع جير حار حاشا حاليا حاي حتى حرى حسب حم حوالى حول حيث حيثما حين حي حبذا حتى حذار خلا خلال دون دونك ذا ذات ذاك ذانك ذان ذلك ذلكم ذلكما ذلكن ذو ذوا ذواتا ذواتي ذيت ذينك ذين ذه ذي راح رجع رويدك ريث رب زيارة سبحان سرعان سنة سنوات سوف سوى ساء ساءما شبه شخصا شرع شتان صار صباح صفر صه صه ضد ضمن طاق طالما طفق طق ظل عاد عام عاما عامة عدا عدة عدد عدم عسى عشر عشرة علق على عليك عليه عليها عل عن عند عندما عوض عين عدس عما غدا غير ف فان فلان فو فى في فيم فيما فيه فيها قال قام قبل قد قط قلما قوة كانما كاين كاي كاين كاد كان كانت كذا كذلك كرب كل كلا كلاهما كلتا كلم كليكما كليهما كلما كلا كم كما كي كيت كيف كيفما كان كخ لئن لا لات لاسيما لدن لدى لعمر لقاء لك لكم لكما لكن لكنما لكي لكيلا للامم لم لما لما لن لنا له لها لو لوكالة لولا لوما لي لست لست لستم لستما لستن لست لسن لعل لكن ليت ليس ليسا ليستا ليست ليسوا لسنا ما ماانفك مابرح مادام ماذا مازال مافتئ مايو متى مثل مذ مساء مع معاذ مقابل مكانكم مكانكما مكانكن مكانك مليار مليون مما ممن من منذ منها مه مهما من من نحن نحو نعم نفس نفسه نهاية نخ نعما نعم ها هاؤم هاك هاهنا هب هذا هذه هكذا هل هلم هلا هم هما هن هنا هناك هنالك هو هي هيا هيت هيا هؤلاء هاتان هاتين هاته هاتي هج هذا هذان هذين هذه هذي هيهات و وا واحد واضاف واضافت واكد وان واها واوضح وراءك وفي وقال وقالت وقد وقف وكان وكانت ولا ولم ومن وهو وهي ويكان وي وشكان يكون يمكن يوم ايان'.split(' ');
|
||||
if (stopWords.indexOf(self.word) >= 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/* changes ؤ ئ to ء and removes alef if at the end of the word*/
|
||||
self.normalizeHamzaAndAlef = function() {
|
||||
self.word = self.word.replace('\u0624', '\u0621');
|
||||
self.word = self.word.replace('\u0626', '\u0621');
|
||||
self.word = self.word.replace(/([\u0627])\1+/gi, '\u0627');
|
||||
return false;
|
||||
}
|
||||
|
||||
/*remove end taa marboota ة*/
|
||||
self.removeEndTaa = function() {
|
||||
if (self.word.length > 2) {
|
||||
self.word = self.word.replace(/[\u0627]$/, '');
|
||||
self.word = self.word.replace('\u0629', '');
|
||||
return false;
|
||||
} else return true;
|
||||
}
|
||||
|
||||
/* if the word starts with double waw وو keep only one of them */
|
||||
self.removeStartWaw = function() {
|
||||
if (self.word.length > 3 && self.word[0] == '\u0648' && self.word[1] == '\u0648') {
|
||||
self.word = self.word.slice(1);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* remove prefixes of size 4, 3 and 2 characters */
|
||||
self.removePre432 = function() {
|
||||
var word = self.word;
|
||||
if (self.word.length >= 7) {
|
||||
var pre4Regex = new RegExp('^(' + self.pre.pre4.split(' ').join('|') + ')')
|
||||
self.word = self.word.replace(pre4Regex, '');
|
||||
}
|
||||
if (self.word == word && self.word.length >= 6) {
|
||||
var pre3Regex = new RegExp('^(' + self.pre.pre3.split(' ').join('|') + ')')
|
||||
self.word = self.word.replace(pre3Regex, '');
|
||||
}
|
||||
if (self.word == word && self.word.length >= 5) {
|
||||
var pre2Regex = new RegExp('^(' + self.pre.pre2.split(' ').join('|') + ')')
|
||||
self.word = self.word.replace(pre2Regex, '');
|
||||
}
|
||||
if (word != self.word) self.preRemoved = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* check the word against word patterns. If the word matches a pattern, map it to the
|
||||
alternative pattern if available then stop stemming. */
|
||||
self.patternCheck = function(pattern) {
|
||||
var patternMatch = false;
|
||||
for (var i = 0; i < pattern.length; i++) {
|
||||
var currentPatternCheck = true;
|
||||
for (var j = 0; j < pattern[i].pt.length; j++) {
|
||||
var chars = pattern[i].pt[j].c.split(',');
|
||||
var charMatch = false;
|
||||
chars.forEach(function(el) {
|
||||
if (self.word[pattern[i].pt[j].l] == el) {
|
||||
charMatch = true;
|
||||
}
|
||||
})
|
||||
if (!charMatch) {
|
||||
currentPatternCheck = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (currentPatternCheck == true) {
|
||||
if (pattern[i].mPt) {
|
||||
var newWord = [];
|
||||
for (var k = 0; k < pattern[i].mPt.length; k++) {
|
||||
if (pattern[i].mPt[k].m != null) {
|
||||
newWord[pattern[i].mPt[k].l] = self.word[pattern[i].mPt[k].m]
|
||||
} else {
|
||||
newWord[pattern[i].mPt[k].l] = pattern[i].mPt[k].c
|
||||
}
|
||||
}
|
||||
self.word = newWord.join('');
|
||||
}
|
||||
self.result = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* remove prefixes of size 1 char*/
|
||||
self.removePre1 = function() {
|
||||
var word = self.word;
|
||||
if (self.preRemoved == false)
|
||||
if (self.word.length > 3) {
|
||||
var pre1Regex = new RegExp('^(' + self.pre.pre1.split(' ').join('|') + ')')
|
||||
self.word = self.word.replace(pre1Regex, '');
|
||||
}
|
||||
if (word != self.word) self.preRemoved = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/*remove suffixes of size 1 char */
|
||||
self.removeSuf1 = function() {
|
||||
var word = self.word;
|
||||
if (self.sufRemoved == false)
|
||||
if (self.word.length > 3) {
|
||||
var suf1Regex = new RegExp('(' + self.suf.suf1.split(' ').join('|') + ')$')
|
||||
self.word = self.word.replace(suf1Regex, '');
|
||||
}
|
||||
if (word != self.word) self.sufRemoved = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/*remove suffixes of size 4, 3 and 2 chars*/
|
||||
self.removeSuf432 = function() {
|
||||
var word = self.word;
|
||||
if (self.word.length >= 6) {
|
||||
var suf4Regex = new RegExp('(' + self.suf.suf4.split(' ').join('|') + ')$')
|
||||
self.word = self.word.replace(suf4Regex, '');
|
||||
}
|
||||
if (self.word == word && self.word.length >= 5) {
|
||||
var suf3Regex = new RegExp('(' + self.suf.suf3.split(' ').join('|') + ')$')
|
||||
self.word = self.word.replace(suf3Regex, '');
|
||||
}
|
||||
if (self.word == word && self.word.length >= 4) {
|
||||
var suf2Regex = new RegExp('(' + self.suf.suf2.split(' ').join('|') + ')$')
|
||||
self.word = self.word.replace(suf2Regex, '');
|
||||
}
|
||||
if (word != self.word) self.sufRemoved = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/*check the word length and decide what is the next step accordingly*/
|
||||
self.wordCheck = function() {
|
||||
var word = self.word;
|
||||
var word7Exec = [self.removeSuf432, self.removeSuf1, self.removePre1]
|
||||
var counter = 0;
|
||||
var patternChecked = false;
|
||||
while (self.word.length >= 7 && !self.result && counter < word7Exec.length) {
|
||||
if (self.word.length == 7 && !patternChecked) {
|
||||
self.checkPattern73();
|
||||
patternChecked = true;
|
||||
} else {
|
||||
word7Exec[counter]();
|
||||
counter++;
|
||||
patternChecked = false;
|
||||
}
|
||||
}
|
||||
|
||||
var word6Exec = [self.checkPattern63, self.removeSuf432, self.removeSuf1, self.removePre1, self.checkPattern64];
|
||||
counter = 0;
|
||||
while (self.word.length == 6 && !self.result && counter < word6Exec.length) {
|
||||
word6Exec[counter]();
|
||||
counter++;
|
||||
}
|
||||
|
||||
var word5Exec = [self.checkPattern53, self.removeSuf432, self.removeSuf1, self.removePre1, self.checkPattern54];
|
||||
counter = 0;
|
||||
while (self.word.length == 5 && !self.result && counter < word5Exec.length) {
|
||||
word5Exec[counter]();
|
||||
counter++;
|
||||
}
|
||||
|
||||
var word4Exec = [self.checkPattern43, self.removeSuf1, self.removePre1, self.removeSuf432];
|
||||
counter = 0;
|
||||
while (self.word.length == 4 && !self.result && counter < word4Exec.length) {
|
||||
word4Exec[counter]();
|
||||
counter++;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
self.checkPattern43 = function() {
|
||||
self.patternCheck(self.patterns.pt43)
|
||||
}
|
||||
self.checkPattern53 = function() {
|
||||
self.patternCheck(self.patterns.pt53)
|
||||
}
|
||||
self.checkPattern54 = function() {
|
||||
self.patternCheck(self.patterns.pt54)
|
||||
}
|
||||
self.checkPattern63 = function() {
|
||||
self.patternCheck(self.patterns.pt63)
|
||||
}
|
||||
self.checkPattern64 = function() {
|
||||
self.patternCheck(self.patterns.pt64)
|
||||
}
|
||||
self.checkPattern73 = function() {
|
||||
self.patternCheck(self.patterns.pt73)
|
||||
}
|
||||
|
||||
/* and return a function that stems a word for the current locale */
|
||||
return function(token) {
|
||||
// for lunr version 2
|
||||
if (typeof token.update === "function") {
|
||||
return token.update(function(word) {
|
||||
self.setCurrent(word);
|
||||
self.stem();
|
||||
return self.getCurrent();
|
||||
})
|
||||
} else { // for lunr version <= 1
|
||||
self.setCurrent(token);
|
||||
self.stem();
|
||||
return self.getCurrent();
|
||||
}
|
||||
|
||||
}
|
||||
})();
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.ar.stemmer, 'stemmer-ar');
|
||||
|
||||
lunr.ar.stopWordFilter = lunr.generateStopWordFilter('، اض امين اه اها اي ا اب اجل اجمع اخ اخذ اصبح اضحى اقبل اقل اكثر الا ام اما امامك امامك امسى اما ان انا انت انتم انتما انتن انت انشا انى او اوشك اولئك اولئكم اولاء اولالك اوه اي ايا اين اينما اي ان اي اف اذ اذا اذا اذما اذن الى اليكم اليكما اليكن اليك اليك الا اما ان انما اي اياك اياكم اياكما اياكن ايانا اياه اياها اياهم اياهما اياهن اياي ايه ان ا ابتدا اثر اجل احد اخرى اخلولق اذا اربعة ارتد استحال اطار اعادة اعلنت اف اكثر اكد الالاء الالى الا الاخيرة الان الاول الاولى التى التي الثاني الثانية الذاتي الذى الذي الذين السابق الف اللائي اللاتي اللتان اللتيا اللتين اللذان اللذين اللواتي الماضي المقبل الوقت الى اليوم اما امام امس ان انبرى انقلب انه انها او اول اي ايار ايام ايضا ب بات باسم بان بخ برس بسبب بس بشكل بضع بطان بعد بعض بك بكم بكما بكن بل بلى بما بماذا بمن بن بنا به بها بي بيد بين بس بله بئس تان تانك تبدل تجاه تحول تلقاء تلك تلكم تلكما تم تينك تين ته تي ثلاثة ثم ثم ثمة ثم جعل جلل جميع جير حار حاشا حاليا حاي حتى حرى حسب حم حوالى حول حيث حيثما حين حي حبذا حتى حذار خلا خلال دون دونك ذا ذات ذاك ذانك ذان ذلك ذلكم ذلكما ذلكن ذو ذوا ذواتا ذواتي ذيت ذينك ذين ذه ذي راح رجع رويدك ريث رب زيارة سبحان سرعان سنة سنوات سوف سوى ساء ساءما شبه شخصا شرع شتان صار صباح صفر صه صه ضد ضمن طاق طالما طفق طق ظل عاد عام عاما عامة عدا عدة عدد عدم عسى عشر عشرة علق على عليك عليه عليها عل عن عند عندما عوض عين عدس عما غدا غير ف فان فلان فو فى في فيم فيما فيه فيها قال قام قبل قد قط قلما قوة كانما كاين كاي كاين كاد كان كانت كذا كذلك كرب كل كلا كلاهما كلتا كلم كليكما كليهما كلما كلا كم كما كي كيت كيف كيفما كان كخ لئن لا لات لاسيما لدن لدى لعمر لقاء لك لكم لكما لكن لكنما لكي لكيلا للامم لم لما لما لن لنا له لها لو لوكالة لولا لوما لي لست لست لستم لستما لستن لست لسن لعل لكن ليت ليس ليسا ليستا ليست ليسوا لسنا ما ماانفك مابرح مادام ماذا مازال مافتئ مايو متى مثل مذ مساء مع معاذ مقابل مكانكم مكانكما مكانكن مكانك مليار مليون مما ممن من منذ منها مه مهما من من نحن نحو نعم نفس نفسه نهاية نخ نعما نعم ها هاؤم هاك هاهنا هب هذا هذه هكذا هل هلم هلا هم هما هن هنا هناك هنالك هو هي هيا هيت هيا هؤلاء هاتان هاتين هاته هاتي هج هذا هذان هذين هذه هذي هيهات وا واحد واضاف واضافت واكد وان واها واوضح وراءك وفي وقال وقالت وقد وقف وكان وكانت ولا ولم ومن وهو وهي ويكان وي وشكان يكون يمكن يوم ايان'.split(' '));
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.ar.stopWordFilter, 'stopWordFilter-ar');
|
||||
};
|
||||
}))
|
||||
@@ -1,284 +0,0 @@
|
||||
/*!
|
||||
* Lunr languages, `Danish` language
|
||||
* https://github.com/MihaiValentin/lunr-languages
|
||||
*
|
||||
* Copyright 2014, Mihai Valentin
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
/*!
|
||||
* based on
|
||||
* Snowball JavaScript Library v0.3
|
||||
* http://code.google.com/p/urim/
|
||||
* http://snowball.tartarus.org/
|
||||
*
|
||||
* Copyright 2010, Oleg Mazko
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
|
||||
/**
|
||||
* export the module via AMD, CommonJS or as a browser global
|
||||
* Export code from https://github.com/umdjs/umd/blob/master/returnExports.js
|
||||
*/
|
||||
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(factory)
|
||||
} else if (typeof exports === 'object') {
|
||||
/**
|
||||
* Node. Does not work with strict CommonJS, but
|
||||
* only CommonJS-like environments that support module.exports,
|
||||
* like Node.
|
||||
*/
|
||||
module.exports = factory()
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
factory()(root.lunr);
|
||||
}
|
||||
}(this, function() {
|
||||
/**
|
||||
* Just return a value to define the module export.
|
||||
* This example returns an object, but the module
|
||||
* can return a function as the exported value.
|
||||
*/
|
||||
return function(lunr) {
|
||||
/* throw error if lunr is not yet included */
|
||||
if ('undefined' === typeof lunr) {
|
||||
throw new Error('Lunr is not present. Please include / require Lunr before this script.');
|
||||
}
|
||||
|
||||
/* throw error if lunr stemmer support is not yet included */
|
||||
if ('undefined' === typeof lunr.stemmerSupport) {
|
||||
throw new Error('Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.');
|
||||
}
|
||||
|
||||
/* register specific locale function */
|
||||
lunr.da = function() {
|
||||
this.pipeline.reset();
|
||||
this.pipeline.add(
|
||||
lunr.da.trimmer,
|
||||
lunr.da.stopWordFilter,
|
||||
lunr.da.stemmer
|
||||
);
|
||||
|
||||
// for lunr version 2
|
||||
// this is necessary so that every searched word is also stemmed before
|
||||
// in lunr <= 1 this is not needed, as it is done using the normal pipeline
|
||||
if (this.searchPipeline) {
|
||||
this.searchPipeline.reset();
|
||||
this.searchPipeline.add(lunr.da.stemmer)
|
||||
}
|
||||
};
|
||||
|
||||
/* lunr trimmer function */
|
||||
lunr.da.wordCharacters = "A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A";
|
||||
lunr.da.trimmer = lunr.trimmerSupport.generateTrimmer(lunr.da.wordCharacters);
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.da.trimmer, 'trimmer-da');
|
||||
|
||||
/* lunr stemmer function */
|
||||
lunr.da.stemmer = (function() {
|
||||
/* create the wrapped stemmer object */
|
||||
var Among = lunr.stemmerSupport.Among,
|
||||
SnowballProgram = lunr.stemmerSupport.SnowballProgram,
|
||||
st = new function DanishStemmer() {
|
||||
var a_0 = [new Among("hed", -1, 1), new Among("ethed", 0, 1),
|
||||
new Among("ered", -1, 1), new Among("e", -1, 1),
|
||||
new Among("erede", 3, 1), new Among("ende", 3, 1),
|
||||
new Among("erende", 5, 1), new Among("ene", 3, 1),
|
||||
new Among("erne", 3, 1), new Among("ere", 3, 1),
|
||||
new Among("en", -1, 1), new Among("heden", 10, 1),
|
||||
new Among("eren", 10, 1), new Among("er", -1, 1),
|
||||
new Among("heder", 13, 1), new Among("erer", 13, 1),
|
||||
new Among("s", -1, 2), new Among("heds", 16, 1),
|
||||
new Among("es", 16, 1), new Among("endes", 18, 1),
|
||||
new Among("erendes", 19, 1), new Among("enes", 18, 1),
|
||||
new Among("ernes", 18, 1), new Among("eres", 18, 1),
|
||||
new Among("ens", 16, 1), new Among("hedens", 24, 1),
|
||||
new Among("erens", 24, 1), new Among("ers", 16, 1),
|
||||
new Among("ets", 16, 1), new Among("erets", 28, 1),
|
||||
new Among("et", -1, 1), new Among("eret", 30, 1)
|
||||
],
|
||||
a_1 = [
|
||||
new Among("gd", -1, -1), new Among("dt", -1, -1),
|
||||
new Among("gt", -1, -1), new Among("kt", -1, -1)
|
||||
],
|
||||
a_2 = [
|
||||
new Among("ig", -1, 1), new Among("lig", 0, 1),
|
||||
new Among("elig", 1, 1), new Among("els", -1, 1),
|
||||
new Among("l\u00F8st", -1, 2)
|
||||
],
|
||||
g_v = [17, 65, 16, 1, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 128
|
||||
],
|
||||
g_s_ending = [239, 254, 42, 3,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16
|
||||
],
|
||||
I_x, I_p1, S_ch, sbp = new SnowballProgram();
|
||||
this.setCurrent = function(word) {
|
||||
sbp.setCurrent(word);
|
||||
};
|
||||
this.getCurrent = function() {
|
||||
return sbp.getCurrent();
|
||||
};
|
||||
|
||||
function r_mark_regions() {
|
||||
var v_1, c = sbp.cursor + 3;
|
||||
I_p1 = sbp.limit;
|
||||
if (0 <= c && c <= sbp.limit) {
|
||||
I_x = c;
|
||||
while (true) {
|
||||
v_1 = sbp.cursor;
|
||||
if (sbp.in_grouping(g_v, 97, 248)) {
|
||||
sbp.cursor = v_1;
|
||||
break;
|
||||
}
|
||||
sbp.cursor = v_1;
|
||||
if (v_1 >= sbp.limit)
|
||||
return;
|
||||
sbp.cursor++;
|
||||
}
|
||||
while (!sbp.out_grouping(g_v, 97, 248)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return;
|
||||
sbp.cursor++;
|
||||
}
|
||||
I_p1 = sbp.cursor;
|
||||
if (I_p1 < I_x)
|
||||
I_p1 = I_x;
|
||||
}
|
||||
}
|
||||
|
||||
function r_main_suffix() {
|
||||
var among_var, v_1;
|
||||
if (sbp.cursor >= I_p1) {
|
||||
v_1 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_p1;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_0, 32);
|
||||
sbp.limit_backward = v_1;
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 2:
|
||||
if (sbp.in_grouping_b(g_s_ending, 97, 229))
|
||||
sbp.slice_del();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_consonant_pair() {
|
||||
var v_1 = sbp.limit - sbp.cursor,
|
||||
v_2;
|
||||
if (sbp.cursor >= I_p1) {
|
||||
v_2 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_p1;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.find_among_b(a_1, 4)) {
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.limit_backward = v_2;
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
if (sbp.cursor > sbp.limit_backward) {
|
||||
sbp.cursor--;
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.slice_del();
|
||||
}
|
||||
} else
|
||||
sbp.limit_backward = v_2;
|
||||
}
|
||||
}
|
||||
|
||||
function r_other_suffix() {
|
||||
var among_var, v_1 = sbp.limit - sbp.cursor,
|
||||
v_2, v_3;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(2, "st")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (sbp.eq_s_b(2, "ig"))
|
||||
sbp.slice_del();
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
if (sbp.cursor >= I_p1) {
|
||||
v_2 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_p1;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_2, 5);
|
||||
sbp.limit_backward = v_2;
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_del();
|
||||
v_3 = sbp.limit - sbp.cursor;
|
||||
r_consonant_pair();
|
||||
sbp.cursor = sbp.limit - v_3;
|
||||
break;
|
||||
case 2:
|
||||
sbp.slice_from("l\u00F8s");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_undouble() {
|
||||
var v_1;
|
||||
if (sbp.cursor >= I_p1) {
|
||||
v_1 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_p1;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.out_grouping_b(g_v, 97, 248)) {
|
||||
sbp.bra = sbp.cursor;
|
||||
S_ch = sbp.slice_to(S_ch);
|
||||
sbp.limit_backward = v_1;
|
||||
if (sbp.eq_v_b(S_ch))
|
||||
sbp.slice_del();
|
||||
} else
|
||||
sbp.limit_backward = v_1;
|
||||
}
|
||||
}
|
||||
this.stem = function() {
|
||||
var v_1 = sbp.cursor;
|
||||
r_mark_regions();
|
||||
sbp.limit_backward = v_1;
|
||||
sbp.cursor = sbp.limit;
|
||||
r_main_suffix();
|
||||
sbp.cursor = sbp.limit;
|
||||
r_consonant_pair();
|
||||
sbp.cursor = sbp.limit;
|
||||
r_other_suffix();
|
||||
sbp.cursor = sbp.limit;
|
||||
r_undouble();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/* and return a function that stems a word for the current locale */
|
||||
return function(token) {
|
||||
// for lunr version 2
|
||||
if (typeof token.update === "function") {
|
||||
return token.update(function(word) {
|
||||
st.setCurrent(word);
|
||||
st.stem();
|
||||
return st.getCurrent();
|
||||
})
|
||||
} else { // for lunr version <= 1
|
||||
st.setCurrent(token);
|
||||
st.stem();
|
||||
return st.getCurrent();
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.da.stemmer, 'stemmer-da');
|
||||
|
||||
lunr.da.stopWordFilter = lunr.generateStopWordFilter('ad af alle alt anden at blev blive bliver da de dem den denne der deres det dette dig din disse dog du efter eller en end er et for fra ham han hans har havde have hende hendes her hos hun hvad hvis hvor i ikke ind jeg jer jo kunne man mange med meget men mig min mine mit mod ned noget nogle nu når og også om op os over på selv sig sin sine sit skal skulle som sådan thi til ud under var vi vil ville vor være været'.split(' '));
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.da.stopWordFilter, 'stopWordFilter-da');
|
||||
};
|
||||
}))
|
||||
@@ -1,384 +0,0 @@
|
||||
/*!
|
||||
* Lunr languages, `German` language
|
||||
* https://github.com/MihaiValentin/lunr-languages
|
||||
*
|
||||
* Copyright 2014, Mihai Valentin
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
/*!
|
||||
* based on
|
||||
* Snowball JavaScript Library v0.3
|
||||
* http://code.google.com/p/urim/
|
||||
* http://snowball.tartarus.org/
|
||||
*
|
||||
* Copyright 2010, Oleg Mazko
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
|
||||
/**
|
||||
* export the module via AMD, CommonJS or as a browser global
|
||||
* Export code from https://github.com/umdjs/umd/blob/master/returnExports.js
|
||||
*/
|
||||
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(factory)
|
||||
} else if (typeof exports === 'object') {
|
||||
/**
|
||||
* Node. Does not work with strict CommonJS, but
|
||||
* only CommonJS-like environments that support module.exports,
|
||||
* like Node.
|
||||
*/
|
||||
module.exports = factory()
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
factory()(root.lunr);
|
||||
}
|
||||
}(this, function() {
|
||||
/**
|
||||
* Just return a value to define the module export.
|
||||
* This example returns an object, but the module
|
||||
* can return a function as the exported value.
|
||||
*/
|
||||
return function(lunr) {
|
||||
/* throw error if lunr is not yet included */
|
||||
if ('undefined' === typeof lunr) {
|
||||
throw new Error('Lunr is not present. Please include / require Lunr before this script.');
|
||||
}
|
||||
|
||||
/* throw error if lunr stemmer support is not yet included */
|
||||
if ('undefined' === typeof lunr.stemmerSupport) {
|
||||
throw new Error('Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.');
|
||||
}
|
||||
|
||||
/* register specific locale function */
|
||||
lunr.de = function() {
|
||||
this.pipeline.reset();
|
||||
this.pipeline.add(
|
||||
lunr.de.trimmer,
|
||||
lunr.de.stopWordFilter,
|
||||
lunr.de.stemmer
|
||||
);
|
||||
|
||||
// for lunr version 2
|
||||
// this is necessary so that every searched word is also stemmed before
|
||||
// in lunr <= 1 this is not needed, as it is done using the normal pipeline
|
||||
if (this.searchPipeline) {
|
||||
this.searchPipeline.reset();
|
||||
this.searchPipeline.add(lunr.de.stemmer)
|
||||
}
|
||||
};
|
||||
|
||||
/* lunr trimmer function */
|
||||
lunr.de.wordCharacters = "A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A";
|
||||
lunr.de.trimmer = lunr.trimmerSupport.generateTrimmer(lunr.de.wordCharacters);
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.de.trimmer, 'trimmer-de');
|
||||
|
||||
/* lunr stemmer function */
|
||||
lunr.de.stemmer = (function() {
|
||||
/* create the wrapped stemmer object */
|
||||
var Among = lunr.stemmerSupport.Among,
|
||||
SnowballProgram = lunr.stemmerSupport.SnowballProgram,
|
||||
st = new function GermanStemmer() {
|
||||
var a_0 = [new Among("", -1, 6), new Among("U", 0, 2),
|
||||
new Among("Y", 0, 1), new Among("\u00E4", 0, 3),
|
||||
new Among("\u00F6", 0, 4), new Among("\u00FC", 0, 5)
|
||||
],
|
||||
a_1 = [
|
||||
new Among("e", -1, 2), new Among("em", -1, 1),
|
||||
new Among("en", -1, 2), new Among("ern", -1, 1),
|
||||
new Among("er", -1, 1), new Among("s", -1, 3),
|
||||
new Among("es", 5, 2)
|
||||
],
|
||||
a_2 = [new Among("en", -1, 1),
|
||||
new Among("er", -1, 1), new Among("st", -1, 2),
|
||||
new Among("est", 2, 1)
|
||||
],
|
||||
a_3 = [new Among("ig", -1, 1),
|
||||
new Among("lich", -1, 1)
|
||||
],
|
||||
a_4 = [new Among("end", -1, 1),
|
||||
new Among("ig", -1, 2), new Among("ung", -1, 1),
|
||||
new Among("lich", -1, 3), new Among("isch", -1, 2),
|
||||
new Among("ik", -1, 2), new Among("heit", -1, 3),
|
||||
new Among("keit", -1, 4)
|
||||
],
|
||||
g_v = [17, 65, 16, 1, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 8, 0, 32, 8
|
||||
],
|
||||
g_s_ending = [117, 30, 5],
|
||||
g_st_ending = [
|
||||
117, 30, 4
|
||||
],
|
||||
I_x, I_p2, I_p1, sbp = new SnowballProgram();
|
||||
this.setCurrent = function(word) {
|
||||
sbp.setCurrent(word);
|
||||
};
|
||||
this.getCurrent = function() {
|
||||
return sbp.getCurrent();
|
||||
};
|
||||
|
||||
function habr1(c1, c2, v_1) {
|
||||
if (sbp.eq_s(1, c1)) {
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.in_grouping(g_v, 97, 252)) {
|
||||
sbp.slice_from(c2);
|
||||
sbp.cursor = v_1;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function r_prelude() {
|
||||
var v_1 = sbp.cursor,
|
||||
v_2, v_3, v_4, v_5;
|
||||
while (true) {
|
||||
v_2 = sbp.cursor;
|
||||
sbp.bra = v_2;
|
||||
if (sbp.eq_s(1, "\u00DF")) {
|
||||
sbp.ket = sbp.cursor;
|
||||
sbp.slice_from("ss");
|
||||
} else {
|
||||
if (v_2 >= sbp.limit)
|
||||
break;
|
||||
sbp.cursor = v_2 + 1;
|
||||
}
|
||||
}
|
||||
sbp.cursor = v_1;
|
||||
while (true) {
|
||||
v_3 = sbp.cursor;
|
||||
while (true) {
|
||||
v_4 = sbp.cursor;
|
||||
if (sbp.in_grouping(g_v, 97, 252)) {
|
||||
v_5 = sbp.cursor;
|
||||
sbp.bra = v_5;
|
||||
if (habr1("u", "U", v_4))
|
||||
break;
|
||||
sbp.cursor = v_5;
|
||||
if (habr1("y", "Y", v_4))
|
||||
break;
|
||||
}
|
||||
if (v_4 >= sbp.limit) {
|
||||
sbp.cursor = v_3;
|
||||
return;
|
||||
}
|
||||
sbp.cursor = v_4 + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function habr2() {
|
||||
while (!sbp.in_grouping(g_v, 97, 252)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return true;
|
||||
sbp.cursor++;
|
||||
}
|
||||
while (!sbp.out_grouping(g_v, 97, 252)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return true;
|
||||
sbp.cursor++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function r_mark_regions() {
|
||||
I_p1 = sbp.limit;
|
||||
I_p2 = I_p1;
|
||||
var c = sbp.cursor + 3;
|
||||
if (0 <= c && c <= sbp.limit) {
|
||||
I_x = c;
|
||||
if (!habr2()) {
|
||||
I_p1 = sbp.cursor;
|
||||
if (I_p1 < I_x)
|
||||
I_p1 = I_x;
|
||||
if (!habr2())
|
||||
I_p2 = sbp.cursor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_postlude() {
|
||||
var among_var, v_1;
|
||||
while (true) {
|
||||
v_1 = sbp.cursor;
|
||||
sbp.bra = v_1;
|
||||
among_var = sbp.find_among(a_0, 6);
|
||||
if (!among_var)
|
||||
return;
|
||||
sbp.ket = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_from("y");
|
||||
break;
|
||||
case 2:
|
||||
case 5:
|
||||
sbp.slice_from("u");
|
||||
break;
|
||||
case 3:
|
||||
sbp.slice_from("a");
|
||||
break;
|
||||
case 4:
|
||||
sbp.slice_from("o");
|
||||
break;
|
||||
case 6:
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return;
|
||||
sbp.cursor++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_R1() {
|
||||
return I_p1 <= sbp.cursor;
|
||||
}
|
||||
|
||||
function r_R2() {
|
||||
return I_p2 <= sbp.cursor;
|
||||
}
|
||||
|
||||
function r_standard_suffix() {
|
||||
var among_var, v_1 = sbp.limit - sbp.cursor,
|
||||
v_2, v_3, v_4;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_1, 7);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R1()) {
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 2:
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(1, "s")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (sbp.eq_s_b(3, "nis"))
|
||||
sbp.slice_del();
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (sbp.in_grouping_b(g_s_ending, 98, 116))
|
||||
sbp.slice_del();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_2, 4);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R1()) {
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 2:
|
||||
if (sbp.in_grouping_b(g_st_ending, 98, 116)) {
|
||||
var c = sbp.cursor - 3;
|
||||
if (sbp.limit_backward <= c && c <= sbp.limit) {
|
||||
sbp.cursor = c;
|
||||
sbp.slice_del();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_4, 8);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R2()) {
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(2, "ig")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
v_2 = sbp.limit - sbp.cursor;
|
||||
if (!sbp.eq_s_b(1, "e")) {
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
if (r_R2())
|
||||
sbp.slice_del();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
v_3 = sbp.limit - sbp.cursor;
|
||||
if (!sbp.eq_s_b(1, "e")) {
|
||||
sbp.cursor = sbp.limit - v_3;
|
||||
sbp.slice_del();
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
v_4 = sbp.limit - sbp.cursor;
|
||||
if (!sbp.eq_s_b(2, "er")) {
|
||||
sbp.cursor = sbp.limit - v_4;
|
||||
if (!sbp.eq_s_b(2, "en"))
|
||||
break;
|
||||
}
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R1())
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 4:
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_3, 2);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R2() && among_var == 1)
|
||||
sbp.slice_del();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.stem = function() {
|
||||
var v_1 = sbp.cursor;
|
||||
r_prelude();
|
||||
sbp.cursor = v_1;
|
||||
r_mark_regions();
|
||||
sbp.limit_backward = v_1;
|
||||
sbp.cursor = sbp.limit;
|
||||
r_standard_suffix();
|
||||
sbp.cursor = sbp.limit_backward;
|
||||
r_postlude();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/* and return a function that stems a word for the current locale */
|
||||
return function(token) {
|
||||
// for lunr version 2
|
||||
if (typeof token.update === "function") {
|
||||
return token.update(function(word) {
|
||||
st.setCurrent(word);
|
||||
st.stem();
|
||||
return st.getCurrent();
|
||||
})
|
||||
} else { // for lunr version <= 1
|
||||
st.setCurrent(token);
|
||||
st.stem();
|
||||
return st.getCurrent();
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.de.stemmer, 'stemmer-de');
|
||||
|
||||
lunr.de.stopWordFilter = lunr.generateStopWordFilter('aber alle allem allen aller alles als also am an ander andere anderem anderen anderer anderes anderm andern anderr anders auch auf aus bei bin bis bist da damit dann das dasselbe dazu daß dein deine deinem deinen deiner deines dem demselben den denn denselben der derer derselbe derselben des desselben dessen dich die dies diese dieselbe dieselben diesem diesen dieser dieses dir doch dort du durch ein eine einem einen einer eines einig einige einigem einigen einiger einiges einmal er es etwas euch euer eure eurem euren eurer eures für gegen gewesen hab habe haben hat hatte hatten hier hin hinter ich ihm ihn ihnen ihr ihre ihrem ihren ihrer ihres im in indem ins ist jede jedem jeden jeder jedes jene jenem jenen jener jenes jetzt kann kein keine keinem keinen keiner keines können könnte machen man manche manchem manchen mancher manches mein meine meinem meinen meiner meines mich mir mit muss musste nach nicht nichts noch nun nur ob oder ohne sehr sein seine seinem seinen seiner seines selbst sich sie sind so solche solchem solchen solcher solches soll sollte sondern sonst um und uns unse unsem unsen unser unses unter viel vom von vor war waren warst was weg weil weiter welche welchem welchen welcher welches wenn werde werden wie wieder will wir wird wirst wo wollen wollte während würde würden zu zum zur zwar zwischen über'.split(' '));
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.de.stopWordFilter, 'stopWordFilter-de');
|
||||
};
|
||||
}))
|
||||
@@ -1,450 +0,0 @@
|
||||
/*!
|
||||
* Lunr languages, `Dutch` language
|
||||
* https://github.com/MihaiValentin/lunr-languages
|
||||
*
|
||||
* Copyright 2014, Mihai Valentin
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
/*!
|
||||
* based on
|
||||
* Snowball JavaScript Library v0.3
|
||||
* http://code.google.com/p/urim/
|
||||
* http://snowball.tartarus.org/
|
||||
*
|
||||
* Copyright 2010, Oleg Mazko
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
|
||||
/**
|
||||
* export the module via AMD, CommonJS or as a browser global
|
||||
* Export code from https://github.com/umdjs/umd/blob/master/returnExports.js
|
||||
*/
|
||||
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(factory)
|
||||
} else if (typeof exports === 'object') {
|
||||
/**
|
||||
* Node. Does not work with strict CommonJS, but
|
||||
* only CommonJS-like environments that support module.exports,
|
||||
* like Node.
|
||||
*/
|
||||
module.exports = factory()
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
factory()(root.lunr);
|
||||
}
|
||||
}(this, function() {
|
||||
/**
|
||||
* Just return a value to define the module export.
|
||||
* This example returns an object, but the module
|
||||
* can return a function as the exported value.
|
||||
*/
|
||||
return function(lunr) {
|
||||
/* throw error if lunr is not yet included */
|
||||
if ('undefined' === typeof lunr) {
|
||||
throw new Error('Lunr is not present. Please include / require Lunr before this script.');
|
||||
}
|
||||
|
||||
/* throw error if lunr stemmer support is not yet included */
|
||||
if ('undefined' === typeof lunr.stemmerSupport) {
|
||||
throw new Error('Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.');
|
||||
}
|
||||
|
||||
console.warn("[Lunr Languages] Please use the \"nl\" instead of the \"du\". The \"nl\" code is the standard code for Dutch language, and \"du\" will be removed in the next major versions.");
|
||||
|
||||
/* register specific locale function */
|
||||
lunr.du = function() {
|
||||
this.pipeline.reset();
|
||||
this.pipeline.add(
|
||||
lunr.du.trimmer,
|
||||
lunr.du.stopWordFilter,
|
||||
lunr.du.stemmer
|
||||
);
|
||||
|
||||
// for lunr version 2
|
||||
// this is necessary so that every searched word is also stemmed before
|
||||
// in lunr <= 1 this is not needed, as it is done using the normal pipeline
|
||||
if (this.searchPipeline) {
|
||||
this.searchPipeline.reset();
|
||||
this.searchPipeline.add(lunr.du.stemmer)
|
||||
}
|
||||
};
|
||||
|
||||
/* lunr trimmer function */
|
||||
lunr.du.wordCharacters = "A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A";
|
||||
lunr.du.trimmer = lunr.trimmerSupport.generateTrimmer(lunr.du.wordCharacters);
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.du.trimmer, 'trimmer-du');
|
||||
|
||||
/* lunr stemmer function */
|
||||
lunr.du.stemmer = (function() {
|
||||
/* create the wrapped stemmer object */
|
||||
var Among = lunr.stemmerSupport.Among,
|
||||
SnowballProgram = lunr.stemmerSupport.SnowballProgram,
|
||||
st = new function DutchStemmer() {
|
||||
var a_0 = [new Among("", -1, 6), new Among("\u00E1", 0, 1),
|
||||
new Among("\u00E4", 0, 1), new Among("\u00E9", 0, 2),
|
||||
new Among("\u00EB", 0, 2), new Among("\u00ED", 0, 3),
|
||||
new Among("\u00EF", 0, 3), new Among("\u00F3", 0, 4),
|
||||
new Among("\u00F6", 0, 4), new Among("\u00FA", 0, 5),
|
||||
new Among("\u00FC", 0, 5)
|
||||
],
|
||||
a_1 = [new Among("", -1, 3),
|
||||
new Among("I", 0, 2), new Among("Y", 0, 1)
|
||||
],
|
||||
a_2 = [
|
||||
new Among("dd", -1, -1), new Among("kk", -1, -1),
|
||||
new Among("tt", -1, -1)
|
||||
],
|
||||
a_3 = [new Among("ene", -1, 2),
|
||||
new Among("se", -1, 3), new Among("en", -1, 2),
|
||||
new Among("heden", 2, 1), new Among("s", -1, 3)
|
||||
],
|
||||
a_4 = [
|
||||
new Among("end", -1, 1), new Among("ig", -1, 2),
|
||||
new Among("ing", -1, 1), new Among("lijk", -1, 3),
|
||||
new Among("baar", -1, 4), new Among("bar", -1, 5)
|
||||
],
|
||||
a_5 = [
|
||||
new Among("aa", -1, -1), new Among("ee", -1, -1),
|
||||
new Among("oo", -1, -1), new Among("uu", -1, -1)
|
||||
],
|
||||
g_v = [17, 65,
|
||||
16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128
|
||||
],
|
||||
g_v_I = [1, 0, 0,
|
||||
17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128
|
||||
],
|
||||
g_v_j = [
|
||||
17, 67, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128
|
||||
],
|
||||
I_p2, I_p1, B_e_found, sbp = new SnowballProgram();
|
||||
this.setCurrent = function(word) {
|
||||
sbp.setCurrent(word);
|
||||
};
|
||||
this.getCurrent = function() {
|
||||
return sbp.getCurrent();
|
||||
};
|
||||
|
||||
function r_prelude() {
|
||||
var among_var, v_1 = sbp.cursor,
|
||||
v_2, v_3;
|
||||
while (true) {
|
||||
sbp.bra = sbp.cursor;
|
||||
among_var = sbp.find_among(a_0, 11);
|
||||
if (among_var) {
|
||||
sbp.ket = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_from("a");
|
||||
continue;
|
||||
case 2:
|
||||
sbp.slice_from("e");
|
||||
continue;
|
||||
case 3:
|
||||
sbp.slice_from("i");
|
||||
continue;
|
||||
case 4:
|
||||
sbp.slice_from("o");
|
||||
continue;
|
||||
case 5:
|
||||
sbp.slice_from("u");
|
||||
continue;
|
||||
case 6:
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
break;
|
||||
sbp.cursor++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
sbp.cursor = v_1;
|
||||
sbp.bra = v_1;
|
||||
if (sbp.eq_s(1, "y")) {
|
||||
sbp.ket = sbp.cursor;
|
||||
sbp.slice_from("Y");
|
||||
} else
|
||||
sbp.cursor = v_1;
|
||||
while (true) {
|
||||
v_2 = sbp.cursor;
|
||||
if (sbp.in_grouping(g_v, 97, 232)) {
|
||||
v_3 = sbp.cursor;
|
||||
sbp.bra = v_3;
|
||||
if (sbp.eq_s(1, "i")) {
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.in_grouping(g_v, 97, 232)) {
|
||||
sbp.slice_from("I");
|
||||
sbp.cursor = v_2;
|
||||
}
|
||||
} else {
|
||||
sbp.cursor = v_3;
|
||||
if (sbp.eq_s(1, "y")) {
|
||||
sbp.ket = sbp.cursor;
|
||||
sbp.slice_from("Y");
|
||||
sbp.cursor = v_2;
|
||||
} else if (habr1(v_2))
|
||||
break;
|
||||
}
|
||||
} else if (habr1(v_2))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function habr1(v_1) {
|
||||
sbp.cursor = v_1;
|
||||
if (v_1 >= sbp.limit)
|
||||
return true;
|
||||
sbp.cursor++;
|
||||
return false;
|
||||
}
|
||||
|
||||
function r_mark_regions() {
|
||||
I_p1 = sbp.limit;
|
||||
I_p2 = I_p1;
|
||||
if (!habr2()) {
|
||||
I_p1 = sbp.cursor;
|
||||
if (I_p1 < 3)
|
||||
I_p1 = 3;
|
||||
if (!habr2())
|
||||
I_p2 = sbp.cursor;
|
||||
}
|
||||
}
|
||||
|
||||
function habr2() {
|
||||
while (!sbp.in_grouping(g_v, 97, 232)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return true;
|
||||
sbp.cursor++;
|
||||
}
|
||||
while (!sbp.out_grouping(g_v, 97, 232)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return true;
|
||||
sbp.cursor++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function r_postlude() {
|
||||
var among_var;
|
||||
while (true) {
|
||||
sbp.bra = sbp.cursor;
|
||||
among_var = sbp.find_among(a_1, 3);
|
||||
if (among_var) {
|
||||
sbp.ket = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_from("y");
|
||||
break;
|
||||
case 2:
|
||||
sbp.slice_from("i");
|
||||
break;
|
||||
case 3:
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return;
|
||||
sbp.cursor++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_R1() {
|
||||
return I_p1 <= sbp.cursor;
|
||||
}
|
||||
|
||||
function r_R2() {
|
||||
return I_p2 <= sbp.cursor;
|
||||
}
|
||||
|
||||
function r_undouble() {
|
||||
var v_1 = sbp.limit - sbp.cursor;
|
||||
if (sbp.find_among_b(a_2, 3)) {
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.cursor > sbp.limit_backward) {
|
||||
sbp.cursor--;
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.slice_del();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_e_ending() {
|
||||
var v_1;
|
||||
B_e_found = false;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(1, "e")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R1()) {
|
||||
v_1 = sbp.limit - sbp.cursor;
|
||||
if (sbp.out_grouping_b(g_v, 97, 232)) {
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
sbp.slice_del();
|
||||
B_e_found = true;
|
||||
r_undouble();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_en_ending() {
|
||||
var v_1;
|
||||
if (r_R1()) {
|
||||
v_1 = sbp.limit - sbp.cursor;
|
||||
if (sbp.out_grouping_b(g_v, 97, 232)) {
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
if (!sbp.eq_s_b(3, "gem")) {
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
sbp.slice_del();
|
||||
r_undouble();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_standard_suffix() {
|
||||
var among_var, v_1 = sbp.limit - sbp.cursor,
|
||||
v_2, v_3, v_4, v_5, v_6;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_3, 5);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
if (r_R1())
|
||||
sbp.slice_from("heid");
|
||||
break;
|
||||
case 2:
|
||||
r_en_ending();
|
||||
break;
|
||||
case 3:
|
||||
if (r_R1() && sbp.out_grouping_b(g_v_j, 97, 232))
|
||||
sbp.slice_del();
|
||||
break;
|
||||
}
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
r_e_ending();
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(4, "heid")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R2()) {
|
||||
v_2 = sbp.limit - sbp.cursor;
|
||||
if (!sbp.eq_s_b(1, "c")) {
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(2, "en")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
r_en_ending();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_4, 6);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
if (r_R2()) {
|
||||
sbp.slice_del();
|
||||
v_3 = sbp.limit - sbp.cursor;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(2, "ig")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R2()) {
|
||||
v_4 = sbp.limit - sbp.cursor;
|
||||
if (!sbp.eq_s_b(1, "e")) {
|
||||
sbp.cursor = sbp.limit - v_4;
|
||||
sbp.slice_del();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_3;
|
||||
r_undouble();
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (r_R2()) {
|
||||
v_5 = sbp.limit - sbp.cursor;
|
||||
if (!sbp.eq_s_b(1, "e")) {
|
||||
sbp.cursor = sbp.limit - v_5;
|
||||
sbp.slice_del();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (r_R2()) {
|
||||
sbp.slice_del();
|
||||
r_e_ending();
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (r_R2())
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 5:
|
||||
if (r_R2() && B_e_found)
|
||||
sbp.slice_del();
|
||||
break;
|
||||
}
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
if (sbp.out_grouping_b(g_v_I, 73, 232)) {
|
||||
v_6 = sbp.limit - sbp.cursor;
|
||||
if (sbp.find_among_b(a_5, 4) && sbp.out_grouping_b(g_v, 97, 232)) {
|
||||
sbp.cursor = sbp.limit - v_6;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.cursor > sbp.limit_backward) {
|
||||
sbp.cursor--;
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.slice_del();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.stem = function() {
|
||||
var v_1 = sbp.cursor;
|
||||
r_prelude();
|
||||
sbp.cursor = v_1;
|
||||
r_mark_regions();
|
||||
sbp.limit_backward = v_1;
|
||||
sbp.cursor = sbp.limit;
|
||||
r_standard_suffix();
|
||||
sbp.cursor = sbp.limit_backward;
|
||||
r_postlude();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/* and return a function that stems a word for the current locale */
|
||||
return function(token) {
|
||||
// for lunr version 2
|
||||
if (typeof token.update === "function") {
|
||||
return token.update(function(word) {
|
||||
st.setCurrent(word);
|
||||
st.stem();
|
||||
return st.getCurrent();
|
||||
})
|
||||
} else { // for lunr version <= 1
|
||||
st.setCurrent(token);
|
||||
st.stem();
|
||||
return st.getCurrent();
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.du.stemmer, 'stemmer-du');
|
||||
|
||||
lunr.du.stopWordFilter = lunr.generateStopWordFilter(' aan al alles als altijd andere ben bij daar dan dat de der deze die dit doch doen door dus een eens en er ge geen geweest haar had heb hebben heeft hem het hier hij hoe hun iemand iets ik in is ja je kan kon kunnen maar me meer men met mij mijn moet na naar niet niets nog nu of om omdat onder ons ook op over reeds te tegen toch toen tot u uit uw van veel voor want waren was wat werd wezen wie wil worden wordt zal ze zelf zich zij zijn zo zonder zou'.split(' '));
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.du.stopWordFilter, 'stopWordFilter-du');
|
||||
};
|
||||
}))
|
||||