简体   繁体   English

如何为GitHub页面中的单个页面自定义Jekyll主题?

[英]How do I customize Jekyll theme for a single page in GitHub pages?

I want to remove the large hero header for a particular page inside my GitHub pages site. 我想删除我的GitHub页面网站内特定页面的大英雄标题

I know how to customize the themes layout , however I only want to customize the layout for a particular page. 我知道如何自定义主题布局 ,但是我只想为特定页面自定义布局。

Ex: 例如:

  • README.md : the "home page" aka / . README.md :“主页”又名/ I do NOT want to customize 我不想自定义
  • credits.md : the credits page at /credits . credits.md :在信用页/credits I do NOT want to customize. 我不想自定义。
  • help.md : the help page at /help . help.md :在帮助页/help I DO want to customize. 确实想定制。 I want to remove the header . 我要删除标题

I'd like to do something like /assets/css/help-style.scss 我想做类似/assets/css/help-style.scss事情

---
---

@import "{{ site.theme }}";

header {
  display: none;
}

The easiest way would be to just define a new layout for your help.md 最简单的方法是为您的help.md定义新的布局

  1. Create a copy of the layout currently used by help.md (say, page.html ) 创建help.md当前使用的layout的副本(例如, page.html
  2. Rename the new layout as help.html (path: _layouts/help.html ) 将新布局重命名为help.html (路径: _layouts/help.html
  3. Remove markup that renders the large hero header 删除呈现大英雄标题的标记
  4. Use layout: help in the front matter of help.md : 使用layout: helphelp.md

     --- layout: help --- 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM