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 # @rocket/cli
## 0.1.4
### Patch Changes
- 32f39ae: An updated triggered via watch should not hide the main navgiation.
## 0.1.3 ## 0.1.3
### Patch Changes ### Patch Changes

View File

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

View File

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