theme-shoka-x / hexo-theme-shokaX

a hexo theme based on shoka
https://docs-hexo.shokax.top
GNU Affero General Public License v3.0
321 stars 43 forks source link

音乐盒依然无法工作? #23

Closed duchenpaul closed 1 year ago

duchenpaul commented 1 year ago

问题发生位置

Hexo渲染报错

问题描述

0.1.1版本以后, 我看音乐盒可以加载了, 但是里面歌曲都是无法播放. 是不是API的问题?

image

复现步骤

nothing

相关配置

No response

注意事项

zkz098 commented 1 year ago

能否提供网站地址或者 F12 控制台截图 目前很难判断是不是API引起的

duchenpaul commented 1 year ago

似乎apiyuopu又不可用了 image

duchenpaul commented 1 year ago

我是在内网用 没有公网IP所以没放在公网上

duchenpaul commented 1 year ago

API链接似乎有问题: 目前: https://api.injahow.cn/meting/api?server=netease&type=song&id=94663 正确: https://api.injahow.cn/meting/?server=netease&type=song&id=94663

需要更改: source/js/_app/player.js source/js/_app/player.js

Reference: https://sourcegraph.com/search?q=context%3Aglobal+repo%3A%5Egithub%5C.com%2Fzkz098%2Fhexo-theme-shokaX%24+meting%2Fapi&patternType=standard&sm=1&groupBy=path

duchenpaul commented 1 year ago

还有一个问题, 似乎我配置的音乐单没有覆盖掉你预设的, 我们两的音乐单被合并了....

生成的public/js/app.js

playerAPI:"https://api.injahow.cn",audio:[
    {
        "title": "Fav",
        "list": [
            "https://music.163.com/#/playlist?id=2943811283", <-- 默认的, 期望被我的配置覆盖掉, 但实际上把我的配置追加上去了
            "https://music.163.com/#/playlist?id=2297706586", <-- 默认的, 期望被我的配置覆盖掉, 但实际上把我的配置追加上去了 
            "https://music.163.com/#/song?id=1931517046",
            "https://music.163.com/#/song?id=258684",
            "https://music.163.com/#/song?id=5138277",
            "https://music.163.com/#/song?id=34200332",
            "https://music.163.com/#/song?id=94663"
        ]
    },
    {
        "title": "Patriot",
        "list": [
            "https://music.163.com/#/playlist?id=2031842656", <-- 默认的,  期望被我的配置覆盖掉, 但实际上把我的配置追加上去了
            "https://music.163.com/#/playlist?id=7842528162"
        ]
    },
    {
        "title": "World order",
        "list": [
            "https://music.163.com/#/playlist?id=7999951136"
        ]
    }
]

我的_config.shokaX.yml:

alternate: {{ hexo_theme_config['site_name'] }} # 站点大标题

statics: "/" # 静态文件根目录
assets: "assets"
css: "css"
js: "js"

open_graph:
#twitter_id:
#google_plus:
#fb_admins:
#fb_app_id:

grayMode: false # 全站黑白滤镜
# 请注意: 本主题的PWA功能只是一个装载器,需要自备js和manifest
# 图片可通过https://lp-pwa.gitee.io/pwa-genicon/生成
pwa:
  enable: false # 开启PWA功能
  serviceworker: sw.js #serviceworker脚本位置,使用以/为基准的绝对路径
  manifest: manifest.json #manifest位置,使用以/为基准的绝对路径

# 实验性特性
experiments:
  noPlayer: false # 禁用音乐播放器
  gradient: false # 使用CSS渐变作为文章封面
  gradientCover: "" # 当gradient为true时使用的主页面cover(为空则使用bing随机图片)
  debug: false # 使用debug模式启动
  disableThemeComment: false # 禁用主题评论系统(一般用于关闭评论或让插件接管评论系统)

playerAPI: "https://api.injahow.cn" # 结尾不带/,只填写域名

icon:
  favicon: "/favicon.ico"
  apple_touch_icon: "/apple-touch-icon.png"

seo:
  bing: "bing-key"
  google: "google-key"
  yandex: "yandex-key"
  baidu: "baidu-key"

visitor:
  clarity: false
  baiduAnalytics: false

darkmode: true
auto_dark: # 自动亮/暗模式
  enable: false #是否开启
  start: 20 #开始时间
  end: 7 #结束时间

auto_scroll: true

