mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-30 15:00:09 +02:00
Use information from "docSidebar.js" file instead of doc front matters for sidebars.
This commit is contained in:
parent
69ba05e4f1
commit
abc5e325cd
9 changed files with 190 additions and 35 deletions
|
@ -41,11 +41,13 @@ function execute() {
|
|||
files.forEach(file => {
|
||||
const extension = path.extname(file);
|
||||
if (extension === ".md" || extension === ".markdown") {
|
||||
const metadata = readMetadata.extractMetadata(
|
||||
fs.readFileSync(file, "utf8")
|
||||
).metadata;
|
||||
const res = readMetadata.processMetadata(file);
|
||||
if (!res) {
|
||||
return
|
||||
}
|
||||
const metadata = res.metadata;
|
||||
|
||||
translations["localized-strings"][metadata.id] = metadata.title;
|
||||
translations["localized-strings"][metadata.localized_id] = metadata.title;
|
||||
translations["localized-strings"][metadata.category] = metadata.category;
|
||||
|
||||
if (metadata.sidebar_title) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue