Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the "Edit on GitHub" button to support version branches. #80

Merged
merged 1 commit into from
Jun 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## vNEXT

* Allow the "Edit on GitHub" button to work on "versioned" documentation.
[PR #TODO](https://github.com/meteor/meteor-theme-hexo/pull/TODO)

## v1.0.13

* Align headings with tiered structure content.
Expand Down
15 changes: 12 additions & 3 deletions layout/page.ejs
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
<% var githubUrl = 'https://github.com/' + config.github_repo +
'/tree/master/' + (config.content_root || 'content') + '/' +
page.path.replace(/\.html$/, '.md'); %>
<%
var githubUrl =
'https://github.com/' +
config.github_repo +
'/tree/' +
// If on a version, use the `version-X` branch, not `master`.
(config.version ? 'version-' + config.version : 'master') +
'/' +
(config.content_root || 'content') +
'/' +
page.path.replace(/\.html$/, '.md');
%>

<div class="nav <%- config.nav_class %>">
<div class="nav-group left">
Expand Down