Comments (7)
What does this mean? Is this something that would be better as being a default global variable available in the context?
from assemble.
This would be probably two helpers which would enable you to add the file name and/or file extension to the page as a string. One for the name of the current file, {{filename}}
, and probably one that grabs the extension of the current file {{fileext}}
. However, I can't remember use case so this is unimportant for now. I'll leave it open for a bit, but we can close it if it goes another week or so without me remembering what problem this solved.
from assemble.
moved to helper-lib
from assemble.
I know it is old, but I am struggling with a problem that this helper would solve: I want to build the HTML menu dynamically and have the YAML file with the key-value pairs, where key is the same as the filename of the HTML file, so with with a helper I could compare the current filename and the data and export the class="active"
when they match.
from assemble.
@primozcigler we actually added isCurrentPage
to all the pages in the pages collection, so you can do something like...
from assemble.
Or just get https://github.com/helpers/handlebars-helper-isActive (and follow the instructions on the README of that project), then you can do:
from assemble.
That's awesome, I will take a look, thank you!
from assemble.
Related Issues (20)
- data not available to pages HOT 2
- Handlebars Helpers not available when iterating over custom collection HOT 17
- Is Assemble still active? HOT 2
- Provide a generated API documentation HOT 11
- app.cwd points to original cwd when passing --cwd HOT 4
- partials/layouts collections discard dot namespaces in view keys HOT 36
- Contribution guide link is broken in the project's issue template
- Creating a navigation bar HOT 2
- Accessing variables outside of each block HOT 4
- Trouble accessing custom collection from inside template file HOT 4
- Passing pages.data to yaml front matter. HOT 7
- Nested if statements causing custom parameters in partials to become repeated/global scope HOT 3
- How to add pagination in grunt-assemble HOT 2
- Error with escape function and nested variables HOT 1
- Markdown Helper HOT 2
- Hi Guys. HOT 5
- Produce a .php file HOT 4
- Render php Files? HOT 3
- Project status? HOT 6
- Assemble logo as an SVG? HOT 2
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 assemble.