Skip to content

Commit 80082e3

Browse files
committed
NO-JIRA Fix PDF header and table of content
Override the default theme page.html of gitbook to fix the issue at GitbookIO/theme-default#80
1 parent d934dc6 commit 80082e3

4 files changed

Lines changed: 109 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{% extends "layout.html" %}
2+
3+
{% block title %}{{ page.title }}{% endblock %}
4+
{% block description %}{{ page.description }}{% endblock %}
5+
6+
{% block style %}
7+
{### Include theme css before plugins css ###}
8+
{% if not fileExists(config.styles.print) %}
9+
{% if options.format %}
10+
<link rel="stylesheet" href="{{ (options.format + ".css")|resolveAsset }}">
11+
{% else %}
12+
<link rel="stylesheet" href="{{ "ebook.css"|resolveAsset }}">
13+
{% endif %}
14+
{% endif %}
15+
16+
{{ super() }}
17+
18+
{### Custom stylesheets for the book ###}
19+
20+
{% for type, style in config.styles %}
21+
{% if fileExists(style) and (type == "ebook" or type == "print" or type == options.format) %}
22+
<link rel="stylesheet" href="{{ style|resolveFile }}">
23+
{% endif %}
24+
{% endfor %}
25+
{% endblock %}
26+
27+
{% block body %}
28+
<div class="page">
29+
{% block page %}
30+
<h1 class="book-chapter-{{ page.depth }}" style='visibility:hidden; overflow:hidden; height:0; width:0;'>{{ page.title }}</h1>
31+
<div class="section">
32+
{{ page.content|safe }}
33+
</div>
34+
{% endblock %}
35+
</div>
36+
{% endblock %}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{% extends "layout.html" %}
2+
3+
{% block title %}{{ page.title }}{% endblock %}
4+
{% block description %}{{ page.description }}{% endblock %}
5+
6+
{% block style %}
7+
{### Include theme css before plugins css ###}
8+
{% if not fileExists(config.styles.print) %}
9+
{% if options.format %}
10+
<link rel="stylesheet" href="{{ (options.format + ".css")|resolveAsset }}">
11+
{% else %}
12+
<link rel="stylesheet" href="{{ "ebook.css"|resolveAsset }}">
13+
{% endif %}
14+
{% endif %}
15+
16+
{{ super() }}
17+
18+
{### Custom stylesheets for the book ###}
19+
20+
{% for type, style in config.styles %}
21+
{% if fileExists(style) and (type == "ebook" or type == "print" or type == options.format) %}
22+
<link rel="stylesheet" href="{{ style|resolveFile }}">
23+
{% endif %}
24+
{% endfor %}
25+
{% endblock %}
26+
27+
{% block body %}
28+
<div class="page">
29+
{% block page %}
30+
<h1 class="book-chapter-{{ page.depth }}" style='visibility:hidden; overflow:hidden; height:0; width:0;'>{{ page.title }}</h1>
31+
<div class="section">
32+
{{ page.content|safe }}
33+
</div>
34+
{% endblock %}
35+
</div>
36+
{% endblock %}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{% extends "layout.html" %}
2+
3+
{% block title %}{{ page.title }}{% endblock %}
4+
{% block description %}{{ page.description }}{% endblock %}
5+
6+
{% block style %}
7+
{### Include theme css before plugins css ###}
8+
{% if not fileExists(config.styles.print) %}
9+
{% if options.format %}
10+
<link rel="stylesheet" href="{{ (options.format + ".css")|resolveAsset }}">
11+
{% else %}
12+
<link rel="stylesheet" href="{{ "ebook.css"|resolveAsset }}">
13+
{% endif %}
14+
{% endif %}
15+
16+
{{ super() }}
17+
18+
{### Custom stylesheets for the book ###}
19+
20+
{% for type, style in config.styles %}
21+
{% if fileExists(style) and (type == "ebook" or type == "print" or type == options.format) %}
22+
<link rel="stylesheet" href="{{ style|resolveFile }}">
23+
{% endif %}
24+
{% endfor %}
25+
{% endblock %}
26+
27+
{% block body %}
28+
<div class="page">
29+
{% block page %}
30+
<h1 class="book-chapter-{{ page.depth }}" style='visibility:hidden; overflow:hidden; height:0; width:0;'>{{ page.title }}</h1>
31+
<div class="section">
32+
{{ page.content|safe }}
33+
</div>
34+
{% endblock %}
35+
</div>
36+
{% endblock %}

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,6 +1678,7 @@
16781678
<exclude>etc/ide-settings/**</exclude>
16791679
<exclude>docs/**/*.json</exclude>
16801680
<exclude>docs/**/_book/</exclude>
1681+
<exclude>docs/**/_layouts/</exclude>
16811682
<exclude>**/target/</exclude>
16821683
<exclude>**/META-INF/services/*</exclude>
16831684
<exclude>**/META-INF/MANIFEST.MF</exclude>

0 commit comments

Comments
 (0)