hexo-theme-shokax
Advanced tools
Comparing version 0.4.16 to 0.5.0-dev-58aa58e
{ | ||
"name": "hexo-theme-shokax", | ||
"version": "0.4.16", | ||
"version": "0.5.0-dev-58aa58e", | ||
"description": "a hexo theme based on shoka", | ||
@@ -32,3 +32,3 @@ "main": "index.js", | ||
"@waline/client": "^3.3.2", | ||
"algoliasearch": "5.5.3", | ||
"algoliasearch": "5.10.2", | ||
"esbuild": "^0.24.0", | ||
@@ -69,2 +69,2 @@ "hexo": "^7.3.0", | ||
} | ||
} | ||
} |
@@ -1,42 +0,22 @@ | ||
# 📣 公告 | ||
[你的 ShokaX 和 Shoka 站点可能正在遭遇供应链攻击](https://github.com/theme-shoka-x/hexo-theme-shokaX/discussions/293) \ | ||
[关于 ShokaX 部署平台和 Astro 迁移的调查](https://github.com/theme-shoka-x/hexo-theme-shokaX/discussions/229) | ||
**🏗️ 当前分支为 ShokaX 0.5 Dev分支,不建议普通用户使用** \ | ||
此分支为 ShokaX 0.5 实验性变更分支,确保0.5开发期间0.4的维护不受影响 | ||
# hexo-theme-shokaX | ||
![LICENSE]( https://img.shields.io/github/license/theme-shoka-x/hexo-theme-shokaX) | ||
![stars](https://img.shields.io/github/stars/theme-shoka-x/hexo-theme-shokaX) | ||
![version](https://shields.io/npm/v/hexo-theme-shokax) | ||
![build](https://img.shields.io/github/actions/workflow/status/theme-shoka-x/hexo-theme-shokaX/build-theme.yml) | ||
计划更改: | ||
- 移除 pjax | ||
- 移除 quicklink | ||
- 移除 assetUrl 为基的动态 Vendor 机制 | ||
- 移除 ShokaX Inject | ||
- 引入新的 Inject 类技术 (长期) | ||
- 引入新的工作流程 | ||
- 引入 CI 自动测试 | ||
- 重构 player (暂时移除) | ||
- 优化 menu 配置格式 | ||
- 优化和异步化 Smart Bundle 技术 | ||
- 优化 CSS 结构和加载 | ||
- 修复/重置 fancybox | ||
- 修复模板长期遗留问题 | ||
- 修复 images 遗留问题 | ||
- 规范化配置文件 | ||
- 规范化文档 | ||
#### 语言(language): 简体中文 | [English](./README_en.MD) \ | ||
此项目是shoka的一个二次开发版(算精神续作),致力于提高性能和优化魔改体验 \ | ||
诞生原因是目前shoka已经三年没有更新了,积压了大量BUG和功能请求。 | ||
shokaX的社区资源导航和插件仓库为[awesome-shokaX](https://github.com/theme-shoka-x/awesome-shokaX) | ||
## 💬 和shoka的区别 | ||
原先shoka使用了javascript+Native+nunjucks的技术 \ | ||
而shokaX则使用了typescript+Vue 3+Pug的技术搭配 \ | ||
更改了大量难以访问的CDN链接 | ||
## ✨ 功能清单 | ||
| 功能名称 | 实现状态 | 功能名称 | 实现状态 | | ||
|:--------:|:----:|:------------:|:----:| | ||
| PWA支持 | ✅ | JSD拆分 | ✅ | | ||
| 注入API | ✅ | 社区插件系统 | ✅ | | ||
| 自定义字体 | ✅* | 自定义样式 | ✅* | | ||
| 多种评论系统支持 | ✅ | AI生成文章概括 | 🔬 | | ||
| 底部备案号 | ✅ | 自定义页尾 | ✅* | | ||
| CSS渐变封面 | ✅ | typescript支持 | ✅ | | ||
备注: | ||
- *: 需要使用注入API实现 | ||
- 🔬: 实验中,可能存在问题 | ||
## 🔧 如何安装? | ||
注意: 本项目需要 node.js 18.x 或更高版本才能运行 \ | ||
见文档中[如何安装](https://docs-hexo.shokax.top/getting-started/)部分 | ||
## 📚子项目 | ||
@@ -43,0 +23,0 @@ - [ShokaX docs](https://github.com/theme-shoka-x/shokaX-docs) ShokaX 主题文档 (正在编写中,欢迎加入!) |
@@ -77,3 +77,2 @@ import { CONFIG } from '../globals/globalVars' | ||
commentLink.href = root + item.href | ||
commentLink['data-pjax-state'] = 'data-pjax-state' | ||
commentEl.className = 'item' | ||
@@ -80,0 +79,0 @@ |
@@ -43,3 +43,2 @@ import * as twikoo from 'twikoo' | ||
commentLink.href = root + item.href | ||
commentLink['data-pjax-state'] = 'data-pjax-state' | ||
commentEl.className = 'item' | ||
@@ -46,0 +45,0 @@ |
@@ -1,3 +0,1 @@ | ||
import { $dom } from '../library/dom' | ||
import Pjax from 'theme-shokax-pjax' | ||
import initProto from '../library/proto' | ||
@@ -32,3 +30,2 @@ | ||
export let LOCAL_URL = window.location.href | ||
export let pjax:Pjax | ||
@@ -70,6 +67,2 @@ export function setSiteNavHeight (value:number):void { | ||
export function setPjax (value:Pjax):void { | ||
pjax = value | ||
} | ||
export function setOriginTitle (value:string):void { | ||
@@ -76,0 +69,0 @@ originTitle = value |
@@ -1,2 +0,1 @@ | ||
import { getScript } from './scriptPjax' | ||
import { CONFIG } from '../globals/globalVars' | ||
@@ -22,5 +21,3 @@ import { createChild } from './proto' | ||
if (LOCAL[type]) { | ||
getScript(assetUrl('js', type),CONFIG['js'][type].sri, callback || function () { | ||
window[type] = true | ||
}, condition || window[type]) | ||
assetUrl('js', type) | ||
} | ||
@@ -27,0 +24,0 @@ } |
@@ -234,11 +234,11 @@ import { $dom } from '../library/dom' | ||
if (__shokax_player__) { | ||
$dom.each('.md div.player', (element) => { | ||
mediaPlayer(element, { | ||
type: element.getAttribute('data-type'), | ||
mode: 'order', | ||
btns: [] | ||
}).player.load(JSON.parse(element.getAttribute('data-src'))).fetch() | ||
}) | ||
} | ||
// if (__shokax_player__) { | ||
// $dom.each('.md div.player', (element) => { | ||
// mediaPlayer(element, { | ||
// type: element.getAttribute('data-type'), | ||
// mode: 'order', | ||
// btns: [] | ||
// }).player.load(JSON.parse(element.getAttribute('data-src'))).fetch() | ||
// }) | ||
// } | ||
@@ -245,0 +245,0 @@ const angleDown = document.querySelectorAll('.show-btn .i-angle-down') |
@@ -8,3 +8,3 @@ import { CONFIG, siteSearch } from '../globals/globalVars' | ||
export function algoliaSearch (pjax) { | ||
export function algoliaSearch () { | ||
const search = instantsearch({ | ||
@@ -22,6 +22,2 @@ indexName: CONFIG.search.indexName, | ||
search.on('render', () => { | ||
pjax.refresh(document.getElementById("search-hits")) | ||
}) | ||
// Registering Widgets | ||
@@ -110,3 +106,3 @@ search.addWidgets([ | ||
document.querySelector('.close-btn').addEventListener('click', onPopupClose) | ||
window.addEventListener('pjax:success', onPopupClose) | ||
// window.addEventListener('pjax:success', onPopupClose) | ||
window.addEventListener('keyup', (event) => { | ||
@@ -113,0 +109,0 @@ if (event.key === 'Escape') { |
@@ -48,10 +48,10 @@ import { backToTopHandle, goToBottomHandle, goToCommentHandle, sideBarToggleHandle } from '../components/sidebar' | ||
if (__shokax_player__) { | ||
mediaPlayer(toolPlayer) | ||
// if (__shokax_player__) { | ||
// mediaPlayer(toolPlayer) | ||
// | ||
// document.querySelector('main').addEventListener('click', () => { | ||
// toolPlayer.player.mini() | ||
// }) | ||
// } | ||
document.querySelector('main').addEventListener('click', () => { | ||
toolPlayer.player.mini() | ||
}) | ||
} | ||
const createIntersectionObserver = () => { | ||
@@ -58,0 +58,0 @@ // waves在视口外时停止动画 |
@@ -5,3 +5,2 @@ import { $dom } from '../library/dom' | ||
import { vendorCss, vendorJs } from '../library/loadFile' | ||
import { pjaxScript } from '../library/scriptPjax' | ||
import { resizeHandle } from '../globals/handles' | ||
@@ -65,6 +64,2 @@ import { | ||
if (reload !== 1) { | ||
$dom.each('script[data-pjax]', pjaxScript) | ||
} | ||
setOriginTitle(document.title) | ||
@@ -71,0 +66,0 @@ |
import domInit from './domInit' | ||
import { pjaxReload, siteRefresh } from './refresh' | ||
import { siteRefresh } from './refresh' | ||
import { cloudflareInit } from '../components/cloudflare' | ||
import { BODY, CONFIG, pjax, setPjax, setSiteSearch, siteSearch } from '../globals/globalVars' | ||
import { BODY, CONFIG, setSiteSearch, siteSearch } from '../globals/globalVars' | ||
import { autoDarkmode, themeColorListener } from '../globals/themeColor' | ||
import { resizeHandle, scrollHandle, visibilityListener } from '../globals/handles' | ||
import { pagePosition } from '../globals/tools' | ||
import Pjax from 'theme-shokax-pjax' | ||
import { initVue } from '../library/vue' | ||
@@ -18,14 +17,2 @@ import { $dom } from '../library/dom' | ||
setPjax(new Pjax({ | ||
selectors: [ | ||
'head title', | ||
'.languages', | ||
'.twikoo', | ||
'.pjax', | ||
'.leancloud-recent-comment', | ||
'script[data-config]' | ||
], | ||
cacheBust: false | ||
})) | ||
CONFIG.quicklink.ignores = LOCAL.ignores | ||
@@ -57,3 +44,3 @@ import('quicklink').then(({listen}) => { | ||
import('../page/search').then(({algoliaSearch}) => { | ||
algoliaSearch(pjax) | ||
algoliaSearch() | ||
}) | ||
@@ -88,9 +75,9 @@ | ||
window.addEventListener('pjax:send', pjaxReload, { | ||
passive: true | ||
}) | ||
// window.addEventListener('pjax:send', pjaxReload, { | ||
// passive: true | ||
// }) | ||
window.addEventListener('pjax:success', siteRefresh, { | ||
passive: true | ||
}) // 默认会传入一个event参数 | ||
// window.addEventListener('pjax:success', siteRefresh, { | ||
// passive: true | ||
// }) // 默认会传入一个event参数 | ||
@@ -97,0 +84,0 @@ window.addEventListener('beforeunload', () => { |
@@ -0,1 +1,3 @@ | ||
// 临时性弃用,等待重构 | ||
import { CONFIG, originTitle } from './globals/globalVars' | ||
@@ -2,0 +4,0 @@ import { showtip } from './globals/tools' |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
505639
192
4374
57
7
+ Added@algolia/client-abtesting@5.10.2(transitive)
+ Added@algolia/client-analytics@5.10.2(transitive)
+ Added@algolia/client-common@5.10.2(transitive)
+ Added@algolia/client-insights@5.10.2(transitive)
+ Added@algolia/client-personalization@5.10.2(transitive)
+ Added@algolia/client-query-suggestions@5.10.2(transitive)
+ Added@algolia/client-search@5.10.2(transitive)
+ Added@algolia/ingestion@1.10.2(transitive)
+ Added@algolia/monitoring@1.10.2(transitive)
+ Added@algolia/recommend@5.10.2(transitive)
+ Added@algolia/requester-browser-xhr@5.10.2(transitive)
+ Added@algolia/requester-fetch@5.10.2(transitive)
+ Added@algolia/requester-node-http@5.10.2(transitive)
+ Addedalgoliasearch@5.10.2(transitive)
- Removed@algolia/client-abtesting@5.5.3(transitive)
- Removed@algolia/client-analytics@5.5.3(transitive)
- Removed@algolia/client-common@5.5.3(transitive)
- Removed@algolia/client-personalization@5.5.3(transitive)
- Removed@algolia/client-search@5.5.3(transitive)
- Removed@algolia/recommend@5.5.3(transitive)
- Removed@algolia/requester-browser-xhr@5.5.3(transitive)
- Removed@algolia/requester-fetch@5.5.3(transitive)
- Removed@algolia/requester-node-http@5.5.3(transitive)
- Removedalgoliasearch@5.5.3(transitive)
Updatedalgoliasearch@5.10.2