Skip to content

Commit

Permalink
Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
zkz098 committed Mar 16, 2023
1 parent ddade0f commit 143e957
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 23 deletions.
9 changes: 3 additions & 6 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,14 @@ iconfont: "1832207_igi8uaupcus"
menu:
home: / || home
about:
default: /about/ || user
aboutsite: /about/ || star
updata: /updata/ || cloud
default: / || user
aboutsite: /about/ || user
admiration: /admiration/ || coffee
privacy: /privacy/ || list-alt
posts:
default: / || feather
archives: /archives/ || list-alt
categories: /categories/ || th
tags: /tags/ || tags
statistics: /statistics/ || clock
friends: /friends/ || heart

# https://twikoo.js.org
Expand Down Expand Up @@ -236,7 +233,7 @@ widgets:

footer:
# Specify the date when the site was setup. If not defined, current year will be used.
since: 2021
since: 2022
icon:
name: sakura rotate
# Change the color of icon, using Hex Code.
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ markdown:
- plugin:
name: markdown-it-toc-and-anchor
enable: true
options: # 文章目录以及锚点应用的 class 名称,shoka 主题必须设置成这样
options: # 文章目录以及锚点应用的 class 名称,shoka 系主题必须设置成这样
tocClassName: 'toc'
anchorClassName: 'anchor'
- plugin:
Expand Down
21 changes: 20 additions & 1 deletion docs/guide/theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,24 @@ css: "css" # css存放目录(不建议改动)
js: "js" # js存放目录(不建议改动)
```
### 导航栏
```yaml
menu:
home: / || home
submenu:
default: /page/ || user
link: /page1/ || cloud
link2: /page2/ || coffee
```
此处的配置分为如下两种:
1. 独立导航链接(例如`home`和`link2`)
- `home(link2)`为本地化键(详见本地化)和备用名称
- `/(/page2/)`为超链接地址,可为站外链接(需要带`https`)
- `||`分隔符,分隔链接和图标
- `home(user)`图标,具体可参见`/source/css/_iconfont.styl`
2. 下拉菜单(例如`submenu`)
- `default`为dropbox显示的内容,不建议在此处放置超链接地址(建议设置为`/`)
- 剩余部分为n个不重复的独立导航链接
### 实验性特性
:::tip
实验性特性均不稳定,随时可能引入破坏性更改,且部分有明显副作用
Expand All @@ -31,4 +49,5 @@ experiments:
- 进度条抖动:返回顶部的文字和滑动条的长度与文章实际长度不符,存在±1-5%的误差

上述问题均是由于此方法导致的`window.scrollY`抖动引起的,如果你有好的解决方法欢迎发起PR。
因此,长文章优化功能仅建议在有文章字数超过3万字或站点主要面向渲染性能较差的设备时启用。
因此,长文章优化功能仅建议在有文章字数超过3万字或站点主要面向渲染性能较差的设备时启用。

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hexo-theme-shokax",
"version": "0.2.0-rc6",
"version": "0.2.0",
"description": "a hexo theme based on shoka",
"main": "index.js",
"repository": "https://github.com/zkz098/hexo-theme-shokaX",
Expand Down
39 changes: 25 additions & 14 deletions source/js/_app/library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,17 @@ const vendorCss = function (type: string, condition?: string): void {
}
}

const transition = (target: HTMLElement, type: any, complete?: Function): void => {
/**
* 参数 动画效果
* 0 元素逐渐消失
* 1 元素逐渐出现
* bounceUpIn 元素从下方弹跳出现
* shrinkIn 元素从放大到正常大小出现
* slideRightIn 元素从右侧滑入
* slideRightOut 元素向右侧滑出
* TODO 函数功能过于复杂,需要拆分
*/
const transition = (target: HTMLElement, type: number|string|Function, complete?: Function): void => {
let animation
let display = 'none'
switch (type) {
Expand Down Expand Up @@ -420,6 +430,7 @@ const transition = (target: HTMLElement, type: any, complete?: Function): void =
break
default:
animation = type
// @ts-ignore
display = type.display
break
}
Expand All @@ -434,31 +445,31 @@ const transition = (target: HTMLElement, type: any, complete?: Function): void =
}

const pjaxScript = function (element: HTMLScriptElement) {
const code = element.text || element.textContent || element.innerHTML || ''
const parent = element.parentNode
parent.removeChild(element)
const { text, parentNode, id, className, type, src, dataset } = element
const code = text || element.textContent || element.innerHTML || ''
parentNode.removeChild(element)
const script = document.createElement('script')
if (element.id) {
script.id = element.id
if (id) {
script.id = id
}
if (element.className) {
script.className = element.className
if (className) {
script.className = className
}
if (element.type) {
script.type = element.type
if (type) {
script.type = type
}
if (element.src) {
script.src = element.src
if (src) {
// Force synchronous loading of peripheral JS.
script.src = src
script.async = false
}
if (element.dataset.pjax !== undefined) {
if (dataset.pjax !== undefined) {
script.dataset.pjax = ''
}
if (code !== '') {
script.appendChild(document.createTextNode(code))
}
parent.appendChild(script)
parentNode.appendChild(script)
}

const pageScroll = function (target: any, offset?: number, complete?: Function) {
Expand Down

1 comment on commit 143e957

@vercel
Copy link

@vercel vercel bot commented on 143e957 Mar 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.