Since the shoka sister site fell into a loading infinite loop, this is a backup of the Shoka configuration guide
Basic Configuration
xxxxxxxxxx // hexo-safago Waline comment section link handling - inline script script. (function() { // Read the whitelist from the configuration var whitelist = !{JSON.stringify(config.hexo_safego.whitelist.domain_whitelist)}; function isInWhitelist(url) { return whitelist.some(function(domain) { return url.indexOf(domain) !== -1; }); } function convertLink(link) { var href = link.getAttribute('href'); if (!href || href.startsWith('/') || href.startsWith('mailto:') || href.startsWith('tel:')) { return; } // Check the whitelist if (isInWhitelist(href)) { return; } if (link.dataset.safagoProcessed) { return; } try { var encodedUrl = btoa(href); var newHref = '/go.html?u=' + encodedUrl; link.setAttribute('href', newHref); link.setAttribute('target', '_blank'); link.dataset.safagoProcessed = 'true'; } catch(e) { console.error('[safago-inline] Error:', e); } } function processWalineLinks() { var links = document.querySelectorAll('.wl-nick a[href], .wl-card a[href]'); links.forEach(convertLink); } // Initial processing if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', processWalineLinks); } else { processWalineLinks(); } // Delayed processing (fallback) setTimeout(processWalineLinks, 2000); // Event delegation: convert the link when it is clicked (most important) document.addEventListener('click', function(e) { var link = e.target.closest('a[href]'); if (link && (link.classList.contains('wl-nick') || link.closest('.wl-card'))) { convertLink(link); } }, true); // PJAX support document.addEventListener('pjax', processWalineLinks); })();pug
Special Features
links Link Block
This feature references NexT and, based on Hexo's Tag feature, is used to create friend links or other website link features.
Usage format in articles:
- Use the
linkstag block to wrap content written inymlsyntax. The fields include:
site | Site name | Required |
|---|---|---|
owner | Admin name | Optional, defaults to the value of site |
url | Site link | Required |
desc | cateCards: - slug: Study cover: Study/cover.jpg - slug: Life cover: Life/cover.jpgyml | Optional, defaults to the value of url |
image | Site image | Optional, defaults to images/404.png |
color | Block color | Optional, defaults to #666 |
{% links %}
- site: # Site name
owner: # Admin name
url: # Site URL
desc: # Short description
image: # An image
color: # Color code
{% endlinks %}
For example:
{% links %}
- site: 个人首页
owner: RPWN
desc: SHARED BY Vullfin
url: https://nav.vull.top/
image: assets/nav.png
color: "#7ab8ba"
- site: 赞赏主页
owner: RPWN
url: https://sponsor.vull.top/
desc: SHARED BY Vullfin
image: assets/milk.png
color: "#e9bcc1"
- site: 吃啥好呢?
owner: RPWN
url: https://eat.vull.top/
desc: SHARED BY Vullfin
image: assets/eat.png
color: "#FA8072"
- site: 个人主页
owner: RPWN
url: https://vull.top/
desc: SHARED BY Vullfin
image: assets/home.png
color: "#6097b3"
{% endlinks %}Effect:
- The content in the above tag blocks can also be saved to a
ymlfile, and then use thelinksfiletag. Here,pathis located in the<root>/sourcedirectory.
{% linksfile [path] %}
For example:
{% linksfile friends/_data.yml %}
code Code Block
Use markdown-it-prism for code highlighting, which supports displaying line numbers, line highlighting mark, command-line prompts command, and code block titles.
Basic format: [language] [title] [url] [link text] [mark] [command]
| Option | Description | Default |
|---|---|---|
| language | Click here for supported languages. If you don't need code highlighting but want to show the code block style, set it to raw. Leave it empty or set it to info, and neither code highlighting nor the code block style will be shown | null |
| title | The title text of the code block | null |
| url | The link displayed on the right side of the code block title | null |
| link text | The title displayed for the above link | link |
| mark | Line highlighting, format is mark:行号,行号开始-行号结束,其他行号. For example, mark:1,4-7,10 will highlight lines 1, 4, 5, 6, 7, and 10 | null |
| command | Command-line prompt, format is `command:("提示内容",行号 |
```java 行高亮 https://shoka.lostyu.me 参考链接 mark:1,6-7
import java.util.Scanner;
...
Scanner in = new Scanner (System.in);
// After entering Scan, press the keyboard Alt + "/" key, and Eclipse will auto-complete.
System.out.println (in.nextLine ());
System.out.println ("Hello" + "world.");
```
```bash 命令行提示符 command:("[root@localhost] $":1,9-10||"[admin@remotehost] #":4-6)
pwd
/usr/home/chris/bin
ls -la
total 2
drwxr-xr-x 2 chris chris 11 Jan 10 16:48 .
drwxr--r-x 45 chris chris 92 Feb 14 11:10 ..
-rwxr-xr-x 1 chris chris 444 Aug 25 2013 backup
-rwxr-xr-x 1 chris chris 642 Jan 17 14:42 deploy
git add -A
git commit -m "update"
git push
```import java.util.Scanner;
...
Scanner in = new Scanner (System.in);
// After entering Scan, press the keyboard Alt + "/" key, and Eclipse will auto-complete.
System.out.println (in.nextLine ());
System.out.println ("Hello" + "world.");
pwd
/usr/home/chris/bin
ls -la
total 2
drwxr-xr-x 2 chris chris 11 Jan 10 16:48 .
drwxr--r-x 45 chris chris 92 Feb 14 11:10 ..
-rwxr-xr-x 1 chris chris 444 Aug 25 2013 backup
-rwxr-xr-x 1 chris chris 642 Jan 17 14:42 deploy
git add -A
git commit -m "update"
git pushquiz Practice Questions and Answers
This feature is used to display practice questions.
You need to add quiz: true in the Front Matter to correctly display the question type labels.
---
title: 练习题与答案
quiz: true
---
1. 编译时多态主要指运算符重载与函数重载,而运行时多态主要指虚函数。 {.quiz .true}
2. 有基类 `SHAPE`,派生类 `CIRCLE`,声明如下变量: {.quiz .multi}
```cpp
SHAPE shape1,*p1;
CIRCLE circle1,*q1;plain 下列哪些项是 “派生类对象替换基类对象”。
- p1=&circle1; {.correct}
- q1=&shape1;
- shape1=circle1; {.correct}
- circle1=shape1;
{.options}
> - :heavy_check_mark: 令基类对象的指针指向派生类对象
> - :x: 派生类指针指向基类的引用
> - :heavy_check_mark: 派生类对象给基类对象赋值
> - :x: 基类对象给派生类对象赋值
> {.options}
3. 下列叙述正确的是 。 {.quiz}
- 虚函数只能定义成无参函数
- 虚函数不能有返回值
- 能定义虚构造函数
- A、B、C 都不对 {.correct}
{.options}
---
title: Practice Questions and Answers
quiz: true
---
1. Compile-time polymorphism mainly refers to operator overloading and function overloading, while runtime polymorphism mainly refers to virtual functions. {.quiz .true}
2. There is a base class `SHAPE` and a derived class `CIRCLE`. Declare the following variables: {.quiz .multi}
```cpp
SHAPE shape1,*p1;
CIRCLE circle1,*q1;plain Which of the following are “derived class objects replacing base class objects”.
- p1=&circle1; {.correct}
- q1=&shape1;
- shape1=circle1; {.correct}
- circle1=shape1;
{.options}
> - :heavy_check_mark: Let a base class object's pointer point to a derived class object
> - :x: A derived class pointer pointing to a reference of the base class
> - :heavy_check_mark: Assigning a derived class object to a base class object
> - :x: Assigning a base class object to a derived class object
> {.options}
3. Which of the following statements is correct ? {.quiz}
- Virtual functions can only be defined as parameterless functions
- Virtual functions cannot have return values
- Virtual constructors can be defined
- None of A, B, or C is correct {.correct}
{.options}
Inline formula:
Block formula:
:::default
默认默认
:::
:::primary
基本基本
:::
:::info
提示提示
:::
:::success
成功成功
:::
:::warning
警告警告
:::
:::danger
危险危险
:::
:::danger no-icon
危险危险
:::




If you enjoyed this, leave a comment~