Comments (16)
There was an effort towards a solution like this, but it's only partially implemented: cloudfour/drizzle-builder#71
I'll cross-reference this issue in the builder repo and revisit the WIP to see where things stand.
from drizzle.
One more note related to this: Ideally, this feature would include an update to the default Drizzle UI that nested one or more example components inside of a collection (i.e., "Components/Button" instead of just "Button").
from drizzle.
Large
from drizzle.
One more note related to this: Ideally, this feature would include an update to the default Drizzle UI that nested one or more example components inside of a collection (i.e., "Components/Button" instead of just "Button").
I agree, and I think this should be encouraged. I can make a PR for that soon.
Aside from this, is there anything else we feel is absolutely required before marking this as complete?
from drizzle.
I don't think so? It's hard to say without seeing the potentially "final" product.
from drizzle.
This file is probably the best demonstration:
https://github.com/cloudfour/drizzle/blob/master/src/templates/drizzle/nav.hbs
from drizzle.
So what about a top-level folder without an index, like "Components"? I'm curious if the departures from my example in the description (<h5>Components</h5>
) are intentional choices or not.
from drizzle.
To be clear, an index page is never a requirement, but here's what iterating over the components would look like for a typical project:
As seen in cloudfour/drizzle-builder#91
from drizzle.
Is there any way of telling if those collections contain any patterns directly, or contain only collections?
I'm basically asking if there's an intelligent way of determining when a folder should be used as an organizational heading or when it should be a link. And to me, that would be determined based on what's inside of it, right?
from drizzle.
Re-reading this issue, I'm realizing that the current helpers probably aren't going to get us to where we want to be. They all return flat arrays based on the path query.
Is this code an accurate description of what you'd like to do?
from drizzle.
Almost. In your example, I'm not sure why we'd output the <a>
and the <h5>
. I'm not even sure if pages and collections need to be in the same <ul>
.
Basically, I want to be able to ape the sort of navigation that Solid does:
Or even that Lightning does:
If you're ever wondering "is the nav meeting Tyler's expectations yet," the answer to that question is the same as "could we recreate Solid's nav?" If the answer is "no," then I still have complaints. 😁
from drizzle.
We can recreate it currently, but not within one top-level loop. For example:
src/pages
├── colors.md
├── demos
│ ├── demo-example-1.hbs
│ ├── demo-example-2.hbs
│ └── index.hbs
├── docs
│ ├── doc-example-1.md
│ ├── doc-example-2.md
│ └── index.hbs
└── index.hbs
src/patterns
├── components
│ ├── button
│ │ ├── base.hbs
│ │ ├── disabled.hbs
│ │ └── primary.hbs
│ └── grid
│ └── base.hbs
└── typography
├── collection.yaml
├── headings.hbs
├── lists.hbs
├── misc.hbs
└── paragraphs.hbs
from drizzle.
Yep, that's basically the same way we did this sorta thing in Fabricator.
I'd like to be able to build that sorta nav by checking if "Components" has any immediate children or only collections. That would let me build it with a single loop, and not copy and paste chunks of code every time I add a similar category.
If there's still confusion, we should chat about it with voices.
from drizzle.
In case it's helpful, here's a hypothetical Handlebars template I'd love to write (if it were possible):
from drizzle.
@tylersticka How closable does this feel with cloudfour/drizzle-builder#95 in place?
(Keeping in mind that we can reopen it later.)
from drizzle.
@erikjung Go for it.
from drizzle.
Related Issues (20)
- Standalone pages HOT 2
- Fresh build breaks due to outdated dependencies HOT 6
- The nav is broken HOT 2
- Use postcss-preset-env
- Make sure "e" isn't cut off on Drizzle logo
- Invalid name: "@cloudfour/hbs-helpers" HOT 5
- Unable to put new folders into pattern folder HOT 1
- Back-end Integrations HOT 18
- Notes property not working when defined via pattern collection HOT 1
- notice new/deleted files and update the browser HOT 1
- Handlebars Partial blocks don't work for Patterns HOT 12
- gracefully recover from errors in gulp chain HOT 1
- Could npm build errors get reported to the Drizzle UI somehow? HOT 1
- Adding arbitrary code samples to patterns HOT 2
- Using baseurl in patterns HOT 3
- Global variables not being complied in dist HOT 5
- Add .DS_Store to .gitignore HOT 1
- Discuss dev dependency gulp-gh-pages HOT 9
- Fix awkward size/positioning of drizzle logo in drizzle-Nav-header
- Frame-thumb max-width should be none
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from drizzle.