Shoka Configuration Backup

Published 2026-03-20 07:20 1527 words 8 min read

Shoka Configuration Backup

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

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:

  1. Use the links tag block to wrap content written in yml syntax. The fields include:
siteSite nameRequired
ownerAdmin nameOptional, defaults to the value of site
urlSite linkRequired
desccateCards: - slug: Study cover: Study/cover.jpg - slug: Life cover: Life/cover.jpgymlOptional, defaults to the value of url
imageSite imageOptional, defaults to images/404.png
colorBlock colorOptional, 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:

  1. The content in the above tag blocks can also be saved to a yml file, and then use the linksfile tag. Here, path is located in the <root>/source directory.

{​% 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]

OptionDescriptionDefault
languageClick 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 shownnull
titleThe title text of the code blocknull
urlThe link displayed on the right side of the code block titlenull
link textThe title displayed for the above linklink
markLine highlighting, format is mark:行号,行号开始-行号结束,其他行号. For example, mark:1,4-7,10 will highlight lines 1, 4, 5, 6, 7, and 10null
commandCommand-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 push

quiz 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: E=mc2E = mc^2

Block formula:

∫−∞∞e−x2dx=π\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi} ∑n=1∞1n2=π26\sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{6}
:::default
默认默认
:::
:::primary
基本基本
:::
:::info
提示提示
:::
:::success
成功成功
:::
:::warning
警告警告
:::
:::danger
危险危险
:::
:::danger no-icon
危险危险
:::

If you enjoyed this, leave a comment~

... Page views
© 2021 - 2026 Vullfin @VV
Powered by theme astro-koharu · Inspired by Shoka