Nice video! I haven’t used Bootstrap much so this series is helping me learn useful built-in classes. In this video I think it’s better to use an if statement instead of “with” though. Using “if” is clearer to understand (for yourself or other people working on the site). Less code is not always better. It’s not a big deal to repeat the variable name. And in this case you had to add more code anyway by assigning the Params to $e and referencing $e multiple times so it doesn’t seem like that improved anything. But that was useful to learn how Hugo handles scope/context, which is important to know in other situations.
I probably did use more code. I try to throw these things in because people who are new to hugo always ask me to show them more advanced usage, so wherever possible I throw in some extras. Glad you got something out of it.
It would be interesting to have an iteration for an bootstrap carousel because there you need an variable to always count up each time (for each carousel item)
Good video, like always! I've been looking at lots of different themes, and there is one I found (Hargo) that puts homepage data in data/homepage.yml and then call it on the home page (layouts.index.html like this video) with conditionals for each section like this: {{ if site.Data.homepage.banner.enable }} {{ with site.Data.homepage.banner }} [HTML doing things with that chunk of banner properties.] The homepage can have so many sections that it would seem unwieldy putting all of that in the frontmatter of layouts/index.html
That's a great way to to it, if things are getting too complicated. I often use netlify cms for my clients, so I have to keep all of my page data with its respective mardown file so its easy for them to find. For data that is used across multiple pages, this is the way to go in all use cases.
Nice video! I haven’t used Bootstrap much so this series is helping me learn useful built-in classes. In this video I think it’s better to use an if statement instead of “with” though. Using “if” is clearer to understand (for yourself or other people working on the site). Less code is not always better. It’s not a big deal to repeat the variable name. And in this case you had to add more code anyway by assigning the Params to $e and referencing $e multiple times so it doesn’t seem like that improved anything. But that was useful to learn how Hugo handles scope/context, which is important to know in other situations.
I probably did use more code. I try to throw these things in because people who are new to hugo always ask me to show them more advanced usage, so wherever possible I throw in some extras. Glad you got something out of it.
thanks it was helpful ... since i m a beginner ...
Glad it was helpful! Any questions let me know
It would be interesting to have an iteration for an bootstrap carousel because there you need an variable to always count up each time (for each carousel item)
I'll have to make a quick video on it. Basically you do
{{ range $index, $image := .Params.images }}
{{ $res := .Resources.GetMatch $image }}
I am also looking at writing a full skillshare course on image processing, and implementations with hugo
@@futurewebdesign thanks a lot I will try it out when I'm at home!
Good video, like always! I've been looking at lots of different themes, and there is one I found (Hargo) that puts homepage data in data/homepage.yml and then call it on the home page (layouts.index.html like this video) with conditionals for each section like this:
{{ if site.Data.homepage.banner.enable }}
{{ with site.Data.homepage.banner }}
[HTML doing things with that chunk of banner properties.]
The homepage can have so many sections that it would seem unwieldy putting all of that in the frontmatter of layouts/index.html
That's a great way to to it, if things are getting too complicated. I often use netlify cms for my clients, so I have to keep all of my page data with its respective mardown file so its easy for them to find.
For data that is used across multiple pages, this is the way to go in all use cases.