mirror of
https://github.com/modernweb-dev/rocket.git
synced 2026-03-21 15:54:57 +00:00
Compare commits
2 Commits
@rocket/la
...
@rocket/cl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8eeebbc978 | ||
|
|
32f39ae96a |
@@ -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
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@rocket/cli",
|
"name": "@rocket/cli",
|
||||||
"version": "0.1.3",
|
"version": "0.1.4",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public"
|
"access": "public"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -9,30 +9,25 @@ 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;
|
const titleData = processContentWithTitle(
|
||||||
const titleData = processContentWithTitle(
|
page.template.inputContent,
|
||||||
page.template.inputContent,
|
page.template._templateRender._engineName,
|
||||||
page.template._templateRender._engineName,
|
);
|
||||||
);
|
if (titleData) {
|
||||||
if (titleData) {
|
page.data.title = titleData.title;
|
||||||
page.data.title = titleData.title;
|
page.data.eleventyNavigation = { ...titleData.eleventyNavigation };
|
||||||
page.data.eleventyNavigation = { ...titleData.eleventyNavigation };
|
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;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user