Renovamen / vuepress-theme-gungnir

A blog theme for VuePress 2.
https://v2-vuepress-theme-gungnir.vercel.app
Apache License 2.0
362 stars 79 forks source link

plugin-giscus 设置为中文无效 #57

Closed pengyinghao closed 2 years ago

pengyinghao commented 2 years ago

✅ Checklist

🔎 Description

配置:

image

结果:

image

📄 Environment info (npx vuepress info)

System:
    OS: macOS 12.3.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 266.00 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
Binaries:
    Node: 14.15.1 - /usr/local/bin/node
    Yarn: 1.22.17 - /usr/local/bin/yarn
    npm: 6.14.16 - /usr/local/bin/npm
Utilities:
    Git: 2.32.0 - /usr/bin/git
Browsers:
    Chrome: 100.0.4896.127
    Edge: Not Found
    Firefox: Not Found
    Safari: 15.4
npmPackages:
    @vuepress/bundler-vite:  2.0.0-beta.39 
    @vuepress/bundler-webpack: Not Found
    @vuepress/cli:  2.0.0-beta.38 
    @vuepress/client:  2.0.0-beta.38 
    @vuepress/core:  2.0.0-beta.38 
    @vuepress/markdown:  2.0.0-beta.38 
    @vuepress/plugin-active-header-links:  2.0.0-beta.38 
    @vuepress/plugin-back-to-top:  2.0.0-beta.38 
    @vuepress/plugin-container:  2.0.0-beta.38 
    @vuepress/plugin-docsearch: Not Found
    @vuepress/plugin-external-link-icon:  2.0.0-beta.38 
    @vuepress/plugin-git:  2.0.0-beta.38 
    @vuepress/plugin-google-analytics:  2.0.0-beta.38 
    @vuepress/plugin-medium-zoom:  2.0.0-beta.38 
    @vuepress/plugin-nprogress:  2.0.0-beta.38 
    @vuepress/plugin-palette:  2.0.0-beta.38 
    @vuepress/plugin-prismjs:  2.0.0-beta.38 
    @vuepress/plugin-pwa:  2.0.0-beta.38 
    @vuepress/plugin-pwa-popup:  2.0.0-beta.38 
    @vuepress/plugin-register-components: Not Found
    @vuepress/plugin-search: Not Found
    @vuepress/plugin-shiki: Not Found
    @vuepress/plugin-theme-data:  2.0.0-beta.38 
    @vuepress/plugin-toc: Not Found
    @vuepress/shared:  2.0.0-beta.38 
    @vuepress/theme-default:  2.0.0-beta.38 
    @vuepress/utils:  2.0.0-beta.38 
    vue:  3.2.31 
    vue-loader: Not Found
    vue-router:  4.0.14 (4.0.12)
    vuepress: ^2.0.0-beta.39 => 2.0.0-beta.39 
    vuepress-vite:  2.0.0-beta.39 
    vuepress-webpack: Not Found

🔗 Reproduction link / repo:

https://pengyinghao.github.io/blog/

Zhengqbbb commented 2 years ago

感谢你的反馈,是的,当前对于用户 overwrite 的配置处理,逻辑处理上没做好,很抱歉对你造成了困扰 其实主题会根据你的网站语言自动进行配置:不过当前应该对于此lang配置读取还是有点问题预计将在下个版本处理完成

  1. 去掉giscus.lang 的配置项
  2. 添加网站语言 lang | 可以参考我的:https://github.com/Zhengqbbb/zhengqbbb.github.io/blob/ccd027774c5e0a39b2e15957afcdebb5daae4c4e/blog/.vuepress/config.ts#L11 image
pengyinghao commented 2 years ago
image

你的也没生效呀 😂😂😂😂

Zhengqbbb commented 2 years ago

你的也没生效呀 😂😂😂😂

是的,所以下个版本支持 我debug完成后发现,对于lang配置的处理未添加 当前只对这种配置生效

locales: {
    "/": {
      lang: "en-US",
      title: "VuePress Theme Gungnir",
      description: "A blog theme for VuePress"
    },
    "/zh/": {
      lang: "zh-CN",
      title: "VuePress Theme Gungnir",
      description: "VuePress 博客主题"
    }
  },

https://v2-vuepress-theme-gungnir.vercel.app/zh/docs/basic/intro.html#%E6%BC%94%E7%A4%BA%E7%AB%99%E7%82%B9

pengyinghao commented 2 years ago

你的没有生效呀😂😂😂😂

是的,所以下个版本支持 我调试完成后发现,对于lang配置的处理未添加 当前只对这种配置生效

locales : { 
    "/" : { 
      lang : "en-US" , 
      title : "VuePress Theme Gungnir" , 
      description : "A blog theme for VuePress" 
    } , 
    "/zh/" : { 
      lang : "zh-CN" ,
      标题:“VuePress 主题 Gungnir” ,
      描述:“VuePress 博客主题” 
    } 
  } ,

https://v2-vuepress-theme-gungnir.vercel.app/zh/docs/basic/intro.html#%E6%BC%94%E7%A4%BA%E7%AB%99%E7%82%B9 好的好的

Renovamen commented 2 years ago

在最新版本(2.0.0-alpha.21)里修复了这个问题,感谢提出 @pengyinghao 和修正 @Zhengqbbb !