Re-add edit link

This commit is contained in:
squidfunk 2016-12-28 12:11:04 +01:00
parent e1310aa9ee
commit 84dd88af69
7 changed files with 29 additions and 12 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -32,11 +32,11 @@
{% block libs %} {% block libs %}
<script src="{{ base_url }}/assets/javascripts/modernizr-934476c231.js"></script> <script src="{{ base_url }}/assets/javascripts/modernizr-934476c231.js"></script>
{% endblock %} {% endblock %}
{% block webfonts %} {% block fonts %}
{% include "partials/webfonts.html" %} {% include "partials/fonts.html" %}
{% endblock %} {% endblock %}
{% block styles %} {% block styles %}
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-7515027b77.css"> <link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-7b7465c8b1.css">
{% if config.extra.palette %} {% if config.extra.palette %}
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-535e87ca3f.palette.css"> <link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-535e87ca3f.palette.css">
{% endif %} {% endif %}
@ -85,6 +85,11 @@
{% endblock %} {% endblock %}
<div class="md-content"> <div class="md-content">
<article class="md-content__inner md-typeset"> <article class="md-content__inner md-typeset">
{% if config.edit_uri %}
<a href="{{ page.edit_url }}" title="Edit this page" class="md-icon md-content__edit">
edit
</a>
{% endif %}
{% block content %} {% block content %}
{% if not "\x3ch1 id=" in page.content %} {% if not "\x3ch1 id=" in page.content %}
<h1>{{ page.title | default(config.site_name, true)}}</h1> <h1>{{ page.title | default(config.site_name, true)}}</h1>

View File

@ -41,17 +41,21 @@
&__inner { &__inner {
margin: 2.4rem 1.6rem; margin: 2.4rem 1.6rem;
// Hack: this is necessary for floating the edit button
// overflow: auto;
// [screen +]: Increase spacing // [screen +]: Increase spacing
@include break-from-device(screen) { @include break-from-device(screen) {
margin: 2.4rem; margin: 2.4rem;
} }
} }
// Copyright and theme information // Icons (edit button)
&__copyright { &__edit {
display: block; @extend %md-icon__button;
float: right;
// [tablet portrait -]: Align edit link with search icon
@include break-to-device(tablet portrait) {
margin-right: -0.8rem;
}
} }
} }

View File

@ -74,8 +74,8 @@
{% endblock %} {% endblock %}
<!-- Block: webfonts --> <!-- Block: webfonts -->
{% block webfonts %} {% block fonts %}
{% include "partials/webfonts.html" %} {% include "partials/fonts.html" %}
{% endblock %} {% endblock %}
<!-- Block: stylesheets --> <!-- Block: stylesheets -->
@ -165,6 +165,14 @@
<div class="md-content"> <div class="md-content">
<article class="md-content__inner md-typeset"> <article class="md-content__inner md-typeset">
<!-- Edit button, if URL was defined -->
{% if config.edit_uri %}
<a href="{{ page.edit_url }}" title="Edit this page"
class="md-icon md-content__edit">
edit
</a>
{% endif %}
<!-- Block: content --> <!-- Block: content -->
{% block content %} {% block content %}