Dust – Documentation
Welcome to the official documentation for Dust.
Features
- Easy-to-use templating engine
- Helps separate view logic from code
- Powerful partials and helper functions
Installation
To install Dust, follow these steps:
- Open your terminal
- Navigate to your project directory
- Run the command
npm install dustjs-linkedin
Templates
Dust works with HTML templates using a combination of tags and JavaScript logic. Here is a basic template example:
{
"title": "Hello World!",
"body": "This is a Dust template."
}
Partial Templates
Partial templates allow you to reuse sections of a template across multiple pages. Here’s an example:
{
"title": "Hello World!",
"body": "This is a Dust template.",
"footer": "This is the footer of the template."
}
Helper Functions
Helper functions can be used to perform calculations or modify data within your templates. Some commonly used helper functions include:
- {@eq} – Compare values and conditionally display content
- {@if} – Conditionally render content based on a condition
- {@math} – Perform mathematical operations
Resources
Here are some resources to help you learn more about Dust:
- Official Dust documentation: https://dustjs.com/docs/
- Dust GitHub repository: https://github.com/linkedin/dustjs
- Stack Overflow: https://stackoverflow.com/
Conclusion
Thank you for using Dust and following our documentation. If you have any further questions or need assistance, feel free to reach out to our support team.