CaiJimmy / hugo-theme-stack

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

Can't use cactus comments #470

Closed bennihtm closed 2 years ago

bennihtm commented 2 years ago

Describe the bug

If I try to change my comments provider to cactus comments it fails with the following error:

ERROR 2022/01/23 13:47:00 render of "page" failed: execute of template failed: template: _default/single.html:25:11: executing "main" at <partial "comments/include" .>: error calling partial: execute of template failed: template: partials/comments/include.html:2:7: executing "partials/comments/include.html" at <partial (printf "comments/provider/%s" .Site.Params.comments.provider) .>: error calling partial: execute of template failed: template: partials/comments/provider/cactus.html:2:4: executing "partials/comments/provider/cactus.html" at <partial "helper/external" (dict "Context" . "Namespace" "Cactus")>: error calling partial: "C:\Users\Benni\Documents\blog\themes\stack\layouts\partials\helper\external.html:1:13": execute of template failed: template: partials/helper/external.html:1:13: executing "partials/helper/external.html" at <index .Context.Site.Data.external .Namespace>: error calling index: index of untyped nil ERROR 2022/01/23 13:47:00 render of "page" failed: execute of template failed: template: _default/single.html:25:11: executing "main" at <partial "comments/include" .>: error calling partial: execute of template failed: template: partials/comments/include.html:2:7: executing "partials/comments/include.html" at <partial (printf "comments/provider/%s" .Site.Params.comments.provider) .>: error calling partial: execute of template failed: template: partials/comments/provider/cactus.html:2:4: executing "partials/comments/provider/cactus.html" at <partial "helper/external" (dict "Context" . "Namespace" "Cactus")>: error calling partial: "C:\Users\Benni\Documents\blog\themes\stack\layouts\partials\helper\external.html:1:13": execute of template failed: template: partials/helper/external.html:1:13: executing "partials/helper/external.html" at <index .Context.Site.Data.external .Namespace>: error calling index: index of untyped nil Error: Error building site: failed to render pages: render of "page" failed: execute of template failed: template: _default/single.html:25:11: executing "main" at <partial "comments/include" .>: error calling partial: execute of template failed: template: partials/comments/include.html:2:7: executing "partials/comments/include.html" at <partial (printf "comments/provider/%s" .Site.Params.comments.provider) .>: error calling partial: execute of template failed: template: partials/comments/provider/cactus.html:2:4: executing "partials/comments/provider/cactus.html" at <partial "helper/external" (dict "Context" . "Namespace" "Cactus")>: error calling partial: "C:\Users\Benni\Documents\blog\themes\stack\layouts\partials\helper\external.html:1:13": execute of template failed: template: partials/helper/external.html:1:13: executing "partials/helper/external.html" at <index .Context.Site.Data.external .Namespace>: error calling index: index of untyped nil

Expected behavior

The comments provider should change to cactus comments and the build should succeed.

To Reproduce

Indicate the steps to reproduce this bug, if applicable.

Screenshots

Add screenshots to help explain your problem.

Environment

Additional context

Add any other context about the problem here.

Content of config.yaml

### Paste the content of the config file here
baseurl: https://darkshark9k.ml
languageCode: en-us
theme: stack
paginate: 5
title: darkshark9k

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

# Set hasCJKLanguage to true if DefaultContentLanguage is in [zh-cn ja ko]
# This will make .Summary and .WordCount behave correctly for CJK languages.
hasCJKLanguage: false

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

params:
    mainSections:
        - post
    featuredImageField: image
    rssFullContent: true
    favicon:

    footer:
        since: 2022
        customText:

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

    sidebar:
        emoji: 🦈
        subtitle: Ramblings about stuff.
        avatar:
            enabled: true
            local: false
            src: /img/avatar.jpg

    article:
        math: false
        toc: true
        readingTime: true
        license:
            enabled: true
            default: Licensed under CC BY-NC-SA 4.0
    comments:
        enabled: true
        provider: cactus

        disqusjs:
            shortname:
            apiUrl:
            apiKey:
            admin:
            adminLabel:

        utterances:
            repo:
            issueTerm: pathname
            label:

        remark42:
            host:
            site:
            locale:

        vssue:
            platform:
            owner:
            repo:
            clientId:
            clientSecret:
            autoCreateIssue: false

        # 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

        twikoo:
            envId:
            region:
            path:
            lang:

        # See https://cactus.chat/docs/reference/web-client/#configuration for description of the various options
        cactus:
            defaultHomeserverUrl: "https://matrix.cactus.chat:8448"
            serverName: "cactus.chat"
            siteName: "darkshark9k" # You must insert a unique identifier here matching the one you registered (See https://cactus.chat/docs/getting-started/quick-start/#register-your-site)

        giscus:
            repo:
            repoID:
            category:
            categoryID:
            mapping:
            lightTheme:
            darkTheme:
            reactionsEnabled: 1
            emitMetadata: 0

        gitalk:
            owner: 
            admin:  
            repo: 
            clientID: 
            clientSecret: 

        cusdis:
            host: 
            id: 
    widgets:
        enabled:
            - search
            - archives
            - tag-cloud

        archives:
            limit: 5

        tagCloud:
            limit: 10

    opengraph:
        twitter:
            # 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.html
### To remove about, archive and search page menu item, remove `menu` field from their FrontMatter
menu:
    main:
        - identifier: home
          name: Home
          url: /
          weight: -100
          params:
              newTab: false
              icon: home

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

        - name: categories
          weight: 200

markup:
    goldmark:
        renderer:
            ## Set to true if you have HTML content inside Markdown
            unsafe: false
    tableOfContents:
        endLevel: 4
        ordered: true
        startLevel: 2
    highlight:
        noClasses: false

Link to the demo site and/or source repository

The source repository is located at: https://github.com/benjaminwolkchen/blog

CaiJimmy commented 2 years ago

Should be fixed now. Thanks!

bennihtm commented 2 years ago

Thank you for making this theme! 🤍