Skip to content

Commit 95a28d1

Browse files
authored
PaddlePaddle.org requires the nav tree to be generated in order to parse the site map. Since we removed theme in #8752, this also removed the site navigation menu. This changelist adds back the site navigation menu. (#8760)
1 parent 19de160 commit 95a28d1

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

doc/templates/conf.py.cn.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ import paddle.v2
2222
MarkdownParser = parser.CommonMarkParser
2323
AutoStructify = transform.AutoStructify
2424

25+
# If extensions (or modules to document with autodoc) are in another directory,
26+
# add these directories to sys.path here. If the directory is relative to the
27+
# documentation root, use os.path.abspath to make it absolute, like shown here.
28+
templates_path = ["@PADDLE_SOURCE_DIR@/doc/templates"]
29+
2530
# -- General configuration ------------------------------------------------
2631

2732
# General information about the project.

doc/templates/conf.py.en.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ import paddle.v2
2323
MarkdownParser = parser.CommonMarkParser
2424
AutoStructify = transform.AutoStructify
2525

26+
# If extensions (or modules to document with autodoc) are in another directory,
27+
# add these directories to sys.path here. If the directory is relative to the
28+
# documentation root, use os.path.abspath to make it absolute, like shown here.
29+
templates_path = ["@PADDLE_SOURCE_DIR@/doc/templates"]
30+
2631
# -- General configuration ------------------------------------------------
2732

2833
# General information about the project.

doc/templates/layout.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
{# Import the theme's layout. #}
33
{% extends "!layout.html" %}
44

5+
{# SIDE NAV, TOGGLES ON MOBILE #}
6+
{% block menu %}
7+
<nav class="doc-menu-vertical" role="navigation">
8+
{% set toctree = toctree(maxdepth=-1, collapse=False,titles_only=True, includehidden=True) %}
9+
{{ toctree }}
10+
</nav>
11+
{% endblock %}
512

613
{%- block extrahead %}
714
<script>

0 commit comments

Comments
 (0)