mirror of
https://github.com/modernweb-dev/rocket.git
synced 2026-03-21 15:54:57 +00:00
Compare commits
2 Commits
@rocket/dr
...
@rocket/cl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8eeebbc978 | ||
|
|
32f39ae96a |
@@ -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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@rocket/cli",
|
||||
"version": "0.1.3",
|
||||
"version": "0.1.4",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
|
||||
@@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user