CaiJimmy / hugo-theme-stack

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

求助,搜索栏不显示样式、页脚版权信息不显示 #547

Closed 1368129224 closed 2 years ago

1368129224 commented 2 years ago

Describe the bug

新手刚开始搭建,望大佬有空帮忙看看,非常感谢。另 建议建立群组(QQ/微信/tg)方便用户交流。

  1. 搜索栏 不显示样式,无placeholder如图 image image
  2. 页脚版权链接不显示 image

Expected behavior

  1. 搜索栏样式正常 image
  2. 页脚版权信息显示正常

Environment

Additional context

已将themes\hugo-theme-stack中的assets复制到根目录,将exampleSite\content中部分内容复制到content中。

Content of config.yaml

baseurl: https://blog.zooter.com.cn
languageCode: zh-cn
theme: hugo-theme-stack
paginate: 10
title: 新泽雪冬

languages:
    cn:
        languageName: 中文
        title: 新泽雪冬
        weight: 2

# 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, zh-tw, es, de, nl, it, th, el, uk, ar
DefaultContentLanguage: cn

# 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:
        - posts
    featuredImageField: image
    rssFullContent: true
    favicon: 

    footer:
        since: 2022
        customText:

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

    sidebar:
        emoji: 🍥
        subtitle: 认清现实,放弃幻想。
        avatar:
            enabled: true
            local: true
            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: utterances

        utterances:
            repo: 1368129224/blog
            issueTerm: pathname
            label: github-light

    widgets:
        homepage:
            - type: search
            - type: about
            - type: archives
              params:
                  limit: 5
            - type: categories
              params:
                  limit: 10
            - type: tag-cloud
              params:
                  limit: 10
        page:
            - type: toc

    opengraph:
        github:
            site: 

            # Available values: summary, summary_large_image
            card: summary

    defaultImage:
        opengraph:
            enabled: true
            local: true
            src: img/bg.jpg

    colorScheme:
        # Display toggle
        toggle: false

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

    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: []

    social:
        - identifier: github
          name: GitHub
          url: https://github.com/1368129224
          params:
              icon: brand-github

        - identifier: twitter
          name: Twitter
          url: https://github.com/136812922222
          params:
              icon: brand-twitter

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
        codeFences: true
        guessSyntax: true
        lineNoStart: 1
        lineNos: true
        lineNumbersInTable: true
        tabWidth: 4

Link to the demo site and/or source repository

https://github.com/1368129224/Blog https://blog.zooter.com.cn/

at2er commented 2 years ago

把主题文件夹里的i18n里的zh-cn重新命名为cn试试?

CaiJimmy commented 2 years ago

DefaultContentLanguage: cn

改成 zh-cn

然后把 /content/_index.cn.md 改成 /content/_index.zh-cn.md

1368129224 commented 2 years ago

DefaultContentLanguage: cn

改成 zh-cn

然后把 /content/_index.cn.md 改成 /content/_index.zh-cn.md

尝试:

  1. /content/_index.cn.md 改成 /content/_index.zh-cn.md
  2. DefaultContentLanguage 改为 zh-cn 后,会报错

    hugo server
    
    Error: site config value "zh-cn" for defaultContentLanguage does not match any language definition

    解决:

只需要把 /content/_index.cn.md 改成 /content/_index.zh-cn.mdDefaultContentLanguage 保持 cn,版权信息和搜索栏样式就正常显示了。

谢谢两位!!