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

如何获取配置内容 #276

Open
gjssss opened this issue May 10, 2022 · 0 comments
Open

如何获取配置内容 #276

gjssss opened this issue May 10, 2022 · 0 comments

Comments

@gjssss
Copy link

gjssss commented May 10, 2022

您好,我使用您开源的stun主题,感觉十分简洁和美观。但是我最近想开发一个我自己的主题,在获取主题配置时遇到了困难。

我观察您的代码,使用了hexo.theme.config获取主题文件夹里的_config.yml配置,但是我在代码中使用获得的是一个空对象,而且在模板文件中使用theme获取到的只有RootConfig配置。

如果您方便的话想询问一下在模板和脚本中获取主题配置文件,这里是我的主题文件夹结构

test

|-- layout

|  |-- index.njk

|-- scripts

|  |-- test.js

|-- source

|-- _config.yml

不胜感激!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant