更改 Jekyll 的源目录并保留其他目录
Changing Jekyll's source directory and keeping other directorys there they are
我想更改 Jekyll 的源目录,但同时我想将 _includes
等其他相关目录保留在同一位置。
为了实现这一点,我将 _config.yml
中的 source
设置为 _source
。这行得通,但似乎所有其他配置值,如 includes_dir
总是相对于 source
。
如何配置 includes_dir
和所有其他独立于 source
[=27=的值]?
我想要的目录结构如下所示:
+- _source
+- _includes
+- _posts
+- ...
\ _config.yml
Jekyll 需要源目录下的所有目录。
我通过调查 Jekyll's source code 发现了这一点。 class Site
包含几个处理配置目录的方法。都是用in_source_dir
的方法来判断有效路径的。
方法 configure_include_paths
就是一个很好的例子。
def configure_include_paths
@includes_load_paths = Array(in_source_dir(config["includes_dir"].to_s))
@includes_load_paths << theme.includes_path if theme&.includes_path
end
我想更改 Jekyll 的源目录,但同时我想将 _includes
等其他相关目录保留在同一位置。
为了实现这一点,我将 _config.yml
中的 source
设置为 _source
。这行得通,但似乎所有其他配置值,如 includes_dir
总是相对于 source
。
如何配置 includes_dir
和所有其他独立于 source
[=27=的值]?
我想要的目录结构如下所示:
+- _source
+- _includes
+- _posts
+- ...
\ _config.yml
Jekyll 需要源目录下的所有目录。
我通过调查 Jekyll's source code 发现了这一点。 class Site
包含几个处理配置目录的方法。都是用in_source_dir
的方法来判断有效路径的。
方法 configure_include_paths
就是一个很好的例子。
def configure_include_paths
@includes_load_paths = Array(in_source_dir(config["includes_dir"].to_s))
@includes_load_paths << theme.includes_path if theme&.includes_path
end