简介

高亮方案

本主题没有使用自定义高亮方式,高亮方案在Hexo本身支持的 highlightjsprismjs 基础上修改得到

使用highlightjs

highlight:
  enable: true
  line_number: false
  auto_detect: false
  tab_replace: ''
  wrap: true
  hljs: true
prismjs:
  enable: false
  ...

highlightprismjsenable: true 只能保留一个

在站点配置文件将 highlight 设置 enable: true 即可开启,line_number 选项本主题暂不支持显示

若需要支持代码高亮可设置 hljs: true,该配色方案参考了 tomorrow night 等配色主题

其他具体参数设置可参考 Hexo相关文档

使用prismjs

prismjs 中设置 enable: truepreprocess: true 即可开启 默认支持 Line NumbersShow Languages 两个插件 如果需要其他插件支持可以设置 preprocess: false

当前主题版本不支持 preprocess: false 自动引入相关文件 如有相关需求请自行引入相关 css 与 js 文件

设置 line_number: true 即可显示行号

演示

以下演示采用 prismhighlight 在主题效果可参见(TODO)

有八种高亮主题可选择

Javascript

const smoothScrollToTop = () => {
  let yTopValve = (window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop);
  if (yTopValve > 1) {
    window.requestAnimationFrame(smoothScrollToTop);
    scrollTo(0, Math.floor(yTopValve * 0.85));
  } else {
    scrollTo(0, 0);
  }
};

setTimeout(() => {
  document.getElementById('scrollbutton').onclick = smoothScrollToTop;
}, 0);

C++

#include<cstdio>
#include<iostream>
#include<algorithm>
const int maxn=1050;
const int maxm=20000010;
int h,n,v[maxn],w[maxn],f[maxm],maxx;
int main()
{
	cin>>h>>n;
	memset(f,0x3f,sizeof(f));
	f[0]=0;
	for(int i=1;i<=n;i++) cin>>v[i]>>w[i],maxx=max(v[i],maxx);
	for(int i=1;i<=n;i++)
	{
		for(int j=v[i];j<=h+maxx;j++)
			f[j]=min(f[j],f[j-v[i]]+w[i]);
	}
	int ans=inf;
	for(int i=h;i<=h+maxx;i++) ans=min(ans,f[i]);
	cout<<ans<<endl;
	return 0;
}

PHP

<?php
error_reporting(0);
if(!isset($_GET['num'])){
    show_source(__FILE__);
}else{
        $str = $_GET['num'];
        $blacklist = [' ', '\t', '\r', '\n','\'', '"', '`', '\[', '\]','\$','\\','\^'];
        foreach ($blacklist as $blackitem) {
                if (preg_match('/' . $blackitem . '/m', $str)) {
                        die("what are you want to do?");
                }
        }
        eval('echo '.$str.';');
}
?>

JSON

{
  "name": "hexo-theme-kaze",
  "description": "hexo-theme-kaze",
  "author": "theme-kaze",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/theme-kaze/hexo-theme-Kaze/issues"
  },
  "homepage": "https://github.com/theme-kaze/hexo-theme-Kaze#readme"
}

Python

import requests
import re
import sys
import os
url = 'https://twoshot.hgame.n3ko.co/'
headers = {
    'Content-Type': 'application/x-www-form-urlencoded',
    'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36',
}
p = requests.get(url+'random.php?times=228', headers=headers)
randnum = re.findall(r'\d*', p.text)[1:-2:2]
firstnum = randnum[0]
lastnum = randnum[227]
content = os.popen("python3 ./reverse_mt_rand.py " +
                   firstnum+' '+lastnum+' 0 0').read()
q = requests.post(url+'/verify.php', headers=headers, data={'ans': content})
print(q.text)

Go

// backup my secret key into DB
_, err = db.Exec(fmt.Sprintf(`INSERT INTO secret(secret) VALUES('%s');`, secretKey))
if err != nil {
    return err
}

if u.TotalBalance > 999999 || win {
    flag = os.Getenv("flag")
} else {
    flag = "nothing to show, to be a winner"
}