hexo-theme-stun icon indicating copy to clipboard operation
hexo-theme-stun copied to clipboard

如何获取配置内容

Open gjssss opened this issue 2 years ago • 0 comments

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

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

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

test

|-- layout

|  |-- index.njk

|-- scripts

|  |-- test.js

|-- source

|-- _config.yml

不胜感激!

gjssss avatar May 10 '22 13:05 gjssss