Comments (7)
How do we reference something defined in the yml in a template..
is there any good documentation or quick start on the hbs file and yml integration and how that works? Not asking you to write loads, just if it exists, otherwise I'm sure I'll pick it up.
from less-docs.
Yeah, it's this simple:
In the Gruntfile, the _config.yml
file is namespaced under the site
variable, so for any property in _config.yml
, you just do:
{{site.foo}}
Data from other JSON or YAML files are referenced by the name of the file. So, using a generic example, button.json
containing the following:
{
"text": "Click me"
}
Would be used in a template like this:
{{button.text}}
from less-docs.
So in other words, I'm using _config.yml
namespaced uner site
for "site wide" data, since it's a familiar convention to many users of Jekyll. But any other data files used for other "components" or areas of the site will generally use the same name as the template they belong to, which makes it super easy to maintain. E.g.:
nav.hbs
(template) would be matched up with nav.json
data file. Inside nav.hbs
, {{nav.foo}}
would be used to get data from nav.json
.
Another example is less.json, which is generated by this script, allowing us to update the documentation with current info from the less.js repo, such as version, with just {{less.version}}
, and so on.
Also, I created this data file for functions, but I'd like to have one of these for all features. Eventually it will include something like:
{
"name": "feature-name",
"data": { // this object would contain any "reference" data, or fixtures, required by the example(s) },
"example": "this would be an example of the feature",
"expected": "this would be the compiled result",
"desc": "This is a description of the feature."
}
from less-docs.
The CDN link <script src="//cdnjs.cloudflare.com/ajax/libs/less.js/2.0.0-b2/less.min.js"></script>
404s.
from less-docs.
@kaleb See #253. Some desync for links of new releases (especialy if it's beta) is expected since neither the docs nor cdnjs are updated immediately. You always can find the latest version available at cdnjs by visiting https://cdnjs.com/libraries/less.js.
from less-docs.
I'm making a pull request to cdnjs to fix..
from less-docs.
cdn is now defined in .assemblerc.yml.
from less-docs.
Related Issues (20)
- Documenting dynamic property iteration (or whatever you want to call it). HOT 1
- A simple less-include triggers a deprecated-warning into the console - how to solve this issue?
- A part of Extend document is error at the "Selector Interpolation with Extend".
- 数学运算:less编译为css是,除法没有被编译成功,这是一个bug嘛? HOT 1
- HTTPS certificate is invalid for lesscss.org HOT 1
- Permutation of 4 is 24, not 16 HOT 1
- Remove IE11 as a supported browser HOT 1
- Overview > Operations > Conversion is impossible example giving different results
- Typo : In CDN
- Overview -> Operatins the division example is misleading HOT 3
- A plan for Chinese doc. HOT 6
- ci: auto deploy lesscss.org
- Error getting started with LESS HOT 1
- Official website problem
- Guide link is broken HOT 2
- Migrating from v3.x to v4.x HOT 2
- 此less脚本 将 less 转 css 时,会导致某些属性无法获取 HOT 1
- `default()` guard should be documented / mentioned with mixin documentation
- Mismatch between Expected and Actual Output in Official Documentation Example
- Math expressions directly assigned to a CSS custom property are not computed.
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 less-docs.