From 6d2904e7c2da485b2bc2a433babccd445fd0c25e Mon Sep 17 00:00:00 2001 From: John Mulhausen Date: Fri, 13 Oct 2017 15:25:11 -0700 Subject: [PATCH] Fix for upstream edits (#4949) --- _data/not_edited_here.yaml | 4 ++++ _layouts/docs.html | 35 ++++++++++++++++++++++++++++++----- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/_data/not_edited_here.yaml b/_data/not_edited_here.yaml index 799fdcbf2a..745c834845 100644 --- a/_data/not_edited_here.yaml +++ b/_data/not_edited_here.yaml @@ -14,6 +14,10 @@ overrides: - path: /apidocs/ description: "Auto-generated API docs for Docker Cloud, DTR, UCP. File an issue." +- path: /engine/api/ + description: "ReDoc/Swagger API specs" + source: https://github.com/docker/docker-ce/tree/master/components/engine/api + - path: /engine/deprecated.md description: Docker Engine deprecation reference source: https://github.com/docker/cli/tree/master/docs/deprecated.md diff --git a/_layouts/docs.html b/_layouts/docs.html index 8ac2dd33c5..5145eccfa2 100644 --- a/_layouts/docs.html +++ b/_layouts/docs.html @@ -1,12 +1,37 @@ -{% if page.path contains "index.md" %} {% capture basehref %}{{ page.url }}{% endcapture %} {% else %} {% assign crumbs = page.url | split: '/' %} {% assign stoppingpoint = crumbs | size | minus: 1 %} {% for crumb in crumbs %} {% if forloop.index == stoppingpoint -%} {% capture basehref %}{{basehref}}{{ crumb }}/{% endcapture %} {% break %} {% else %} {% capture basehref %}{{basehref}}{{ crumb }}/{% endcapture %} {% endif %} {% endfor %} {% endif %} +{% if page.path contains "index.md" %} + {% capture basehref %}{{ page.url }}{% endcapture %} +{% else %} + {% assign crumbs = page.url | split: '/' %} + {% assign stoppingpoint = crumbs | size | minus: 1 %} + {% for crumb in crumbs %} + {% if forloop.index == stoppingpoint %} + {% capture basehref %}{{basehref}}{{ crumb }}/{% endcapture %} + {% break %} + {% else %} + {% capture basehref %}{{basehref}}{{ crumb }}/{% endcapture %} + {% endif %} + {% endfor %} +{% endif %} -{% if page.assignee %}{% assign assignee=page.assignee%}{% else %}{% assign assignee=page.defaultassignee%}{% endif %} +{% if page.assignee %} + {% assign assignee=page.assignee%} +{% else %} + {% assign assignee=page.defaultassignee%} +{% endif %} -{% 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 %} +{% 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 %}