Fork/branch-aware edit on GH links, part 1/?

This commit is contained in:
mDuo13
2018-03-07 14:41:33 -08:00
parent 34e74eb51a
commit 560c84f4f9
3 changed files with 18 additions and 3 deletions

View File

@@ -40,9 +40,15 @@ targets:
# First member is the default that gets built when target not specified
- name: local
display_name: Ripple Developer Portal
# These github_ fields are used by the template's "Edit on GitHub" link.
# Override them with --vars to change which fork/branch to edit.
github_fork: ripple
github_branch: master
- name: ripple.com
display_name: Ripple Developer Center
github_fork: ripple
github_branch: master
template: template-contentwithtoc.html
link_subs:
"reference-rippled.html": https://ripple.com/build/rippled-apis/
@@ -61,7 +67,7 @@ targets:
"tutorial-escrow.html": https://ripple.com/build/escrow-tutorials/
"tutorial-listing-xrp.html": https://ripple.com/build/listing-xrp-exchange/
"concept-cryptographic-keys.html": https://ripple.com/build/cryptographic-keys/
"working-regular-key-pair.html": https://ripple.com/build/working-regular-key-pair/
"tutorial-regular-keys.html": https://ripple.com/build/working-regular-key-pair/
"tutorial-build-run-rippled-ubuntu.html": https://ripple.com/build/build-run-rippled-ubuntu/
"concept-accounts.html": https://ripple.com/build/accounts/
"concept-amendments.html": https://ripple.com/build/amendments/

View File

@@ -2,6 +2,11 @@
# meant to be run from the root directory of the repo
## Test: show pull request data in build results
echo "ghprbAuthorRepoGitUrl is: " ${ghprbAuthorRepoGitUrl}
echo "ghprbSourceBranch is: " ${ghprbSourceBranch}
echo "ghprbPullId is: " ${ghprbPullId}
set -e
tool/conflictmarkers.sh

View File

@@ -55,9 +55,13 @@
<div class="draft-warning">DRAFT PAGE</div>
<div class="github-edit-wrap">
{% if currentpage.md is defined %}
{% set githuburl = "https://github.com/ripple/ripple-dev-portal/edit/master/content/" + currentpage.md %}
{% set githuburl = "https://github.com/"
+ target.github_fork + "/ripple-dev-portal/edit/"
+ target.github_branch + "/content/" + currentpage.md %}
{% elif currentpage.template is defined %}
{% set githuburl = "https://github.com/ripple/ripple-dev-portal/edit/master/tool/" + currentpage.template %}
{% set githuburl = "https://github.com/"
+ target.github_fork + "/ripple-dev-portal/edit/"
+ target.github_branch + "/tool/" + currentpage.template %}
{% else %}
{% set githuburl = "https://github.com/ripple/ripple-dev-portal/" %}
{% endif %}