Skip to content

Commit

Permalink
Merge pull request docker#1127 from joaofnfernandes/edit-button
Browse files Browse the repository at this point in the history
Remove 'edit this page' button when there's no source file
  • Loading branch information
joaofnfernandes authored Jan 17, 2017
2 parents 46b8c31 + d3be283 commit df68f49
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions _layouts/docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
{% endif %}
{% endfor %}
{% endif %}
<!-- edit overrides -->
{% for override in site.data.not_edited_here.overrides %}
{% if page.url contains override.path %}
{% assign overridden="true" %}
{% capture editsource %}{{ override.source }}{{ page.path }}{% endcapture %}
{% break %}
{% endif %}
<!-- Logic for 'edit this button' -->
{% assign edit_url = "https://github.com/docker/docker.github.io/edit/master/" | append: page.path %}
{% for entry in site.data.not_edited_here.overrides %}
{% if page.url contains entry.path %}
{% if entry.source %}{% assign edit_url = entry.source %}{% else %}{% assign edit_url = "" %}{% endif %}
{% break %}
{% endif %}
{% endfor %}
{% if overridden != "true" %}{% capture editsource %}https://github.com/docker/docker.github.io/edit/master/{{ page.path }}{% endcapture %}{% endif %}
<!-- Start of {{ page.path }} -->

<!-- End of logic for 'edit this button' -->
<!DOCTYPE html>
<html class="js flexbox flexboxlegacy canvas canvastext webgl no-touch geolocation postmessage websqldatabase indexeddb hashchange history draganddrop websockets rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow opacity cssanimations csscolumns cssgradients cssreflections csstransforms no-csstransforms3d csstransitions fontface no-generatedcontent video audio localstorage sessionstorage webworkers applicationcache svg inlinesvg smil svgclippaths retina-display is_not_retina chrome version webkit" lang="en">
<head>
Expand Down Expand Up @@ -211,7 +211,9 @@
<div style="text-align: center; margin-top: 50px">
<img src="/images/chat.png" alt="chat icon" style="margin-right: 10px">
<b>Feedback?</b> Suggestions? Can't find something in the docs?<br/>
<a href="https://github.com/docker/docker.github.io/edit/master/{{ page.path }}" class="nomunge">Edit this page</a> <span style="color:#D8E0E0">&#9679;</span>
{% if edit_url != "" %}
<a href="https://github.com/docker/docker.github.io/edit/master/{{ page.path }}" class="nomunge">Edit this page</a> <span style="color:#D8E0E0">&#9679;</span>
{% endif %}
<a href="https://github.com/docker/docker.github.io/issues/new?title=Feedback for: {{ page.path }}&assignee={% if page.assignee %}{{ page.assignee }}{% else %}{{ page.defaultassignee }}{% endif %}&body=File: [{{ page.path }}](https://docs.docker.com{{ page.url }})" class="nomunge">Request docs changes</a> <span style="color:#D8E0E0">&#9679;</span> <a href="https://www.docker.com/docker-support-services">Get support</a> <br />Rate this page:
<div id="pd_rating_holder_8453675"></div>
<script type="text/javascript">
Expand Down Expand Up @@ -262,7 +264,9 @@
<button type="submit" class="search-submit btn btn-default">Search</button>
</form>
</span>
<span><a href="{{ editsource }}" class="button darkblue-btn nomunge" style="color:#FFFFFF; width:100%; margin: 0px;">Edit This Page</a></span>
{% if edit_url != "" %}
<span><a href="{{ edit_url }}" class="button darkblue-btn nomunge" style="color:#FFFFFF; width:100%; margin: 0px;">Edit This Page</a></span>
{% endif %}
<nav id="TableOfContents">
</nav>
</section>
Expand Down

0 comments on commit df68f49

Please sign in to comment.