Skip to content

Commit

Permalink
misc(v2): nit
Browse files Browse the repository at this point in the history
  • Loading branch information
yangshun committed Oct 9, 2019
1 parent 3180262 commit 340d232
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 42 deletions.
8 changes: 4 additions & 4 deletions CHANGELOG-2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
## Unreleased

- Docs, pages plugin is rewritten in TypeScript
- Docs sidebar can now be more than one level deep, theoretically up to infinity
- Collapsible docs sidebar!
- Add `editUrl` option (URL for editing) to docs plugin. If this field is set, there will be "Edit" button for each document page. Example: 'https://github.com/facebook/docusaurus/edit/master/docs'.
- More documentation ...
- Docs sidebar can now be more than one level deep - theoretically up to infinity, but 3-4 layers is the practical limit
- Collapsible docs sidebar! This is ideal for projects with a long list of docs
- Add `editUrl` option (URL for editing) to docs plugin. If this field is set, there will be an "Edit this page" link for each doc page. Example: 'https://github.com/facebook/docusaurus/edit/master/docs'.
- More documentation...

## 2.0.0-alpha.25

Expand Down
20 changes: 10 additions & 10 deletions packages/docusaurus-theme-classic/src/theme/DocLegacyItem/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,23 +66,23 @@ function DocLegacyItem(props) {
<div className="col">
<div className={styles.docItemContainer}>
<header>
{editUrl && (
<a
className={styles.editButton}
href={editUrl}
target="_blank"
rel="noreferrer noopener">
{'Edit'}
</a>
)}
<h1 className="margin-bottom--lg">{metadata.title}</h1>
</header>
<article>
<div className="markdown">
<DocContent />
</div>
</article>
<div className="margin-top--xl margin-bottom--lg">
{editUrl && (
<div className="margin-vert--lg">
{editUrl && (
<a href={editUrl} target="_blank" rel="noreferrer noopener">
Edit this page
</a>
)}
</div>
)}
<div className="margin-vert--lg">
<DocLegacyPaginator metadata={metadata} />
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,3 @@
display: none;
}
}

.editButton {
float: right;
margin-top: 5px;
display: flex;
align-items: center;
font-size: 14px;
font-weight: 500;
line-height: 1em;
height: 30px;
border-width: 1px;
border-style: solid;
border-radius: 3px;
transition: all 0.2s ease-out 0s;
text-decoration: none !important;
padding: 5px 16px;
}

.editButton:hover {
color: var(--ifm-font-base-color);
}

@media only screen and (max-width: 997px) {
.editButton {
display: none;
}
}
2 changes: 1 addition & 1 deletion website/docs/advanced-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ module.exports = {
/**
* URL for editing docs, example: 'https://github.com/facebook/docusaurus/edit/master/website/docs/'
*/
editUrl: '',
editUrl: 'https://github.com/repo/project/website/docs/',
/**
* URL route for the blog section of your site
* do not include trailing slash
Expand Down

0 comments on commit 340d232

Please sign in to comment.