sergeche / docpad-plugin-menu Goto Github PK
View Code? Open in Web Editor NEWA DocPad plugin for menu generation
A DocPad plugin for menu generation
I do some console.log
s where page
is the element of the result of the generateMenu
function:
document.url
and page.url
have the same value: /website/de/index.html
but page.state
is false
As per the discussion in #12, the "menu" plugin is not compatible with the "cleanurls" plugin.
For me the skipfiles parameter (set in docpad.coffee) only works if i change item.slug
variable in line 102 in menu.pugin.js:
if ((_ref = options.skipFiles) != null ? _ref.test(item.slug) : void 0) {
to item.url
:
if ((_ref = options.skipFiles) != null ? _ref.test(item.url) : void 0) {
when I change the flag optimize
to false then the result from generateMenu
become flat without any children.
The emmett docs samples are setup like this:
src/
documents/
abbreviations/
index.html.md
implicit-names/
index.html.md
lorem-ipsem/
index.html.md
syntax/
index.html.md
types/
index.html.md
I wanted a setup more like this:
src/
documents/
abbreviations/
index.html.md.eco
implicit-names.html.md.eco
lorem-ipsem.html.md.eco
syntax.html.md.eco
type.html.md.eco
This didn't work. Not only did I not get the desired menu, but the menu partial broke and non of my pages rendered correctly.
Specifically, I would the error:
Rendering the extension "eco" to "html" on "page.html.eco" didn't do anything.
page.html.eco was my layout containing the menu. It renders fine when I use the deeper structure but breaks as soon as I have children without extra folders.
I'm currently evaluating DocPad and came across your plugin and emmet doc sample site. This looks like it works well for a single product documentation site but I have an additional need and I was wondering if this is already a feature I haven't found or something that could be added.
I want to structure my folders under the root with a folder for each product, each product would have subfolders that would be considered topics with the index.html document being the page for the topic. Also in that same topic subfolder I would have additional documents that would show as leafs for the topic.
Something like this:
Then in each of the pages within a Product, I'd like to show only the menu items that exist within that Product. I guess in the template you'd have to pass in the second level folder name and limit only urls that are below that.
I hope this makes sense.
If optimize
option set to true
then there is no root index.html document in generated menu structure. But what if I need to include it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.