Skip to content

Commit

Permalink
Make rawgit branch name customizable (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomalec authored and samuelli committed Sep 30, 2016
1 parent 882e63e commit 9194ef7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion iron-component-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,15 @@ <h2><span>[[active]]</span> <span class="version" hidden$="[[!version]]">[[versi
observer: '_srcChanged',
},

/**
* The name of a branch used to fetch source for gh-pages.
* If not specified `master` is used.
*/
branchName: {
type: String,
value: 'master'
},

/**
* The relative root for determining paths to demos and default source
* detection.
Expand Down Expand Up @@ -532,7 +541,7 @@ <h2><span>[[active]]</span> <span class="version" hidden$="[[!version]]">[[versi
// Rewrite gh-pages URLs to https://rawgit.com/
var match = srcUrl.match(/([^\/\.]+)\.github\.io\/([^\/]+)\/?([^\/]*)$/);
if (match) {
srcUrl = "https://cdn.rawgit.com/" + match[1] + "/" + match[2] + "/master/" + match[3];
srcUrl = "https://cdn.rawgit.com/" + match[1] + "/" + match[2] + "/" + this.branchName + "/" + match[3];
}

this._baseUrl = _baseUrl(srcUrl);
Expand Down

0 comments on commit 9194ef7

Please sign in to comment.