mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 09:17:06 +00:00
Add table of contents to the integrations pages (#13572)
Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
parent
9532c71873
commit
125040b42a
1
Gemfile
1
Gemfile
@ -15,6 +15,7 @@ group :jekyll_plugins do
|
|||||||
gem 'jekyll-sitemap', '1.4.0'
|
gem 'jekyll-sitemap', '1.4.0'
|
||||||
gem 'jekyll-time-to-read', '0.1.2'
|
gem 'jekyll-time-to-read', '0.1.2'
|
||||||
gem 'jekyll-commonmark', '1.3.1'
|
gem 'jekyll-commonmark', '1.3.1'
|
||||||
|
gem 'jekyll-toc', '0.14.0'
|
||||||
end
|
end
|
||||||
|
|
||||||
gem 'sinatra', '2.1.0'
|
gem 'sinatra', '2.1.0'
|
||||||
|
@ -56,6 +56,9 @@ GEM
|
|||||||
jekyll (>= 3.7, < 5.0)
|
jekyll (>= 3.7, < 5.0)
|
||||||
jekyll-time-to-read (0.1.2)
|
jekyll-time-to-read (0.1.2)
|
||||||
jekyll
|
jekyll
|
||||||
|
jekyll-toc (0.14.0)
|
||||||
|
jekyll (>= 3.8)
|
||||||
|
nokogiri (~> 1.10)
|
||||||
jekyll-watch (2.2.1)
|
jekyll-watch (2.2.1)
|
||||||
listen (~> 3.0)
|
listen (~> 3.0)
|
||||||
kramdown (2.3.0)
|
kramdown (2.3.0)
|
||||||
@ -124,6 +127,7 @@ DEPENDENCIES
|
|||||||
jekyll-paginate (= 1.1.0)
|
jekyll-paginate (= 1.1.0)
|
||||||
jekyll-sitemap (= 1.4.0)
|
jekyll-sitemap (= 1.4.0)
|
||||||
jekyll-time-to-read (= 0.1.2)
|
jekyll-time-to-read (= 0.1.2)
|
||||||
|
jekyll-toc (= 0.14.0)
|
||||||
nokogiri (= 1.10.10)
|
nokogiri (= 1.10.10)
|
||||||
rake (= 13.0.1)
|
rake (= 13.0.1)
|
||||||
sass-globbing (= 1.1.5)
|
sass-globbing (= 1.1.5)
|
||||||
|
19
_config.yml
19
_config.yml
@ -46,6 +46,7 @@ highlighter: none
|
|||||||
|
|
||||||
plugins:
|
plugins:
|
||||||
- jekyll-time-to-read
|
- jekyll-time-to-read
|
||||||
|
- jekyll-toc
|
||||||
|
|
||||||
paginate: 10 # Posts per page on the blog index
|
paginate: 10 # Posts per page on the blog index
|
||||||
paginate_path: "blog/posts/:num" # Directory base for pagination URLs eg. /posts/2/
|
paginate_path: "blog/posts/:num" # Directory base for pagination URLs eg. /posts/2/
|
||||||
@ -123,6 +124,7 @@ defaults:
|
|||||||
featured: false
|
featured: false
|
||||||
# Defaults for blogs posts
|
# Defaults for blogs posts
|
||||||
- scope:
|
- scope:
|
||||||
|
path: ""
|
||||||
type: posts
|
type: posts
|
||||||
values:
|
values:
|
||||||
layout: post
|
layout: post
|
||||||
@ -130,9 +132,26 @@ defaults:
|
|||||||
footer: true
|
footer: true
|
||||||
sharing: true
|
sharing: true
|
||||||
sidebar: true
|
sidebar: true
|
||||||
|
# Enable table of contents for integrations
|
||||||
|
#
|
||||||
|
# To set toc as a default value, we need to set the scope with an empty path
|
||||||
|
# and the collection as type
|
||||||
|
# https://github.com/toshimaru/jekyll-toc/issues/116#issuecomment-644205770
|
||||||
|
#
|
||||||
|
- scope:
|
||||||
|
path: ""
|
||||||
|
type: integrations
|
||||||
|
values:
|
||||||
|
toc: true
|
||||||
|
|
||||||
# Support for files Jekyll will normally exclude
|
# Support for files Jekyll will normally exclude
|
||||||
include:
|
include:
|
||||||
- "_headers"
|
- "_headers"
|
||||||
- "_redirects"
|
- "_redirects"
|
||||||
- ".well-known"
|
- ".well-known"
|
||||||
|
|
||||||
|
# Table of contents
|
||||||
|
# https://github.com/toshimaru/jekyll-toc
|
||||||
|
toc:
|
||||||
|
min_level: 2 # default: 1
|
||||||
|
max_level: 3 # default: 6
|
||||||
|
@ -426,6 +426,21 @@ div.note {
|
|||||||
.aside-module {
|
.aside-module {
|
||||||
.section {
|
.section {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
|
|
||||||
|
ul.section-nav {
|
||||||
|
margin-left: 0px;
|
||||||
|
|
||||||
|
li.toc-entry {
|
||||||
|
list-style-type: none;
|
||||||
|
li {
|
||||||
|
list-style-type: circle;
|
||||||
|
margin-left: 1em;
|
||||||
|
}
|
||||||
|
ul {
|
||||||
|
margin-left: 1em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.brand-logo-container {
|
.brand-logo-container {
|
||||||
|
@ -66,6 +66,12 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
|
||||||
|
{%- unless page.no_toc -%}
|
||||||
|
<div class='section'>
|
||||||
|
<h1 class="title delta">On this page</h1>
|
||||||
|
{% toc %}
|
||||||
|
{%- endunless -%}
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<script src="https://alerts.home-assistant.io/ce-alert-link.js"></script>
|
<script src="https://alerts.home-assistant.io/ce-alert-link.js"></script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user