Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 修复waline v3的引入问题 #926

Merged
merged 1 commit into from
Sep 26, 2024
Merged

fix: 修复waline v3的引入问题 #926

merged 1 commit into from
Sep 26, 2024

Conversation

zryyyy
Copy link
Contributor

@zryyyy zryyyy commented Sep 22, 2024

Waline v3 的使用方式发生了变化,需要通过 import 引入并使用 init 函数来初始化,而不是直接使用全局的 Waline 对象。

PR Type

  • Bugfix.
  • Feature.
  • Code style update (formatting, local variables).
  • Refactoring (no functional changes, no api changes).
  • Build & CI related changes.
  • Documentation.
  • Translation.
  • Other... Please describe:

Description

Waline v3的引入方式发生了变化,需要使用新的方式初始化,不然会报错 Waline ReferenceError: Waline is not defined

Changes

  1. 引入 Waline 样式:
    保持样式的引入不变,依旧可以通过配置文件引入 Waline 的文件。

  2. 通过 import 方式加载 Waline 并使用 init

    • 将原先的 Waline.init 改为 import { init } from '<%- theme.cdn.waline_js %>';
    • 使用 init() 来初始化 Waline 评论系统。
  3. 保留现有的配置和逻辑:

    • path, locale, imageUploader 等配置保留,并通过 Object.assign() 合并这些配置传递给 init()
  4. 移除全局的 Waline 对象:
    由于 Waline 不再作为全局对象使用,直接通过 import 后使用 init 函数,解决了 "Waline is not defined" 的问题。

Waline v3 的使用方式发生了变化,需要通过 import 引入并使用 init 函数来初始化,而不是直接使用全局的 Waline 对象。
@github-actions github-actions bot added the Layout Pull requests that update a layout file label Sep 22, 2024
@Tikas
Copy link
Member

Tikas commented Sep 22, 2024

感谢你对 Volantis 的帮助,我们近期会测试此项,非常感谢!

@xaoxuu xaoxuu merged commit c4535bb into volantis-x:6.0 Sep 26, 2024
1 check passed
0fuling0 pushed a commit to 0fuling0/hexo-theme-volantis that referenced this pull request Sep 30, 2024
0fuling0 pushed a commit to 0fuling0/hexo-theme-volantis that referenced this pull request Sep 30, 2024
fix

fix: 修复waline v3的引入问题 (volantis-x#926)

fix: 修复图片alt为空时Fancybox caption输出undefined的问题 (volantis-x#925)

fix(artalk):darkmode

Update _cdn.yml

Update test-deploy.yml

fix Fancybox caption

API 变更

好久没更新了,总的更新点啥~

Update cursor.styl: fix volantis-x#916

自定义鼠标,悬浮在自定义右键菜单的导航栏项目上时,自定义鼠标不生效

Update _cdn.yml

Update twikoo version to 1.6.30 (volantis-x#911)

Update labeler.yml

Update _cdn.yml Update twikoo version to 1.6.29 (volantis-x#910)

fix(artalk):update version to 2.7.3

Update _cdn.yml

chore(deps): bump actions/labeler from 4 to 5 (volantis-x#909)

Signed-off-by: dependabot[bot] <[email protected]>

chore(deps): bump google-github-actions/release-please-action from 3 to 4 (volantis-x#908)

Signed-off-by: dependabot[bot] <[email protected]>

BREAKING CHANGE:Update Artalk Version to 2.7.2

Update All Version to Latest

chore(deps): bump hexo from 6.3.0 to 7.0.0 (volantis-x#907)

Signed-off-by: dependabot[bot] <[email protected]>

chore(deps): bump actions/setup-node from 3 to 4 (volantis-x#906)

Signed-off-by: dependabot[bot] <[email protected]>

chore(deps): bump actions/checkout from 3 to 4 (volantis-x#903)

Signed-off-by: dependabot[bot] <[email protected]>

Update README.md

Update Artalk Version to 2.6.4

fix Memos API breaking changes

Memos API breaking changes

Revert "📦 refactor: remove discuss comments system" (volantis-x#898)

📦 refactor: remove discuss comments system (volantis-x#897)

Update  Waline cdn version to 2.15.5 (volantis-x#894)

chore(deps): bump hexo-renderer-stylus from 2.1.0 to 3.0.0 (volantis-x#890)

Signed-off-by: dependabot[bot] <[email protected]>

fix(highlight): hljs volantis-x#888

Update check-configuration.js

fix(tianligpt):bug

fix 光标不换行

新增打字机效果

feat(TianliGPT): 新增 AI 摘要 (volantis-x#885)

Update labeler.yml

Update label-commenter.yml

Update release-please.yml

Update Artalk Version to 2.5.3

fix(artalk): 无法设置不使用后端配置

fix volantis-x#862

feat: Update Artalk Version to 2.5.1

Memos (volantis-x#856)

Update artalk version to 2.5.0

feat(fcircle): 支持初始文章数量设置、本地缓存时间设置

Update twikoo version to 1.6.10

Update fcircle.js version to 1.0.10

Update twikoo version to 1.6.9

Update artalk version to 2.4.4

Update script.ejs

扩展 twikoo 评论 envId 说明

更正 PR847 说明部分中的错误 (volantis-x#850)

评论系统 Waline 新增兰空图床 V2 适配 (volantis-x#847)

Update twikoo to 1.6.8 (volantis-x#845)

fix: wrong behavior when there's no img provided for qrcode (volantis-x#840)

use v2 api

Update script.ejs

chore!: remove pjax

Co-Authored-By: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-Authored-By: penndu <[email protected]>
Co-Authored-By: TeacherDu <[email protected]>
Co-Authored-By: Colsrch <[email protected]>
0fuling0 pushed a commit to 0fuling0/hexo-theme-volantis that referenced this pull request Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Layout Pull requests that update a layout file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants