Skip to content

Commit

Permalink
feat(v1): allow specifying meta desc in front matter
Browse files Browse the repository at this point in the history
  • Loading branch information
yangshun committed Oct 19, 2019
1 parent e408d72 commit 233dece
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/getting-started-installation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
id: installation
title: Installation
description: Docusaurus was designed from the ground up to be easily installed and used to get your website up and running quickly!
---

Docusaurus was designed from the ground up to be easily installed and used to get your website up and running quickly.
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-1.x/lib/core/DocsLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class DocsLayout extends React.Component {
separateOnPageNav: hasOnPageNav,
})}
title={title}
description={content.trim().split('\n')[0]}
description={metadata.description || content.trim().split('\n')[0]}
language={metadata.language}
version={metadata.version}
metadata={metadata}>
Expand Down
5 changes: 4 additions & 1 deletion packages/docusaurus-1.x/lib/server/readMetadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const SupportedHeaderFields = new Set([
'hide_title',
'layout',
'custom_edit_url',
'description',
]);

let allSidebars;
Expand Down Expand Up @@ -175,7 +176,9 @@ function processMetadata(file, refDir) {
versionPart = 'next/';
}

metadata.permalink = `${docsPart}${langPart}${versionPart}${metadata.id}.html`;
metadata.permalink = `${docsPart}${langPart}${versionPart}${
metadata.id
}.html`;

// change ids previous, next
metadata.localized_id = metadata.id;
Expand Down

0 comments on commit 233dece

Please sign in to comment.