Skip to content

Commit

Permalink
Update docs build templates (#2596)
Browse files Browse the repository at this point in the history
  • Loading branch information
BernieWhite authored Dec 12, 2023
1 parent 3e9ed2a commit 8fb65c3
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 28 deletions.
3 changes: 3 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,12 @@ theme:
- navigation.sections:
level: 1
- navigation.tabs
- navigation.footer
- content.code.annotate
- content.tabs.link
- content.code.copy
- content.action.edit
- content.action.view

nav:
- Home: index.md
Expand Down
6 changes: 0 additions & 6 deletions overrides/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,3 @@
<meta name="twitter:image" content="{{ image }}" />

{% endblock %}

{% block content %}
{{ super() }}

{% include "partials/giscus.html" %}
{% endblock %}
32 changes: 32 additions & 0 deletions overrides/partials/actions.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!-- Actions - only if content is not generated -->
{% if not page.meta.generated and page.edit_url %}

<!-- Edit button -->
{% if "content.action.edit" in features %}
<a
href="{{ page.edit_url }}"
title="{{ lang.t('action.edit') }}"
class="md-content__button md-icon"
>
{% set icon = config.theme.icon.edit or "material/file-edit-outline" %}
{% include ".icons/" ~ icon ~ ".svg" %}
</a>
{% endif %}

<!-- View button -->
{% if "content.action.view" in features %}
{% if "/blob/" in page.edit_url %}
{% set part = "blob" %}
{% else %}
{% set part = "edit" %}
{% endif %}
<a
href="{{ page.edit_url | replace(part, 'raw') }}"
title="{{ lang.t('action.view') }}"
class="md-content__button md-icon"
>
{% set icon = config.theme.icon.view or "material/file-eye-outline" %}
{% include ".icons/" ~ icon ~ ".svg" %}
</a>
{% endif %}
{% endif %}
1 change: 1 addition & 0 deletions overrides/partials/comments.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{% include "partials/giscus.html" %}
33 changes: 11 additions & 22 deletions overrides/reference.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,8 @@
<!-- Content -->
{% block content %}

<!-- Edit button -->
{% if not page.meta.generated %}
{% if page.edit_url %}
<a
href="{{ page.edit_url }}"
title="{{ lang.t('edit.link.title') }}"
class="md-content__button md-icon"
>
{% include ".icons/material/pencil.svg" %}
</a>
{% endif %}
{% endif %}
<!-- Actions -->
{% include "partials/actions.html" %}

<!--
Hack: check whether the content contains a h1 headline. If it
Expand All @@ -25,17 +15,16 @@
<h1>{{ page.title | d(config.site_name, true)}}</h1>
{% endif %}

<!-- Markdown content -->
<!-- Page content -->
{{ page.content }}

<!-- Last update of source file -->
{% if page and page.meta %}
{% if page.meta.git_revision_date_localized or
page.meta.revision_date
%}
{% include "partials/source-file.html" %}
{% endif %}
{% endif %}
<!-- Source file information -->
{% include "partials/source-file.html" %}

<!-- Was this page helpful? -->
{% include "partials/feedback.html" %}

<!-- Comment system -->
{% include "partials/comments.html" %}

{% include "partials/giscus.html" %}
{% endblock %}

0 comments on commit 8fb65c3

Please sign in to comment.