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

[BUG] Some breaking bugs caused by Hugo 0.123.0 #420

Closed
1 of 2 tasks
Lruihao opened this issue Feb 23, 2024 · 4 comments
Closed
1 of 2 tasks

[BUG] Some breaking bugs caused by Hugo 0.123.0 #420

Lruihao opened this issue Feb 23, 2024 · 4 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Lruihao
Copy link
Member

Lruihao commented Feb 23, 2024

  • 弃用 FixIt 页面参数的获取策略(并弃用 page 参数这一层,扩大到整个 params)
  • id 函数的 .Scratch 也获取失败

异常:$params 参数一整个获取异常,原因应该是 Hugo 新版本的深度合并与旧版本不一致导致的。
策略:使用 .Param 方法代替 .Params 参数获取页面参数

The Param method returns the value associated with the given KEY, regardless of whether the value is truthy or falsy.

参考:

@Lruihao Lruihao added the bug Something isn't working label Feb 23, 2024
@Lruihao Lruihao added this to the v0.3.x milestone Feb 23, 2024
@Lruihao Lruihao self-assigned this Feb 23, 2024
@Lruihao Lruihao moved this from To do to In progress in Roadmap of FixIt Feb 25, 2024
Lruihao added a commit that referenced this issue Mar 7, 2024
Lruihao added a commit that referenced this issue Mar 7, 2024
@Lruihao Lruihao pinned this issue Apr 17, 2024
@Lruihao
Copy link
Member Author

Lruihao commented Apr 19, 2024

Why is my page Scratch or Store missing a value?

The Scratch and Store methods on a Page object allow you to create a scratch pad on the given page to store and manipulate data. Values are often set within a shortcode, a partial template called by a shortcode, or by a Markdown render hook. In all three cases, the scratch pad values are not determinate until Hugo renders the page content.

@Lruihao
Copy link
Member Author

Lruihao commented Apr 19, 2024

Why is my page Scratch or Store missing a value?

The Scratch and Store methods on a Page object allow you to create a scratch pad on the given page to store and manipulate data. Values are often set within a shortcode, a partial template called by a shortcode, or by a Markdown render hook. In all three cases, the scratch pad values are not determinate until Hugo renders the page content.

可以肯定的是造成 typeit 和 mapbox shortcode 失效的主要原因正是因为 Page Scratch 在 shortcode 的阶段是不确定的值。经过各种尝试后依旧没有找到好的解决方式。

放弃!

之后或改用 typed.js,并独立出 FixIt 主题,成为主题组件生态的一部分

@Lruihao
Copy link
Member Author

Lruihao commented Apr 19, 2024

同时考虑到 目前仍处于 0.3.x 版本的阶段,为减少升级主题造成的影响,page 这层参数仍然保留,先加入待办事项

Scratch 相关的 bug,通过其他方式解决,例如数据储存不放在 scratch 中暂存再给 js 处理了,尝试直接放在 html 中,通过原生 template 标签存储。

@Lruihao
Copy link
Member Author

Lruihao commented Apr 20, 2024

typeit、echarts、mapbox shortcodes 都已重构为不依赖 .Scratch 实现。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

1 participant