我对Jekyll和kramdown是新手,所以我可能需要帮助来问我的问题。
我在H1标题上遇到了问题:所以在一篇文章中(标记文件在这里下载)中有以下内容:
# H1 looks like this
## H2 looks like this
### H3 looks like this
#### H4 looks like this
##### H5 looks like this
###### H6 looks like this
Normal text looks like this
生成以下内容:
H2-H6看起来很好,但我不知道H1有什么问题,但我希望它的格式正确。
Gemfile
source "https://rubygems.org"
gem "jekyll", ">= 3.8.5"
group :jekyll_plugins do
gem "jekyll-feed", "~> 0.12"
gem "jekyll-paginate", "~> 1.1.0"
gem "jekyll-sitemap"
end
platforms :mingw, :x64_mingw, :mswin, :jruby do
gem "tzinfo", "~> 1.2"
gem "tzinfo-data"
end
gem "wdm", ">= 0.1.1" if Gem.win_platform?
gem "webrick"
_config.yml
文件
# Build settings
markdown: kramdown
permalink: pretty
highlighter: rouge
kramdown:
input: GFM
auto_ids: true
syntax_highlighter: rouge
HTML是这样的。全HTML文件下载
<h1 id="h1-looks-like-this">H1 looks like this</h1>
<h2 id="h2-looks-like-this">H2 looks like this</h2>
<h3 id="h3-looks-like-this">H3 looks like this</h3>
<h4 id="h4-looks-like-this">H4 looks like this</h4>
<h5 id="h5-looks-like-this">H5 looks like this</h5>
<h6 id="h6-looks-like-this">H6 looks like this</h6>
<p>Normal text looks like this</p>
main.css
文件是这里。h1
多次出现,摘录如下:
h1, h2, h3, h4, h5, h6 { font-size: 100%; font-weight: 400; }
...
.home h1 { margin-bottom: 25px; }
...
.post-header h1 {
font-size: 36px;
letter-spacing: -1.75px;
line-height: 1;
font-weight: 300;
}
...
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
line-height: 1;
font-weight: 300;
margin: 40px 0 20px;
...
.post-header h1 { font-size: 36px; }
.post-content h2 { font-size: 28px; }
.post-content h3 { font-size: 22px; }
.post-content h4 { font-size: 18px; }
.post-content blockquote { padding-left: 10px; }
.post-content ul,
.post-content ol { padding-left: 10px; }
}
发布于 2022-05-02 13:23:01
您的问题在css中,它指定了以下内容
.post-content h2 {
font-size: 32px;
letter-spacing: -1.25px;
}
对于H2,H3,H4,而不是H1。
只要在CSS文件中的..post内容H1中添加H1,就可以了。
我建议学习使用浏览器的检查器来发现这样的问题。只需右键单击页面中的一个元素,然后选择“检查”。那就从那儿走吧。
https://stackoverflow.com/questions/72083441
复制相似问题