1
0
mirror of https://github.com/LearnOpenGL-CN/LearnOpenGL-CN.git synced 2025-08-22 20:25:28 +08:00

update mkdocs to be compatible with python 3.7+

fix #261
This commit is contained in:
krasjet
2023-04-26 02:52:19 +00:00
parent 67c73ccb4f
commit 12e0c5cf99
13 changed files with 44 additions and 151 deletions

View File

@@ -1,20 +1,20 @@
{% if meta.source %}
{% if page.meta.source %}
<div class="source-links">
{% for filename in meta.source %}
{% for filename in page.meta.source %}
<span class="label label-primary">{{ filename }}</span>
{% endfor %}
</div>
{% endif %}
{{ content }}
{{ page.content }}
<div id="disqus_thread"></div>
<script>
(function() {
var d = document, s = d.createElement('script');
s.src = '//learnopengl-cn.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();

View File

@@ -4,13 +4,12 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{% if page_description %}<meta name="description" content="{{ page_description }}">{% endif %}
{% if site_author %}<meta name="author" content="{{ site_author }}">{% endif %}
{% if canonical_url %}<link rel="canonical" href="{{ canonical_url }}">{% endif %}
{% if favicon %}<link rel="shortcut icon" href="{{ favicon }}">
{% else %}<link rel="shortcut icon" href="{{ base_url }}/img/favicon.ico">{% endif %}
{% if config.site_description %}<meta name="description" content="{{ config.site_description }}">{% endif %}
{% if config.site_author %}<meta name="author" content="{{ config.site_author }}">{% endif %}
{% if page.canonical_url %}<link rel="canonical" href="{{ page.canonical_url }}">{% endif %}
<link rel="shortcut icon" href="{{ base_url }}/img/favicon.ico">
<title>{% if page_title %}{{ page_title }} - {% endif %}{{ site_name }}</title>
<title>{% if page.title %}{{ page.title }} - {% endif %}{{ config.site_name }}</title>
<link href="{{ base_url }}/css/bootstrap-custom.min.css" rel="stylesheet">
<link href="{{ base_url }}/css/font-awesome-4.0.3.css" rel="stylesheet">
@@ -57,7 +56,6 @@
<script src="{{ base_url }}/js/bootstrap-3.0.3.min.js"></script>
<script src="{{ base_url }}/js/highlight.pack.js"></script>
<script>var base_url = '{{ base_url }}';</script>
<script data-main="{{ base_url }}/mkdocs/js/search.js" src="{{ base_url }}/mkdocs/js/require.js"></script>
<script src="{{ base_url }}/js/base.js"></script>
{%- for path in extra_javascript %}
<script src="{{ path }}"></script>

View File

@@ -1,6 +1,6 @@
{% if not nav_item.children %}
<li {% if nav_item.active %}class="active"{% endif %}>
<a href="{{ nav_item.url }}">{{ nav_item.title }}</a>
<a href="{{ nav_item.url|url }}">{{ nav_item.title }}</a>
</li>
{% else %}
<li class="dropdown-submenu">

View File

@@ -12,7 +12,7 @@
</button>
<!-- Main title -->
<a class="navbar-brand" href="{{ homepage_url }}">{{ site_name }}</a>
<a class="navbar-brand" href="{{ nav.homepage.url|url }}">{{ config.site_name }}</a>
</div>
<!-- Expanded navigation -->
@@ -31,7 +31,7 @@
</li>
{% else %}
<li {% if nav_item.active %}class="active"{% endif %}>
<a href="{{ nav_item.url }}">{{ nav_item.title }}</a>
<a href="{{ nav_item.url|url }}">{{ nav_item.title }}</a>
</li>
{% endif %}
{% endfor %}
@@ -44,25 +44,25 @@
<i class="fa fa-search"></i> 搜索
</a>
</li>
<li {% if not previous_page %}class="disabled"{% endif %}>
<a rel="next" {% if previous_page %}href="{{ previous_page.url }}"{% endif %}>
<li {% if not page.previous_page %}class="disabled"{% endif %}>
<a rel="next" {% if page.previous_page %}href="{{ page.previous_page.url|url }}"{% endif %}>
<i class="fa fa-arrow-left"></i> 上一节
</a>
</li>
<li {% if not next_page %}class="disabled"{% endif %}>
<a rel="prev" {% if next_page %}href="{{ next_page.url }}"{% endif %}>
<li {% if not page.next_page %}class="disabled"{% endif %}>
<a rel="prev" {% if page.next_page %}href="{{ page.next_page.url|url }}"{% endif %}>
下一节 <i class="fa fa-arrow-right"></i>
</a>
</li>
{% if repo_url %}
{% if config.repo_url %}
<li>
<a href="{{ repo_url }}">
{% if repo_name == 'GitHub' %}
<a href="{{ config.repo_url }}">
{% if config.repo_name == 'GitHub' %}
<i class="fa fa-github"></i>
{% elif repo_name == 'Bitbucket' %}
{% elif config.repo_name == 'Bitbucket' %}
<i class="fa fa-bitbucket"></i>
{% endif %}
{{ repo_name }}
{{ config.repo_name }}
</a>
</li>
{% endif %}

View File

@@ -1,9 +1,9 @@
<div class="bs-sidebar hidden-print affix well" role="complementary">
<ul class="nav bs-sidenav">
{% for toc_item in toc %}
<li class="main {% if toc_item.active %}active{% endif %}"><a href="{{ toc_item.url }}">{{ toc_item.title }}</a></li>
{% for toc_item in page.toc %}
<li class="main {% if toc_item.active %}active{% endif %}"><a href="{{ toc_item.url|url }}">{{ toc_item.title }}</a></li>
{% for toc_item in toc_item.children %}
<li><a href="{{ toc_item.url }}">{{ toc_item.title }}</a></li>
<li><a href="{{ toc_item.url|url }}">{{ toc_item.title }}</a></li>
{% endfor %}
{% endfor %}
</ul>