hexo-theme-shokax 0.0.1-alpha1 → 0.0.1-alpha3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/_config.yml +3 -1
- package/_images.yml +1 -0
- package/layout/_partials/head/head.pug +5 -1
- package/layout/_partials/head/pwa.pug +15 -14
- package/layout/_partials/layout.pug +12 -7
- package/layout/_partials/third-party/baidu-analytics.pug +3 -3
- package/layout/_partials/third-party/qweather.pug +1 -1
- package/package.json +4 -4
- package/scripts/helpers/engine.js +1 -0
    
        package/README.md
    CHANGED
    
    | @@ -2,7 +2,7 @@ | |
| 2 2 | 
             
            [](https://app.fossa.com/projects/git%2Bgithub.com%2Fzkz098%2Fhexo-theme-shokaX?ref=badge_shield)
         | 
| 3 3 | 
             
            
         | 
| 4 4 | 
             
            
         | 
| 5 | 
            -
             | 
| 5 | 
            +
            
         | 
| 6 6 |  | 
| 7 7 | 
             
            此项目是shoka的一个魔改版,致力于提高性能和优化魔改体验 \
         | 
| 8 8 | 
             
            本项目处于高强度开发期,但github仓库版本已基本可用 \s
         | 
    
        package/_config.yml
    CHANGED
    
    | @@ -24,12 +24,13 @@ pwa: | |
| 24 24 | 
             
            experiments:
         | 
| 25 25 | 
             
              noPlayer: false # 禁用音乐播放器
         | 
| 26 26 | 
             
              gradient: false # 使用CSS渐变作为文章封面
         | 
| 27 | 
            +
              gradientCover: "" # 当gradient为true时使用的主页面cover(为空则使用bing随机图片)
         | 
| 28 | 
            +
              debug: false # 使用debug模式启动
         | 
| 27 29 |  | 
| 28 30 | 
             
            icon:
         | 
| 29 31 | 
             
              favicon: "/favicon.ico"
         | 
| 30 32 | 
             
              apple_touch_icon: "/apple-touch-icon.png"
         | 
| 31 33 |  | 
| 32 | 
            -
            baidu_analytics: ""
         | 
| 33 34 | 
             
            seo:
         | 
| 34 35 | 
             
              bing: "bing-key"
         | 
| 35 36 | 
             
              google: "google-key"
         | 
| @@ -38,6 +39,7 @@ seo: | |
| 38 39 |  | 
| 39 40 | 
             
            visitor:
         | 
| 40 41 | 
             
              clarity: false
         | 
| 42 | 
            +
              baiduAnalytics: false
         | 
| 41 43 |  | 
| 42 44 | 
             
            darkmode: false
         | 
| 43 45 | 
             
            auto_dark: # 自动亮/暗模式
         | 
    
        package/_images.yml
    CHANGED
    
    
| @@ -33,7 +33,11 @@ link(rel="alternate" type="application/json" title=siteTitle href=feedLink) | |
| 33 33 | 
             
            if theme.custom.enable
         | 
| 34 34 | 
             
                != _local_fonts()
         | 
| 35 35 | 
             
            != _css('app.css')
         | 
| 36 | 
            -
             | 
| 36 | 
            +
            - var debugVue = theme?.experiments?.debug
         | 
| 37 | 
            +
            if debugVue
         | 
| 38 | 
            +
                script(src="https://cdn.staticfile.org/vue/3.2.45/vue.global.js")
         | 
| 39 | 
            +
            else
         | 
| 40 | 
            +
                script(src="https://cdn.staticfile.org/vue/3.2.45/vue.global.prod.js")
         | 
| 37 41 | 
             
            include pwa.pug
         | 
| 38 42 | 
             
            if twikooLink && !wl
         | 
| 39 43 | 
             
                != _css("twikoo.css")
         | 
| @@ -1,17 +1,18 @@ | |
| 1 1 | 
             
            //- https://blog.cyfan.top/p/c0af86bb.html#%E5%AE%89%E8%A3%85-Install
         | 
| 2 | 
            +
            - var timeNow = new Date().getTime()
         | 
| 2 3 | 
             
            if theme.pwa.enable
         | 
| 3 | 
            -
                 | 
| 4 | 
            -
             | 
| 5 | 
            -
             | 
| 6 | 
            -
             | 
| 7 | 
            -
             | 
| 8 | 
            -
             | 
| 9 | 
            -
             | 
| 10 | 
            -
             | 
| 11 | 
            -
             | 
| 12 | 
            -
             | 
| 13 | 
            -
             | 
| 14 | 
            -
             | 
| 15 | 
            -
             | 
| 16 | 
            -
             | 
| 4 | 
            +
                - var sworker = theme.pwa.serviceworker
         | 
| 5 | 
            +
                script(data-pjax async).
         | 
| 6 | 
            +
                     if ('serviceWorker' in navigator) {
         | 
| 7 | 
            +
                        navigator.serviceWorker.register("/#{sworker}?time=#{timeNow}").then(async (reg) => {
         | 
| 8 | 
            +
                                if (window.localStorage.getItem('install') !== 'true') {
         | 
| 9 | 
            +
                                    window.localStorage.setItem('install', 'true');
         | 
| 10 | 
            +
                                    setTimeout(() => {
         | 
| 11 | 
            +
                                        window.location.reload()
         | 
| 12 | 
            +
                                    }, 500)
         | 
| 13 | 
            +
                                }
         | 
| 14 | 
            +
                            }).catch(err => {
         | 
| 15 | 
            +
                            console.log(err)
         | 
| 16 | 
            +
                        });
         | 
| 17 | 
            +
                        }
         | 
| 17 18 | 
             
                link(rel="manifest" href=`/${theme.pwa.manifest}`)
         | 
| @@ -30,13 +30,18 @@ html(lang=page.language?page.language:config.language, style=theme.grayMode ? 'f | |
| 30 30 |  | 
| 31 31 | 
             
                                != partial('_partials/header.pug', {}, {cache: true})
         | 
| 32 32 | 
             
                            div(id="imgs" class="pjax")
         | 
| 33 | 
            -
                                 | 
| 34 | 
            -
             | 
| 35 | 
            -
                                     | 
| 36 | 
            -
             | 
| 37 | 
            -
                                            li(class="item" data-background-image=image)
         | 
| 33 | 
            +
                                if theme.experiments.gradient
         | 
| 34 | 
            +
                                    //- cover不可用时用Bing随机图片代替
         | 
| 35 | 
            +
                                    - var coverImage = theme?.experiments?.gradientCover || "https://7ed.net/bing/api"
         | 
| 36 | 
            +
                                    img(src=coverImage)
         | 
| 38 37 | 
             
                                else
         | 
| 39 | 
            -
                                     | 
| 38 | 
            +
                                    - var covers = _cover(page, 6)
         | 
| 39 | 
            +
                                    if covers.length === 6
         | 
| 40 | 
            +
                                        ul
         | 
| 41 | 
            +
                                            each image in covers
         | 
| 42 | 
            +
                                                li(class="item" data-background-image=image)
         | 
| 43 | 
            +
                                    else
         | 
| 44 | 
            +
                                        img(src=covers)
         | 
| 40 45 | 
             
                        div(id="waves")
         | 
| 41 46 | 
             
                            svg(class="waves" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto")
         | 
| 42 47 | 
             
                                defs
         | 
| @@ -97,7 +102,7 @@ html(lang=page.language?page.language:config.language, style=theme.grayMode ? 'f | |
| 97 102 | 
             
                        if page.outime === false
         | 
| 98 103 | 
             
                            | outime: false,
         | 
| 99 104 | 
             
                        else
         | 
| 100 | 
            -
                            | outime: true,template:  | 
| 105 | 
            +
                            | outime: true,template: `!{ __('outime.template') }`,
         | 
| 101 106 | 
             
                        if page.quiz
         | 
| 102 107 | 
             
                            | quiz: {
         | 
| 103 108 | 
             
                            != `choice: \'${__('quiz.choice')}\',`
         | 
| @@ -1,10 +1,10 @@ | |
| 1 | 
            -
            - var hmSrc = `https://hm.baidu.com/hm.js?${ theme. | 
| 2 | 
            -
            if theme. | 
| 1 | 
            +
            - var hmSrc = `https://hm.baidu.com/hm.js?${ theme.visitor.baiduAnalytics }`
         | 
| 2 | 
            +
            if theme.visitor.baiduAnalytics
         | 
| 3 3 | 
             
                script(data-pjax=true).
         | 
| 4 4 | 
             
                    var _hmt = _hmt || [];
         | 
| 5 5 | 
             
                    (function () {
         | 
| 6 6 | 
             
                        const hm = document.createElement("script");
         | 
| 7 | 
            -
                        hm.src = #{hmSrc}
         | 
| 7 | 
            +
                        hm.src = "#{hmSrc}"
         | 
| 8 8 | 
             
                        hm.async = true;
         | 
| 9 9 | 
             
                        const s = document.getElementsByTagName("script")[0];
         | 
| 10 10 | 
             
                        s.parentNode.insertBefore(hm, s);
         | 
    
        package/package.json
    CHANGED
    
    | @@ -1,6 +1,6 @@ | |
| 1 1 | 
             
            {
         | 
| 2 2 | 
             
              "name": "hexo-theme-shokax",
         | 
| 3 | 
            -
              "version": "0.0.1- | 
| 3 | 
            +
              "version": "0.0.1-alpha3",
         | 
| 4 4 | 
             
              "description": "a hexo theme based on shoka",
         | 
| 5 5 | 
             
              "main": "index.js",
         | 
| 6 6 | 
             
              "repository": "https://github.com/zkz098/hexo-theme-shokaX",
         | 
| @@ -16,10 +16,10 @@ | |
| 16 16 | 
             
                "@types/jquery": "^3.5.14",
         | 
| 17 17 | 
             
                "@types/js-yaml": "^4.0.5",
         | 
| 18 18 | 
             
                "@types/lozad": "^1.16.1",
         | 
| 19 | 
            -
                "@types/node": "^18.11. | 
| 19 | 
            +
                "@types/node": "^18.11.18",
         | 
| 20 20 | 
             
                "@types/shelljs": "^0.8.11",
         | 
| 21 | 
            -
                "@typescript-eslint/eslint-plugin": "^5.47. | 
| 22 | 
            -
                "@typescript-eslint/parser": "^5.47. | 
| 21 | 
            +
                "@typescript-eslint/eslint-plugin": "^5.47.1",
         | 
| 22 | 
            +
                "@typescript-eslint/parser": "^5.47.1",
         | 
| 23 23 | 
             
                "eslint": "^8.30.0",
         | 
| 24 24 | 
             
                "eslint-config-standard": "^17.0.0",
         | 
| 25 25 | 
             
                "eslint-plugin-import": "^2.26.0",
         | 
| @@ -27,6 +27,7 @@ const randomBG = function (count = 1, image_server = null, image_list = []) { | |
| 27 27 | 
             
                if (img.startsWith('//') || img.startsWith('http')) {
         | 
| 28 28 | 
             
                  return img
         | 
| 29 29 | 
             
                } else {
         | 
| 30 | 
            +
                  console.warn("sinaimg blocked all request from outside website,so don't use this format")
         | 
| 30 31 | 
             
                  return `https://tva${randomServer}.sinaimg.cn/` + size + '/' + img
         | 
| 31 32 | 
             
                }
         | 
| 32 33 | 
             
              }
         |