Skip to content
This repository was archived by the owner on Aug 8, 2022. It is now read-only.

feat: enable edit link #650

Merged
merged 4 commits into from
Aug 16, 2021
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
2 changes: 1 addition & 1 deletion src/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ module.exports = {
],
repo: 'vuejs/docs-next-zh-cn',
editLinks: true,
editLinkText: '在 GitHub 上编辑',
editLinkText: '在 GitHub 上编辑此页',
lastUpdated: '最近更新时间',
docsDir: 'src',
sidebarDepth: 2,
Expand Down
2 changes: 1 addition & 1 deletion src/.vuepress/theme/components/Page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<slot name="top" />

<Content class="theme-default-content" />
<!-- <PageEdit /> -->
<PageEdit />

<PageNav v-bind="{ sidebarItems }" />

Expand Down
29 changes: 16 additions & 13 deletions src/.vuepress/theme/components/PageEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,22 @@
<footer class="page-edit">
<div class="container">
<p>
Deployed on
<a href="https://url.netlify.com/HJ8X2mxP8">Netlify</a>.
<span v-if="editLink" class="edit-link">
Caught a mistake or want to contribute to the documentation?
<a
:href="editLink"
target="_blank"
rel="noopener noreferrer"
>
{{ editLinkText }}
<OutboundLink />
</a>
</span>
<!--部署于-->
<!--<a href="https://url.netlify.com/HJ8X2mxP8">Netlify</a>。-->
<template v-if="editLink">
<!--<br />-->
<span class="edit-link">
发现了错误或者想要为文档做贡献?
<a
:href="editLink"
target="_blank"
rel="noopener noreferrer"
>
{{ editLinkText }}
<OutboundLink />
</a>
</span>
</template>
<template v-if="lastUpdated" class="last-updated">
<br />
<span class="prefix">{{ lastUpdatedText }}:</span>
Expand Down