Closed WillJarrettData closed 3 years ago
Does this bit of the README help you? https://github.com/jsoma/bottlejack#the-homepage
Everything in the data.yaml page gets fed to the
home.hbs
template, creating a homepage. For example, thebio
key in the YAML turns into{{ bio }}
in the template, and links get looped through with the{{#each links}}
section.Feel free to add whatever you'd like to data.yaml, as all of it will be available in the same way in your template.
Happy to add more if need be, or you can close if that takes care of things.
I think a full list could be useful, if possible! For instance, I wanted to add different pictures for each link but I'm not sure what the key is.
Apologies if it's not clear - you can add anything you want to the yaml, and it'll be something you can use in the template. For example, right now each link is something like:
links:
- target: mailto:jonathan.soma@gmail.com
text: 📧 email
- target: https://jonathansoma.com
text: 🏠 homepage
and the links display in home.hbs
is:
{{#each links}}
<li><a href="{{this.target}}">{{ this.text }}</a></li>
{{/each}}
you could change the yaml to something like
links:
- target: mailto:jonathan.soma@gmail.com
text: email
icon: 📧
- target: https://jonathansoma.com
text: homepage
icon: 🏠
and then you'd be able to use icon
in the template, like so:
{{#each links}}
<li><a href="{{this.target}}">{{ this.icon }} {{ this.text }}</a></li>
{{/each}}
There isn't really a "full list" because the list is just "whatever you've put in the yaml"
Ah right, understood. Thanks!
In the readme, please could we have a list of all possible fields for the homepage? I think I remember from our class that we can add additional fields other than type, title, slug, and url (e.g. a description field or an image field) but I don't know their names.