The reason why "truncate 15" didn't change output from "truncate 10" (at 2:11-2:16) is because Hugo will not cut the word in the middle. If you write "truncate 16" you'll see that the output will change to "This is a really...".
Mike D.- Terrific videos on Hugo, thank you. At 4:42-4:43, where or why did E and G pages pop up from? Should that have been only A, B, C and D? Kind regards.
Coming from Jekyll, not having ability to use variables in the "content" section seems a bit bizarre and clumsy. What if I have an index page with few : hero with the slogan and logo (taken from a variable), 3 team members (photos and names taken from variables), 3 last testimonials (taken from variables), and 3 latest posts (taken from variables). In Jekyll I would create a new index.html page (set layout: baselayout) and then code page with access to all the variables... But in Hugo this doesn't seem to be the case :S
Yeah this is definitely unfortunate, variables can only be accessed directly in the layouts folder. Although there is a workaround, albeit clumsy. You can access variables from inside shortcodes, so you could create a hugo shortcode for the homepage hero section and team members section, etc. Then insert those shortcodes into the content page. This is a bit clumsy because really shortcodes are designed to be re-usable, and in the above cases those are really filling one time needs
Nike video series. Just one remark here. I wouldn't call RANGE a function. It's more like a statement, or even a language construct. Together with Range comes the {{end}} construct, right? That's not the case with a regular function. In e.g. C# or java a do while loop is not a function. Apart from that, thanks a lot for the great effort you did to make this excellent video series !. Kudos.
Hey Adam, thanks for the comment, I'm a little unclear about what you're saying though. The current title of the video is "Functions | Hugo - Static Site Generator | Tutorial 18", functions is the first word of the title. Could you elaborate?
The reason why "truncate 15" didn't change output from "truncate 10" (at 2:11-2:16) is because Hugo will not cut the word in the middle. If you write "truncate 16" you'll see that the output will change to "This is a really...".
Thanks for the explanation.
came to comments for this, thanks
Mike D.- Terrific videos on Hugo, thank you. At 4:42-4:43, where or why did E and G pages pop up from? Should that have been only A, B, C and D? Kind regards.
no one:
Mike: uses a function to get the singular form of 'dogs'
Coming from Jekyll, not having ability to use variables in the "content" section seems a bit bizarre and clumsy. What if I have an index page with few : hero with the slogan and logo (taken from a variable), 3 team members (photos and names taken from variables), 3 last testimonials (taken from variables), and 3 latest posts (taken from variables). In Jekyll I would create a new index.html page (set layout: baselayout) and then code page with access to all the variables... But in Hugo this doesn't seem to be the case :S
Yeah this is definitely unfortunate, variables can only be accessed directly in the layouts folder. Although there is a workaround, albeit clumsy. You can access variables from inside shortcodes, so you could create a hugo shortcode for the homepage hero section and team members section, etc. Then insert those shortcodes into the content page.
This is a bit clumsy because really shortcodes are designed to be re-usable, and in the above cases those are really filling one time needs
Nike video series. Just one remark here. I wouldn't call RANGE a function. It's more like a statement, or even a language construct. Together with Range comes the {{end}} construct, right? That's not the case with a regular function. In e.g. C# or java a do while loop is not a function.
Apart from that, thanks a lot for the great effort you did to make this excellent video series !. Kudos.
Any way to create my own functions?
It would be great to include the word functions in your youtube title for this video.
Hey Adam, thanks for the comment, I'm a little unclear about what you're saying though. The current title of the video is "Functions | Hugo - Static Site Generator | Tutorial 18", functions is the first word of the title. Could you elaborate?