ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Solved Any good getting started with Hugo resources

    IT Discussion
    hugo
    4
    44
    2.1k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • JaredBuschJ
      JaredBusch
      last edited by

      Before I search around and pick something random, has anyone seen any good resources for getting started with Hugo?

      A buddy has a super simple site he coded in notepad that I want to redo for him as a means of teaching myself about Hugo.

      1 Reply Last reply Reply Quote 1
      • stacksofplatesS
        stacksofplates @JaredBusch
        last edited by stacksofplates

        @JaredBusch said in Any good getting started with Hugo resources:

        @stacksofplates said in Any good getting started with Hugo resources:

        1. cp -R themes/theme/examplesite/* .

        Why do this? Why can't I just create my own things? Why bring everything from the example up?

        I don't mind this, just trying to understand the logic.

        Each theme has it's own specific settings. The example gives you all of those settings without having to read through all of their theme and find the settings for yourself. You can delete the files in content/ that you don't need. It's just a way to show you how to use the theme and give you a default config.toml.

        1 Reply Last reply Reply Quote 1
        • scottalanmillerS
          scottalanmiller
          last edited by

          Not really, I feel like the guides all make these huge assumptions that they shouldn't. Hugo is really easy to use, but there are some basic pieces that are missing and you just have " to know" and to some degree it is "based on the theme." If I have two themes, the processes are different, including how to run the Hugo command!

          JaredBuschJ 1 Reply Last reply Reply Quote 0
          • JaredBuschJ
            JaredBusch @scottalanmiller
            last edited by

            @scottalanmiller said in Any good getting started with Hugo resources:

            Not really, I feel like the guides all make these huge assumptions that they shouldn't. Hugo is really easy to use, but there are some basic pieces that are missing and you just have " to know" and to some degree it is "based on the theme." If I have two themes, the processes are different, including how to run the Hugo command!

            That's what I noticed yesteday when I decided to give Hugo a spin for this. It was simple to install hugo, make a folder, make a site and then add a theme.

            But exactly WTF am I supposed to do next to get the various pages made?

            It uses markdown for content. ok great, but exactly how?
            The theme has default CSS values, but how do I add my own CSS to tweak things from the base theme? What if I want a red header bgcolor instead of white?

            scottalanmillerS ObsolesceO stacksofplatesS 3 Replies Last reply Reply Quote 0
            • scottalanmillerS
              scottalanmiller @JaredBusch
              last edited by

              @JaredBusch said in Any good getting started with Hugo resources:

              But exactly WTF am I supposed to do next to get the various pages made?

              Right. 100% missing info. And mostly this is because Hugo isn't what does this, the themes are. Hugo is like a theme-automation toolkit and the real trick is learning the themes, not learning Hugo.

              JaredBuschJ 1 Reply Last reply Reply Quote 0
              • ObsolesceO
                Obsolesce @JaredBusch
                last edited by

                @JaredBusch said in Any good getting started with Hugo resources:

                The theme has default CSS values, but how do I add my own CSS to tweak things from the base theme? What if I want a red header bgcolor instead of white?

                Depends on the theme.

                1 Reply Last reply Reply Quote 0
                • JaredBuschJ
                  JaredBusch @scottalanmiller
                  last edited by

                  @scottalanmiller said in Any good getting started with Hugo resources:

                  @JaredBusch said in Any good getting started with Hugo resources:

                  But exactly WTF am I supposed to do next to get the various pages made?

                  Right. 100% missing info. And mostly this is because Hugo isn't what does this, the themes are. Hugo is like a theme-automation toolkit and the real trick is learning the themes, not learning Hugo.

                  Right, and maybe I just picked a crappy theme at random.

                  scottalanmillerS 1 Reply Last reply Reply Quote 0
                  • scottalanmillerS
                    scottalanmiller @JaredBusch
                    last edited by

                    @JaredBusch said in Any good getting started with Hugo resources:

                    @scottalanmiller said in Any good getting started with Hugo resources:

                    @JaredBusch said in Any good getting started with Hugo resources:

                    But exactly WTF am I supposed to do next to get the various pages made?

                    Right. 100% missing info. And mostly this is because Hugo isn't what does this, the themes are. Hugo is like a theme-automation toolkit and the real trick is learning the themes, not learning Hugo.

                    Right, and maybe I just picked a crappy theme at random.

                    That's definitely a risk. A good theme makes Hugo so easy, and a bad one makes it useless.

                    1 Reply Last reply Reply Quote 0
                    • stacksofplatesS
                      stacksofplates @JaredBusch
                      last edited by

                      @JaredBusch said in Any good getting started with Hugo resources:

                      @scottalanmiller said in Any good getting started with Hugo resources:

                      Not really, I feel like the guides all make these huge assumptions that they shouldn't. Hugo is really easy to use, but there are some basic pieces that are missing and you just have " to know" and to some degree it is "based on the theme." If I have two themes, the processes are different, including how to run the Hugo command!

                      That's what I noticed yesteday when I decided to give Hugo a spin for this. It was simple to install hugo, make a folder, make a site and then add a theme.

                      But exactly WTF am I supposed to do next to get the various pages made?

                      It uses markdown for content. ok great, but exactly how?
                      The theme has default CSS values, but how do I add my own CSS to tweak things from the base theme? What if I want a red header bgcolor instead of white?

                      A lot is dependent on the theme because of the default variables that are set. Some themes use the .Site.Params very heavily, some don't.

                      The documentation is geared towards developers and I think that's because it uses Go's templating to do the work.

                      A good way to look at it is if you want to override any theme settings (CSS, partials, data, etc) make the same folder in the top level of your site and it will override the themes. Let me put an example together.

                      1 Reply Last reply Reply Quote 0
                      • stacksofplatesS
                        stacksofplates
                        last edited by

                        So I add the theme as a git submodule, and then in my site folder I override whatever by just copying what I need.

                        So if themes looks like this:

                        └── themes
                            └── hugo-paper
                                ├── i18n
                                │   ├── en.yaml
                                │   ├── ja.yaml
                                │   ├── ko.yaml
                                │   ├── ru.yaml
                                │   └── zh.yaml
                                ├── images
                                │   ├── screenshot_dark.png
                                │   ├── screenshot.png
                                │   └── tn.png
                                ├── layouts
                                │   ├── 404.html
                                │   ├── _default
                                │   │   ├── list.html
                                │   │   └── single.html
                                │   └── partials
                                │       ├── footer.html
                                │       └── header.html
                                ├── LICENSE
                                ├── README.md
                                ├── static
                                │   ├── an-old-hope.min.css
                                │   ├── apple-touch-icon.png
                                │   ├── favicon.ico
                                │   ├── highlight.min.js
                                │   └── style.css
                                └── theme.toml
                        

                        And I want to add a custom CSS file, I'll copy the header.html file to layouts/partials/header.html in my site (you'll have to make the directories). Then I'll edit that file to add my custom CSS file, and I'll put my custom file in static/custom.css in the site directory.

                        1 Reply Last reply Reply Quote 0
                        • JaredBuschJ
                          JaredBusch
                          last edited by

                          So what about this theme for a blog?
                          https://themes.gohugo.io//theme/hugo-tikva/post/

                          stacksofplatesS 1 Reply Last reply Reply Quote 0
                          • JaredBuschJ
                            JaredBusch
                            last edited by

                            @stacksofplates so i have a clean set done locally.

                            Now I need to read through this toml file, basically copying it over top of the default one, and change things as needed.
                            99647264-437b-4516-bd47-a6b6e569c6f8-image.png

                            stacksofplatesS 1 Reply Last reply Reply Quote 0
                            • stacksofplatesS
                              stacksofplates @JaredBusch
                              last edited by

                              @JaredBusch said in Any good getting started with Hugo resources:

                              @stacksofplates so i have a clean set done locally.

                              Now I need to read through this toml file, basically copying it over top of the default one, and change things as needed.
                              99647264-437b-4516-bd47-a6b6e569c6f8-image.png

                              Yeah. So each theme is completely different because you can set up the site essentially however you want. The params enable/disable and modify different parts of the HTML that's generated. That's why if you just do hugo new site it's blank. There's no partials to create the site from. And theres also data files which help display different content types.

                              I'll look over that theme and see what it looks like.

                              1 Reply Last reply Reply Quote 0
                              • ObsolesceO
                                Obsolesce
                                last edited by Obsolesce

                                @JaredBusch

                                You can get it going quick if you cut everything in the exampleSite directory and paste it up one level. Then comment out line number 5 in that config file you shown.

                                Then from that directory, enter hugo serve -D to test locally.

                                stacksofplatesS 1 Reply Last reply Reply Quote 0
                                • stacksofplatesS
                                  stacksofplates @Obsolesce
                                  last edited by

                                  @Obsolesce said in Any good getting started with Hugo resources:

                                  @JaredBusch

                                  You can get it going quick if you cut everything in the exampleSite directory and paste it up one level. Then comment out line number 5 in that config file you shown.

                                  Then from that directory, enter hugo serve -D to test locally.

                                  You need to paste up two levels. It's looking for the theme folder inside of the themes directory.

                                  ObsolesceO 1 Reply Last reply Reply Quote 0
                                  • ObsolesceO
                                    Obsolesce @stacksofplates
                                    last edited by

                                    @stacksofplates said in Any good getting started with Hugo resources:

                                    @Obsolesce said in Any good getting started with Hugo resources:

                                    @JaredBusch

                                    You can get it going quick if you cut everything in the exampleSite directory and paste it up one level. Then comment out line number 5 in that config file you shown.

                                    Then from that directory, enter hugo serve -D to test locally.

                                    You need to paste up two levels. It's looking for the theme folder inside of the themes directory.

                                    I don't use that and only have one level up. That is the site. It's way easier.

                                    stacksofplatesS 1 Reply Last reply Reply Quote 0
                                    • stacksofplatesS
                                      stacksofplates @Obsolesce
                                      last edited by

                                      @Obsolesce said in Any good getting started with Hugo resources:

                                      @stacksofplates said in Any good getting started with Hugo resources:

                                      @Obsolesce said in Any good getting started with Hugo resources:

                                      @JaredBusch

                                      You can get it going quick if you cut everything in the exampleSite directory and paste it up one level. Then comment out line number 5 in that config file you shown.

                                      Then from that directory, enter hugo serve -D to test locally.

                                      You need to paste up two levels. It's looking for the theme folder inside of the themes directory.

                                      I don't use that and only have one level up. That is the site. It's way easier.

                                      That may work, but you're not supposed to do it that way. From their documentation: https://gohugo.io/hugo-modules/theme-components/

                                      The name used in the theme definition above must match a folder in /your-site/themes, e.g. /your-site/themes/my-shortcodes.

                                      It's also much easier to segregate this way so you can use git submodules for the themes. You should have the theme as a submodule so you can pull in updates and keep that separate from your site versioning.

                                      ObsolesceO 1 Reply Last reply Reply Quote 0
                                      • ObsolesceO
                                        Obsolesce @stacksofplates
                                        last edited by Obsolesce

                                        @stacksofplates said in Any good getting started with Hugo resources:

                                        @Obsolesce said in Any good getting started with Hugo resources:

                                        @stacksofplates said in Any good getting started with Hugo resources:

                                        @Obsolesce said in Any good getting started with Hugo resources:

                                        @JaredBusch

                                        You can get it going quick if you cut everything in the exampleSite directory and paste it up one level. Then comment out line number 5 in that config file you shown.

                                        Then from that directory, enter hugo serve -D to test locally.

                                        You need to paste up two levels. It's looking for the theme folder inside of the themes directory.

                                        I don't use that and only have one level up. That is the site. It's way easier.

                                        That may work, but you're not supposed to do it that way. From their documentation: https://gohugo.io/hugo-modules/theme-components/

                                        The name used in the theme definition above must match a folder in /your-site/themes, e.g. /your-site/themes/my-shortcodes.

                                        It's also much easier to segregate this way so you can use git submodules for the themes. You should have the theme as a submodule so you can pull in updates and keep that separate from your site versioning.

                                        That's always been a big PITA for me, so I purposely don't do it that way. It was confusing as hell to figure it out in the beginning, and their documentation didn't make any sense to me as a Hugo newbie, as it's not intuitive.

                                        So what I did was download a theme, and use the theme itself as the base of the site. Whatever is in the exampleSite folder, I move it up one level, comment out the theme line in the config file, then generate the site from there.

                                        As for theme updates, all the good ones I've found and use haven't had any updates in YEARS and I seriously doubt there will be any more. So at least in my case, I was never worried about that. If there would be an update, it's small enough that it's no big deal to take care of it manually.

                                        It was just simply too time consuming in the beginning, and the theming crap just wouldn't work for me. So how I got it working was a big time saver and, at least in my cases, there were absolutely no benefits to the theming junk.

                                        If I ever find a decent theme that is kept updated, I'll think about doing it that way, but until then, I see no benefit. I get the site to exactly how I want it to be, keep it in GIT and push changes as needed and the site rebuilds and deploys to staging environment (public but my IPs only) automatically, and then to production (public) via approval gate.

                                        stacksofplatesS 1 Reply Last reply Reply Quote 0
                                        • stacksofplatesS
                                          stacksofplates @Obsolesce
                                          last edited by

                                          @Obsolesce said in Any good getting started with Hugo resources:

                                          @stacksofplates said in Any good getting started with Hugo resources:

                                          @Obsolesce said in Any good getting started with Hugo resources:

                                          @stacksofplates said in Any good getting started with Hugo resources:

                                          @Obsolesce said in Any good getting started with Hugo resources:

                                          @JaredBusch

                                          You can get it going quick if you cut everything in the exampleSite directory and paste it up one level. Then comment out line number 5 in that config file you shown.

                                          Then from that directory, enter hugo serve -D to test locally.

                                          You need to paste up two levels. It's looking for the theme folder inside of the themes directory.

                                          I don't use that and only have one level up. That is the site. It's way easier.

                                          That may work, but you're not supposed to do it that way. From their documentation: https://gohugo.io/hugo-modules/theme-components/

                                          The name used in the theme definition above must match a folder in /your-site/themes, e.g. /your-site/themes/my-shortcodes.

                                          It's also much easier to segregate this way so you can use git submodules for the themes. You should have the theme as a submodule so you can pull in updates and keep that separate from your site versioning.

                                          That's always been a big PITA for me, so I purposely don't do it that way. It was confusing as hell to figure it out in the beginning, and their documentation didn't make any sense to me as a Hugo newbie, as it's not intuitive.

                                          So what I did was download a theme, and use the theme itself as the base of the site. Whatever is in the exampleSite folder, I move it up one level, comment out the theme line in the config file, then generate the site from there.

                                          As for theme updates, all the good ones I've found and use haven't had any updates in YEARS and I seriously doubt there will be any more. So at least in my case, I was never worried about that. If there would be an update, it's small enough that it's no big deal to take care of it manually.

                                          It was just simply too time consuming in the beginning, and the theming crap just wouldn't work for me. So how I got it working was a big time saver and, at least in my cases, there were absolutely no benefits to the theming junk.

                                          If I ever find a decent theme that is kept updated, I'll think about doing it that way, but until then, I see no benefit. I get the site to exactly how I want it to be, keep it in GIT and push changes as needed and the site rebuilds and deploys to staging environment (public but my IPs only) automatically, and then to production (public) via approval gate.

                                          Yeah that's more convoluted than following how they want you to do it.

                                          Also about the theme updates.

                                          As for theme updates, all the good ones I've found and use haven't had any updates in YEARS and I seriously doubt there will be any more.

                                          That's 100% false. I know you're using meghna and it's had 22 commits this year the newest being 11 hours ago. Idk what you're looking at but it's not what you think.

                                          Hugo is always evolving. I promise you if you don't keep your theme updated your site will break. Speaking from experience using it for a few years now.

                                          ObsolesceO 1 Reply Last reply Reply Quote 0
                                          • ObsolesceO
                                            Obsolesce @stacksofplates
                                            last edited by

                                            @stacksofplates said in Any good getting started with Hugo resources:

                                            That's 100% false. I know you're using meghna and it's had 22 commits this year the newest being 11 hours ago. Idk what you're looking at but it's not what you think.

                                            That's old, I don't use that anymore even though it's still running.

                                            stacksofplatesS 1 Reply Last reply Reply Quote 0
                                            • stacksofplatesS
                                              stacksofplates
                                              last edited by stacksofplates

                                              How they want you to do it works like this:

                                              1. mkdir -p mysite/themes
                                              2. git clone theme into themes
                                              3. cp -R themes/theme/examplesite/* .

                                              #3 is obv assuming you're in the site directory. You're done. Now just edit your config.

                                              You can also do hugo new site and it gives you a directory structure but if you're using the themes example folder it's not really needed.

                                              ObsolesceO JaredBuschJ 3 Replies Last reply Reply Quote 0
                                              • 1
                                              • 2
                                              • 3
                                              • 1 / 3
                                              • First post
                                                Last post