alanorth / hugo-theme-bootstrap4-blog

A blogging-centric Bootstrap v4 theme for the Hugo static site generator.
Other
204 stars 132 forks source link

params are not optional #138

Closed damnms closed 4 years ago

damnms commented 4 years ago

the config.toml says, some params would be optional, but they are not.

 [params.sidebar]
    # Optional about block for sidebar (can be Markdown)
    about = "A simple Hugo theme based on the [Bootstrap v4 blog example](http://v4-alpha.getbootstrap.com/examples/blog/)."

    # How many posts to show on the sidebar (Default: 5)
    #num_recent_posts = 2

  [params.social]
    # Optional, used for attribution in Twitter cards (ideally not a person
    # for example: nytimes, flickr, NatGeo, etc).
    # See: https://dev.twitter.com/cards/types/summary-large-image
    twitter = "username"

when removing them, hugo will report a big warning: Building sites … WARNING: calling IsSet with unsupported type "invalid" () will always return false.

would be nice if those could just be deleted because i do not use those social things, nor do i need the sidebar

alanorth commented 4 years ago

Hi @damnms. The parameters are optional, but you need to leave the [params.sidebar] and [params.social] blocks uncommented. The code in layouts/partial/sidebar.html currently does this:

{{ if and (.Site.Params.sidebar) (isset .Site.Params.sidebar "about") }}

It's been almost four years since I wrote that, so I'm not sure why it doesn't work when [params.sidebar] is commented out...

P.S. I don't plan on modifying the theme to work without the sidebar because it's modeled on the Bootstrap blog example and also I don't have much time to re-work the CSS.