Compare commits

..

2 Commits

Author SHA1 Message Date
github-actions[bot]
8eeebbc978 Version Packages 2021-01-07 16:50:42 +01:00
Thomas Allmer
32f39ae96a fix(cli): while watching an update should not hide navigation 2021-01-07 16:47:51 +01:00
3 changed files with 23 additions and 20 deletions

View File

@@ -1,5 +1,11 @@
# @rocket/cli
## 0.1.4
### Patch Changes
- 32f39ae: An updated triggered via watch should not hide the main navgiation.
## 0.1.3
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@rocket/cli",
"version": "0.1.3",
"version": "0.1.4",
"publishConfig": {
"access": "public"
},

View File

@@ -9,30 +9,25 @@ function getDirectories(source) {
.map(dirent => dirent.name);
}
let needSetForAll = true;
/**
* adds title from markdown headline to all pages
*
* @param collection
*/
function setTitleForAll(collection) {
if (needSetForAll) {
const all = collection.getAll();
all.forEach(page => {
page.data.addTitleHeadline = true;
const titleData = processContentWithTitle(
page.template.inputContent,
page.template._templateRender._engineName,
);
if (titleData) {
page.data.title = titleData.title;
page.data.eleventyNavigation = { ...titleData.eleventyNavigation };
page.data.addTitleHeadline = false;
}
});
needSetForAll = false;
}
const all = collection.getAll();
all.forEach(page => {
page.data.addTitleHeadline = true;
const titleData = processContentWithTitle(
page.template.inputContent,
page.template._templateRender._engineName,
);
if (titleData) {
page.data.title = titleData.title;
page.data.eleventyNavigation = { ...titleData.eleventyNavigation };
page.data.addTitleHeadline = false;
}
});
}
const rocketCollections = {
@@ -57,7 +52,6 @@ const rocketCollections = {
// docs = addPrevNextUrls(docs);
setTitleForAll(collection);
return docs;
});
}
@@ -76,6 +70,9 @@ const rocketCollections = {
(b.data && b.data.eleventyNavigation && b.data.eleventyNavigation.order) || 0;
return aOrder - bOrder;
});
setTitleForAll(collection);
return headers;
});
}