loader:
  start: true # 进入页面时显示加载动画
  switch: false # 切换页面时显示加载动画

# 显示的动画(烟花)
fireworks:
  enable: true
  color:
    - "rgba(255,182,185,.9)"
    - "rgba(250,227,217,.9)"
    - "rgba(187,222,214,.9)"
    - "rgba(138,198,209,.9)"

font:
  enable: true
  # 从google字体库加载,如果自定义@font-face请关闭
  loadFromGoogle: true
  # 字体选项:
  # `external`:从google字体库加载字体.
  # `family: 字体家族名,无需引号
  # `size: x.x`. 以`em`为单位. 默认: 1 (16px)

  # 适用于所有在body标签内的文字.
  global:
    external: true
    family: Mulish
    size:

  # 大标题字体.
  logo:
    external: true
    family: Fredericka the Great
    size: 3.5

  # 页面标题字体.
  title:
    external: true
    family: Noto Serif JP
    size: 2.5

  # 标题字体.
  headings:
    external: true
    family: Noto Serif SC
    size:

  # 文章字体.
  posts:
    external: false
    family:

  # 代码块的字体
  codes:
    external: true
    family: Inconsolata

# project of https://www.iconfont.cn/
# //at.alicdn.com/t/font_1832207_c8i9n1ulxlt.css => 1832207_c8i9n1ulxlt
iconfont: "1832207_igi8uaupcus"

menu:
  home: / || home
  # about:
  #   default: /about/ || user
  #   aboutsite: /about/ || star
  #   updata: /updata/ || cloud
  #   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
twikoo:
  enable: false
  link: "https://cdn.staticfile.org/twikoo/1.6.6/twikoo.nocss.min.js"
  mode: vercel # vercel或tencent
  envId: "https://114514.foo.bar" # twikoo环境ID,vercel填地址
  region:

# https://waline.js.org/
waline:
  enable: false
  serverURL: ""
  lang: "zh-CN"
  locale: {} # https://waline.js.org/guide/features/i18n.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E8%AF%AD%E8%A8%80
  emoji: # 表情包
    - https://unpkg.com/@waline/emojis@1.0.1/weibo
    - https://unpkg.com/@waline/emojis@1.0.1/alus
    - https://unpkg.com/@waline/emojis@1.0.1/bilibili
    - https://unpkg.com/@waline/emojis@1.0.1/qq
    - https://unpkg.com/@waline/emojis@1.0.1/tieba
    - https://unpkg.com/@waline/emojis@1.0.1/tw-emoji
  meta: # 可以填写的内容
    - nick
    - mail
    - link
  requiredMeta: # 必须填写的内容
    - nick
    - mail
  wordLimit: 0 # 字数限制,0为不限制
  pageSize: 10 # 每页评论条数
  pageview: true # 是否开启浏览量统计

# https://github.com/gitalk/gitalk/blob/master/readme-cn.md
gitalk:
  clientID:
  clientSecret:
  repo:
  owner:
  admin:
  proxy: # 选填

# https://giscus.app/zh-CN
giscus:
  repo:
  repoId:
  category:
  categoryId:
  mapping:
  strict:
  reactionsEnabled:
  emitMetadata:
  inputPosition:
  commentTheme:
  lang:

# Social Links
# Usage: `Key: permalink || icon || color`
# Key is the link label showing to end users.
# Value before `||` delimiter is the target permalink,
# secend value is the name of Font icon.
social:
  github: https://github.com/duchenpaul || github || "#191717"
  #google: https://plus.google.com/yourname || google
  #twitter: https://twitter.com/yourname || twitter || "#00aff0"
  #zhihu: https://www.zhihu.com/people/yourname || zhihu || "#1e88e5"
  #music: https://music.163.com/#/user/home?id=yourid || cloud-music || "#e60026"
  #weibo: https://weibo.com/yourname || weibo || "#ea716e"
  #about: https://about.me/yourname || address-card || "#3b5998"
  #  email: mailto:foo@xxx.com || envelope || "#55acd5"
  #facebook: https://www.facebook.com/yourname || facebook
  #  stackoverflow: https://stackoverflow.com/ || stack-overflow
  #youtube: https://youtube.com/yourname || youtube
  #instagram: https://instagram.com/yourname || instagram
  #skype: skype:yourname?call|chat || skype
  #douban: https://www.douban.com/people/yourname/ || douban

sidebar:
  # Sidebar Position.
  position: right
  # position: right
  # Replace the default avatar image and set the url here.
  avatar: avatar.jpg

widgets:
  # if true, will show random posts
  random_posts: true
  # if true, will show recent comments
  recent_comments: true

footer:
  # Specify the date when the site was setup. If not defined, current year will be used.
  since: 2010
  icon:
    name: sakura rotate
    # Change the color of icon, using Hex Code.
    color: "#ffc0cb"
  # Dependencies: https://github.com/theme-next/hexo-symbols-count-time
  count: true
  powered: true
  lantern:
    enable: true #是否开启
    word1: 中 #第一个字
    word2: 秋 #第二个字
  # icp: # ICP备案
  #   enable: false
  #   icon: "beian.webp" #网安备案图片
  #   icpnumber: "xxx" # ICP备案号
  #   beian: "xxx" # 网安备案号
  #   recordcode: "xxx" # 网安备案链接中的recordcode参数

post:
  count: true

# 文章是否失效
outime:
  enable: true
  days: 90 # 超过 90 天文章失效

reward:
  # If true, reward will be displayed in every article by default.
  enable: false
  account:
    wechatpay: /wechatpay.png
    alipay: /alipay.png
    # paypal: /paypal.png

# TagCloud settings for tags page.
tagcloud:
  # All values below are same as default, change them by yourself.
  min: 16 # Minimun font size in px
  max: 22 # Maxium font size in px
  start: "#72cecf" # Start color (hex, rgba, hsla or color keywords)
  end: "#ffbac3" # End color (hex, rgba, hsla or color keywords)
  amount: 200 # Amount of tags, change it if you have more than 200 tags

# ---------------------------------------------------------------
# Third Party Plugins & Services Settings
# ---------------------------------------------------------------

# Creative Commons 4.0 International License.
# See: https://creativecommons.org/share-your-work/licensing-types-examples
# Available values of license: by | by-nc | by-nc-nd | by-nc-sa | by-nd | by-sa | zero
# You can set a language value if you prefer a translated version of CC license, e.g. deed.zh
# CC licenses are available in 39 languages, you can find the specific and correct abbreviation you need on https://creativecommons.org
creative_commons:
  license: by-nc-sa
  language: deed.zh

# bgm
audio:
  - title: Fav
    list:
      - https://music.163.com/#/song?id=1931517046 # 再见二丁目
      # - http://music.163.com/song/media/outer/url?id=258684
      - https://music.163.com/#/song?id=258684
      - https://music.163.com/#/song?id=5138277
      - https://music.163.com/#/song?id=34200332
      - https://music.163.com/#/song?id=94663
  - title: Patriot
    list:
      - https://music.163.com/#/playlist?id=7842528162
  - title: World order
    list:
      - https://music.163.com/#/playlist?id=7999951136

# random image api
image_server: # "https://acg.xydwz.cn/api/api.php"

# Algolia Search
# For more information: https://www.algolia.com
search:
  hits:
    per_page: 10

# Dependencies: https://github.com/amehime/hexo-renderer-multi-markdown-it
pangu: false

# Quicklink Support
# For more information: https://github.com/GoogleChromeLabs/quicklink
quicklink:
  # Custom a time in milliseconds by which the browser must execute prefetching.
  timeout: 3000
  # Default (true) will attempt to use the fetch() API if supported (rather than link[rel=prefetch]).
  priority: true

  # For more flexibility you can add some patterns (RegExp, Function, or Array) to ignores.
  # See: https://github.com/GoogleChromeLabs/quicklink#custom-ignore-patterns
  ignores:

