Functions | Hugo - Static Site Generator | Tutorial 18

Поделиться
HTML-код
  • Опубликовано: 27 дек 2024

Комментарии • 13

  • @ivanmile78
    @ivanmile78 6 лет назад +17

    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...".

  • @chromerims
    @chromerims 3 года назад

    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.

  • @ayushagarwal7631
    @ayushagarwal7631 4 года назад +3

    no one:
    Mike: uses a function to get the singular form of 'dogs'

  • @dimkir100
    @dimkir100 7 лет назад +1

    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

    • @GiraffeAcademy
      @GiraffeAcademy  7 лет назад +2

      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

  • @PaulVanBladel
    @PaulVanBladel 4 года назад +3

    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.

  • @WorstDeveloper
    @WorstDeveloper 6 лет назад +1

    Any way to create my own functions?

  • @monkeezorg
    @monkeezorg 6 лет назад

    It would be great to include the word functions in your youtube title for this video.

    • @GiraffeAcademy
      @GiraffeAcademy  6 лет назад +1

      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?