Skip to content

Commit

Permalink
Add "Edit on Github"
Browse files Browse the repository at this point in the history
  • Loading branch information
sorrycc committed Jul 1, 2024
1 parent 060d2dd commit 6524b09
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export async function build() {
let template = fs.readFileSync(templatePath, 'utf-8');
let htmlContent2 = ejs.render(template, {
content: htmlContent,
editUrl: `https://github.com/umijs/makojs.dev/edit/master/docs/${markdown}`,
title: attributes.title || '',
isHome: html === 'index.html',
});
Expand Down
9 changes: 6 additions & 3 deletions templates/default.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,12 @@
</aside>
<article>
<%- content %>
<footer>
Copyright © 2024-present
</footer>
<div style="margin-top:36px">
Edit this page on <a href="<%= editUrl %>" target="_blank">GitHub</a>
</div>
<footer>
Copyright © 2024-present
</footer>
</article>
</main>

Expand Down
9 changes: 6 additions & 3 deletions templates/default_zh-CN.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -446,9 +446,12 @@
</aside>
<article>
<%- content %>
<footer>
Copyright © 2024-present
</footer>
<div style="margin-top:36px">
在 <a href="<%= editUrl %>">GitHub</a> 上编辑此页
</div>
<footer>
Copyright © 2024-present
</footer>
</article>
</main>

Expand Down

0 comments on commit 6524b09

Please sign in to comment.