Jekyll 如何知道它应该为每个特定的 URL 使用什么布局?
当我请求 Jekyll 上运行的网站上的特定 URL 时,例如。 www.mysite.com/blog.html Jekyll 如何知道应该呈现什么布局来显示 blog.html?
我曾经使用 Django,其中有 urls.py 文件,它保存成对的 URL 和为每个 URL 呈现的模板。我是 RoR 和 Jekyll 的新手,在 Jekyll 中找不到与 urls.py 类似的东西。
When I request a specific URL on a website ran on Jekyll, eg. www.mysite.com/blog.html how does Jekyll know what layout it should render to display blog.html?
I used to work with Django, where there was urls.py file that kept pairs of URL and templates to render for each URL. I'm new to RoR and Jekyll and couldn't find anything similar to urls.py in Jekyll.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 YAML frontmatter 选择用于特定生成页面的布局。来自 Jekyll 文档:
YAML front-matter 是文件顶部的部分,指定该文件的元数据。它看起来像:
You can choose which layout to use for a specific generated page using the YAML frontmatter. From the Jekyll documentation:
The YAML front-matter is a section at the top of a file that specifies metadata for that file. It looks something like: