1+ <!--
2+ Copyright (c) 2016-2023 Martin Donath <[email protected] > 3+ Permission is hereby granted, free of charge, to any person obtaining a copy
4+ of this software and associated documentation files (the "Software"), to
5+ deal in the Software without restriction, including without limitation the
6+ rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7+ sell copies of the Software, and to permit persons to whom the Software is
8+ furnished to do so, subject to the following conditions:
9+ The above copyright notice and this permission notice shall be included in
10+ all copies or substantial portions of the Software.
11+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13+ FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
14+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
16+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
17+ IN THE SOFTWARE.
18+ -->
19+
20+ <!-- Actions -->
21+ {% if page.edit_url %}
22+
23+ <!-- Edit button -->
24+ {% if "content.action.edit" in features %}
25+ < a
26+ href ="{{ page.edit_url }} "
27+ title ="{{ lang.t('action.edit') }} "
28+ class ="md-content__button md-icon "
29+ >
30+ {% set icon = config.theme.icon.edit or "material/file-edit-outline" %}
31+ {% include ".icons/" ~ icon ~ ".svg" %}
32+ </ a >
33+ {% endif %}
34+
35+ <!-- View button -->
36+ {% if "content.action.view" in features %}
37+ < a
38+ href ="{{ page.edit_url | replace('edit', 'blob') }} "
39+ title ="{{ lang.t('action.view') }} "
40+ class ="md-content__button md-icon "
41+ >
42+ {% set icon = config.theme.icon.view or "material/file-eye-outline" %}
43+ {% include ".icons/" ~ icon ~ ".svg" %}
44+ </ a >
45+ {% endif %}
46+ {% endif %}
0 commit comments