Skip to content

Commit 1a6ee7c

Browse files
committed
repo link in documentation
1 parent 9c2a66c commit 1a6ee7c

3 files changed

Lines changed: 42 additions & 0 deletions

File tree

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ site_url: https://docs.vizion3d.org/
33
site_description: Unified 3D Computer Vision Library
44
theme:
55
name: material
6+
custom_dir: overrides
67
features:
78
- navigation.tabs
89
- navigation.sections

overrides/404.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{#-
2+
Keep the repo link visible on MkDocs' standalone 404 page as well.
3+
-#}
4+
{% extends "main.html" %}
5+
6+
{% block content %}
7+
<h1>404 - Not found</h1>
8+
<p class="vizion3d-repo-link">
9+
<a href="https://github.com/OlafenwaMoses/vizion3D" target="_blank" rel="noopener">
10+
GitHub repository: OlafenwaMoses/vizion3D
11+
</a>
12+
</p>
13+
{% endblock %}

overrides/partials/content.html

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{#-
2+
This file extends MkDocs Material's content partial so every page shows the
3+
project repository link immediately under the rendered page title.
4+
-#}
5+
{% include "partials/tags.html" %}
6+
{% include "partials/actions.html" %}
7+
8+
{% set repo_link %}
9+
<p class="vizion3d-repo-link">
10+
<b>Repository</b>: <a href="https://github.com/OlafenwaMoses/vizion3D" target="_blank" rel="noopener"> https://github.com/OlafenwaMoses/vizion3D
11+
</a>
12+
</p>
13+
{% endset %}
14+
15+
{% if "\u003ch1" not in page.content %}
16+
<h1>{{ page.title | d(config.site_name, true)}}</h1>
17+
{{ repo_link }}
18+
{{ page.content }}
19+
{% else %}
20+
{% set content_parts = page.content.split("</h1>", 1) %}
21+
{{ content_parts[0] | safe }}</h1>
22+
{{ repo_link }}
23+
{{ content_parts[1] | safe }}
24+
{% endif %}
25+
26+
{% include "partials/source-file.html" %}
27+
{% include "partials/feedback.html" %}
28+
{% include "partials/comments.html" %}

0 commit comments

Comments
 (0)