1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-24 15:40:15 +01:00

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 %}
<script src="{{ base_url }}/assets/javascripts/modernizr-934476c231.js"></script>
{% endblock %}
{% block webfonts %}
{% include "partials/webfonts.html" %}
{% block fonts %}
{% include "partials/fonts.html" %}
{% endblock %}
{% 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 %}
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-535e87ca3f.palette.css">
{% endif %}
@ -85,6 +85,11 @@
{% endblock %}
<div class="md-content">
<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 %}
{% if not "\x3ch1 id=" in page.content %}
<h1>{{ page.title | default(config.site_name, true)}}</h1>

View File

@ -41,17 +41,21 @@
&__inner {
margin: 2.4rem 1.6rem;
// Hack: this is necessary for floating the edit button
// overflow: auto;
// [screen +]: Increase spacing
@include break-from-device(screen) {
margin: 2.4rem;
}
}
// Copyright and theme information
&__copyright {
display: block;
// Icons (edit button)
&__edit {
@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 %}
<!-- Block: webfonts -->
{% block webfonts %}
{% include "partials/webfonts.html" %}
{% block fonts %}
{% include "partials/fonts.html" %}
{% endblock %}
<!-- Block: stylesheets -->
@ -165,6 +165,14 @@
<div class="md-content">
<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 %}