CaiJimmy / hugo-theme-stack

Card-style Hugo theme designed for bloggers
https://stack.jimmycai.com
GNU General Public License v3.0
4.83k stars 1.55k forks source link

serveral small bugs #248

Closed ghost closed 3 years ago

ghost commented 3 years ago

Describe the bug

1: setting TOC off in config.yaml also removes the "back" button in articles 2: removing avatar image source breaks the site

Expected behavior

1: with TOC off, the back button in article view should still be available 2: without avatar image source, the avatar element should be remove or at least should have a disable option in config.yaml

To Reproduce

1: set TOC to false in config.yaml 2: remove image source address under sidebar>avatar>src in config.yaml

Screenshots

1: no back button when TOC is disabled 2123

2: removing avatar image source breaks site:

ERROR 2021/06/26 19:22:36 render of "page" failed: execute of template failed: template: _default/archives.html:11:19: executing "left-sidebar" at <partial "sidebar/left.html" .>: error calling partial: "L:\HTML\personal\themes\stack\layouts\partials\sidebar\left.html:14:43": execute of template failed: template: partials/sidebar/left.html:14:43: executing "partials/sidebar/left.html" at <resources.Get>: error calling Get: dirs not supported resource types: &{0xc00220d590 map[baseDir:L:\HTML\personal filename:assets isOrdered:false lang: module:project mountRoot: mountWeight:2 opener:0xa757e0 sourceRoot:L:\HTML\personal\assets watch:true]}
ERROR 2021/06/26 19:22:36 render of "section" failed: execute of template failed: template: _default/list.html:11:19: executing "left-sidebar" at <partial "sidebar/left.html" .>: error calling partial: "L:\HTML\personal\themes\stack\layouts\partials\sidebar\left.html:14:43": execute of template failed: template: partials/sidebar/left.html:14:43: executing "partials/sidebar/left.html" at <resources.Get>: error calling Get: dirs not supported resource types: &{0xc002389cb0 map[baseDir:L:\HTML\personal filename:assets isOrdered:false lang: module:project mountRoot: mountWeight:2 opener:0xa757e0 sourceRoot:L:\HTML\personal\assets watch:true]}
ERROR 2021/06/26 19:22:36 render of "home" failed: execute of template failed: template: index.html:11:19: executing "left-sidebar" at <partial "sidebar/left.html" .>: error calling partial: "L:\HTML\personal\themes\stack\layouts\partials\sidebar\left.html:14:43": execute of template failed: template: partials/sidebar/left.html:14:43: executing "partials/sidebar/left.html" at <resources.Get>: error calling Get: dirs not supported resource types: &{0xc002286990 map[baseDir:L:\HTML\personal filename:assets isOrdered:false lang: module:project mountRoot: mountWeight:2 opener:0xa757e0 sourceRoot:L:\HTML\personal\assets watch:true]}
ERROR 2021/06/26 19:22:36 render of "page" failed: execute of template failed: template: page/search.html:11:19: executing "left-sidebar" at <partial "sidebar/left.html" .>: error calling partial: "L:\HTML\personal\themes\stack\layouts\partials\sidebar\left.html:14:43": execute of template failed: template: partials/sidebar/left.html:14:43: executing "partials/sidebar/left.html" at <resources.Get>: error calling Get: dirs not supported resource types: &{0xc00327fce0 map[baseDir:L:\HTML\personal filename:assets isOrdered:false lang: module:project mountRoot: mountWeight:2 opener:0xa757e0 sourceRoot:L:\HTML\personal\assets watch:true]}
ERROR 2021/06/26 19:22:36 failed to render pages: render of "section" failed: execute of template failed: template: _default/list.html:11:19: executing "left-sidebar" at <partial "sidebar/left.html" .>: error calling partial: "L:\HTML\personal\themes\stack\layouts\partials\sidebar\left.html:14:43": execute of template failed: template: partials/sidebar/left.html:14:43: executing "partials/sidebar/left.html" at <resources.Get>: error calling Get: dirs not supported resource types: &{0xc0025a0570 map[baseDir:L:\HTML\personal filename:assets isOrdered:false lang: module:project mountRoot: mountWeight:2 opener:0xa757e0 sourceRoot:L:\HTML\personal\assets watch:true]}

Environment

Additional context

Add any other context about the problem here.

If it's a UI issue, fill the following information:

Content of config.yaml

baseurl: https://something.whatever
languageCode: en-us
theme: stack
paginate: 5
title: Test Title

# Change it to your Disqus shortname before using
# disqusShortname: hugo-theme-stack

# GA Tracking ID
# googleAnalytics:

# Theme i18n support
# Available values: en, fr, id, ja, ko, pt-br, zh-cn, es, de, nl
DefaultContentLanguage: en

permalinks:
    post: /p/:slug/
    page: /:slug/

params:
    mainSections:
        - post
    featuredImageField: image
    rssFullContent: true
    favicon: /icon.png
    footer:
        since: 2021
        customText:

    dateFormat:
        published: 02 Jan, 2006
        lastUpdated: 02 Jan, 2006 15:04 MST

    sidebar:
        emoji: 
        subtitle: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
        avatar:
            local: true
            src: 

    article:
        math: false
        toc: false
        license:
            enabled: false
            default: Licensed under CC BY-NC-SA 4.0

    comments:
        enabled: false
        provider: disqus

        utterances:
            repo:
            issueTerm: pathname
            label:

        remark42:
            host:
            site:
            locale:

        vssue:
            platform:
            owner:
            repo:
            clientId:
            clientSecret:

        # Waline client configuration see: https://waline.js.org/en/reference/client.html
        waline:
            serverURL:
            lang:
            visitor:
            avatar:
            emoji:
                - https://cdn.jsdelivr.net/gh/walinejs/emojis/weibo
            requiredMeta:
                - name
                - email
                - url
            placeholder:
            locale:
                admin: Admin

    widgets:
        enabled:
            - search
            - archives
            - tag-cloud

        archives:
            limit: 5

        tagCloud:
            limit: 10

    opengraph:
        twitter:
            # Your Twitter username
            site: test

            # Available values: summary, summary_large_image
            card: summary_large_image

    defaultImage:
        opengraph:
            enabled: false
            local: false
            src:

    colorScheme:
        # Display toggle
        toggle: true

        # Available values: auto, light, dark
        default: auto

    imageProcessing:
        cover:
            enabled: true
        content:
            enabled: true

### Custom menu
### See https://docs.stack.jimmycai.com/configuration/custom-menu
### To remove about, archive and search page menu item, remove `menu` field from their FrontMatter
menu:
    main:
        - identifier: home
          name: Home
          url: /
          weight: -100
          pre: home

related:
    includeNewer: true
    threshold: 60
    toLower: false
    indices:
        - name: tags
          weight: 100

        - name: categories
          weight: 200

markup:
    tableOfContents:
        endLevel: 4
        ordered: true
        startLevel: 2
    highlight:
        noClasses: false
CaiJimmy commented 3 years ago

1: setting TOC off in config.yaml also removes the "back" button in articles

That's the design.

2: removing avatar image source breaks the site

If you want to disable the avatar, remove the whole avatar section in config.yaml.