| 1 |
{% if page.edit_url %} |
| 2 |
|
| 3 |
{% set toolname = page.file.src_path.split("/")[-1] | replace(".md", "") %} |
| 4 |
{# Default to the normal edit URL #} |
| 5 |
{% set ghpath = github_path(toolname, config.extra.source_docs) %} |
| 6 |
{% if ghpath %} |
| 7 |
{% set custom_edit_url = page.edit_url | replace(page.edit_url, ghpath ~ "/" ~ toolname ~ ".md") %} |
| 8 |
{% if "content.action.edit" in features %} |
| 9 |
<a href="{{ custom_edit_url }}" title="{{ lang.t('action.edit') }}" class="md-content__button md-icon"> |
| 10 |
{% set icon = config.theme.icon.edit or "material/file-edit-outline" %} |
| 11 |
{% include ".icons/" ~ icon ~ ".svg" %} |
| 12 |
</a> |
| 13 |
{% endif %} |
| 14 |
|
| 15 |
{% if "content.action.view" in features %} |
| 16 |
{% if "/blob/" in custom_edit_url %} |
| 17 |
{% set part = "/blob/" %} |
| 18 |
{% else %} |
| 19 |
{% set part = "/edit/" %} |
| 20 |
{% endif %} |
| 21 |
<a href="{{ custom_edit_url | replace(part, '/tree/') }}" title="{{ lang.t('action.view') }}" class="md-content__button md-icon"> |
| 22 |
{% set icon = config.theme.icon.view or "material/file-eye-outline" %} |
| 23 |
{% include ".icons/" ~ icon ~ ".svg" %} |
| 24 |
</a> |
| 25 |
{% endif %} |
| 26 |
{% endif %} |
| 27 |
{% endif %} |