fix(aio): reposition and simplify github links (#22565)

Closes #22379

PR Close #22565
This commit is contained in:
Pete Bacon Darwin
2018-03-02 23:32:12 +00:00
committed by Alex Eagle
parent b80fd6be58
commit 41064fcb36
6 changed files with 33 additions and 20 deletions

View File

@ -2,7 +2,11 @@
{% set comma = joiner(',') %}
{% set slash = joiner('/') %}
<article>
<div class="breadcrumb">
<div class="page-actions">
<a href="{$ github.githubEditHref(doc, versionInfo) $}" aria-label="Suggest Edits" title="Suggest Edits"><i class="material-icons" aria-hidden="true" role="img">mode_edit</i></a>
<a href="{$ github.githubViewHref(doc, versionInfo) $}" aria-label="View Source" title="View Source"><i class="material-icons" aria-hidden="true" role="img">code</i></a>
</div>
<div class="breadcrumb">
<script type="application/ld+json">
{
"@context": "http://schema.org",
@ -33,10 +37,6 @@
<h1>{$ doc.name $}</h1>
<span class="version">{$ version $}</span>
</header>
<div class="page-actions">
<a href="#"><label class="raised page-label"><i class="material-icons">mode_edit</i>suggest edits</label></a>
<a href="{$ github.githubHref(doc, versionInfo) $}"><label class="raised page-label"><i class="material-icons">code</i>view source</label></a>
</div>
<div class="api-body">
{% block body %}{% endblock %}

View File

@ -1,7 +1,8 @@
{% macro githubHref(doc, versionInfo) -%}
{% macro githubViewHref(doc, versionInfo) -%}
https://github.com/{$ versionInfo.gitRepoInfo.owner $}/{$ versionInfo.gitRepoInfo.repo $}/tree/{$ versionInfo.currentVersion.isSnapshot and versionInfo.currentVersion.SHA or versionInfo.currentVersion.raw $}/packages/{$ doc.fileInfo.realProjectRelativePath $}#L{$ doc.startingLine + 1 $}-L{$ doc.endingLine + 1 $}
{%- endmacro %}
{% macro githubViewLink(doc, versionInfo) -%}
<a href="{$ githubHref(doc, versionInfo) $}">{$ doc.fileInfo.realProjectRelativePath $}</a>
{%- endmacro %}
{% macro githubEditHref(doc, versionInfo) -%}
https://github.com/{$ versionInfo.gitRepoInfo.owner $}/{$ versionInfo.gitRepoInfo.repo $}/edit/master/packages/{$ doc.fileInfo.realProjectRelativePath $}?message=docs({$ doc.moduleDoc.id | escape $})%3A%20describe%20your%20change...#L{$ doc.startingLine + 1 $}-L{$ doc.endingLine + 1 $}
{%- endmacro %}