#! ---------------------------------------------------------------
#! DO NOT EDIT THE FOLLOWING `vendors` SETTINGS
#! UNLESS YOU KNOW WHAT YOU ARE DOING
#! Script dependencies will be combined with jsDelivr (cdn.jsdelivr.net)
#! ---------------------------------------------------------------
advVendors:
  enable: true
  github: "https://cdn.jsdelivr.net/gh/"
  combine: "https://cdn.jsdelivr.net/"
  npm: "https://unpkg.com/"
  js:
    pace:
      src: bytedance:pace/1.0.2/pace.min.js
    pjax:
      src: baomitu:pjax/0.2.8/pjax.min.js
    fetch:
      src: npm:whatwg-fetch@3.4.0/dist/fetch.umd.js
    anime:
      src: bytedance:animejs/3.2.0/anime.min.js
    algolia:
      src: bytedance:algoliasearch/4.12.1/algoliasearch-lite.umd.min.js
    instantsearch:
      src: bytedance:instantsearch.js/4.39.0/instantsearch.production.min.js
    lazyload:
      src: bytedance:lozad.js/1.16.0/lozad.min.js
    quicklink:
      src: bytedance:quicklink/2.2.0/quicklink.umd.min.js
    fancybox:
      src: bytedance:??jquery/3.5.1/jquery.min.js,fancybox/3.5.7/jquery.fancybox.min.js,justifiedGallery/3.8.1/js/jquery.justifiedGallery.min.js
      async: true
    copy_tex:
      src: bytedance:KaTeX/0.12.0/contrib/copy-tex.min.js
      async: true
    chart:
      src: npm:frappe-charts@1.5.0/dist/frappe-charts.min.iife.js
  css:
    katex:
      src: npm:katex@0.12.0/dist/katex.min.css
    comment:
      src: css/comment.css
    fancybox:
      src: combine:npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css,npm/justifiedGallery@3.8.1/dist/css/justifiedGallery.min.css
vendorsList:
  js:
    - pace
    - pjax
    - fetch
    - anime
    - algolia
    - instantsearch
    - lazyload
    - quicklink
    - fancybox
    - copy_tex
    - chart

vendors:
  css:
    # katex: npm/katex@0.12.0/dist/katex.min.css
    katex: npm/katex@0.12.0/dist/katex.min.css # ok
    comment: css/comment.css
    fancybox: combine/npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css,npm/justifiedGallery@3.8.1/dist/css/justifiedGallery.min.css # notok
    # fancybox: npm/fancybox/justifiedGallery.min.css

  js:
    pace: npm/pace-js@1.0.2/pace.min.js # ok
    pjax: npm/pjax@0.2.8/pjax.min.js # ok
    fetch: npm/whatwg-fetch@3.4.0/dist/fetch.umd.min.js # ok
    anime: npm/animejs@3.2.0/lib/anime.min.js # ok
    algolia: npm/algoliasearch@4/dist/algoliasearch-lite.umd.js # ok
    instantsearch: npm/instantsearch.js@4/dist/instantsearch.production.min.js # ok
    lazyload: npm/lozad@1/dist/lozad.min.js # ok
    quicklink: npm/quicklink@2/dist/quicklink.umd.js # ok
    fancybox: combine/npm/jquery@3.5.1/dist/jquery.min.js,npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js,npm/justifiedGallery@3.8.1/dist/js/jquery.justifiedGallery.min.js # notok
    # fancybox: npm/fancybox/jquery.justifiedGallery.min.js
    valine: gh/amehime/MiniValine@4.2.2-beta10/dist/MiniValine.min.js
    copy_tex: npm/katex@0.12.0/dist/contrib/copy-tex.min.js # ok
    chart: npm/frappe-charts@1.5.0/dist/frappe-charts.min.iife.min.js # ok

qweather:
  enable: false
  key: "{{ hexo_theme_config['qweather_apikey'] }}"
duchenpaul commented 1 year ago

API链接似乎有问题: 目前: https://api.injahow.cn/meting/api?server=netease&type=song&id=94663 正确: https://api.injahow.cn/meting/?server=netease&type=song&id=94663

需要更改: source/js/_app/player.js source/js/_app/player.js

Reference: https://sourcegraph.com/search?q=context%3Aglobal+repo%3A%5Egithub%5C.com%2Fzkz098%2Fhexo-theme-shokaX%24+meting%2Fapi&patternType=standard&sm=1&groupBy=path

Fixed in #25

zkz098 commented 1 year ago

此问题是由于hexo本身的配置合并导致的,见: https://hexo.io/zh-cn/docs/configuration#%E4%BD%BF%E7%94%A8%E4%BB%A3%E6%9B%BF%E4%B8%BB%E9%A2%98%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6

duchenpaul commented 1 year ago

有办法修复么 或者在实例里面注释掉

zkz098 commented 1 year ago

有办法修复么 或者在实例里面注释掉

把shokaX npm包中_config.yml的audio注释掉应该就能修复

duchenpaul commented 1 year ago

提个PR从源头修复吧?

zkz098 commented 1 year ago

明天我把audio注释掉之后发个0.1.2就行

zkz098 commented 1 year ago

0.1.2修复