CaiJimmy / hugo-theme-stack

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

在菜单栏中的 md ,图片无法使用 Typlog 语法对图片布局 #438

Closed guowei-gong closed 2 years ago

guowei-gong commented 2 years ago

嗨,我想制作一个 相册 页面,当我新建这个页面后,发现 Typlog 语法失效了,如下图所示: image

zhixuan2333 commented 2 years ago

Please use the bug report template and provide enough debug information.

请使用错误报告模板并提供足够的调试信息。

guowei-gong commented 2 years ago

(。・_・。) 抱歉,我会尝试重新使用模板来描述遇见的问题。

我已经阅读文档

Describe the bug

文章中的 Typlog 相册语法失效。 这个文章是一个页面~

Expected behavior

我可以使用 Typlog 语法来布局我的图片。

To Reproduce

  1. 创建一个页面 hugo new page/photo.md

  2. 在这个页面中写入 Typlog 语法 vim photo.md

    ![Photo by Florian Klauer on Unsplash](florian-klauer-nptLmg6jqDo-unsplash.jpg)  ![Photo by Luca Bravo on Unsplash](luca-bravo-alS7ewQ41M8-unsplash.jpg) 

Screenshots

预期我的 Typlog 语法会生成一个并排的格式,但显然,它是一个上下的格式。 image

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://example.com
languageCode: en-us
theme: hugo-theme-stack
paginate: 5
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, zh-tw, es, de, nl, it, th, el, uk
DefaultContentLanguage: zh-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:
        - post
    featuredImageField: image
    rssFullContent: true
    favicon: https://s3.bmp.ovh/imgs/2021/11/9e5f687dc7202e72.png

    footer:
        since: 2021
        customText:

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

    sidebar:
        emoji: 🎐
        subtitle: 写下、记下、留下
        avatar:
            enabled: true
            local: true
            src: img/avatar.png

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

    comments:
        enabled: true
        provider: gitalk

        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: gongguowei-9g22kyit080f9ff3
            region: shanghai
            path: 
            lang: zh-cn

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

        gitalk:
            owner: guowei-gong
            admin: guowei-gong
            repo: hexo-site-comments
            clientID:
            clientSecret: 

        cusdis:
            host: 
            id: 

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

        archives:
            limit: 5

        tagCloud:
            limit: 10

    opengraph:
        twitter:
            # Your Twitter username
            site:

            # 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: 首页
          url: /
          weight: -100
          params:
              ### For demonstration purpose, the home link will be open in a new tab
              newTab: false
              icon: index-2

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

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

demo site: https:// gongguowei.com -> 左侧相册

zhixuan2333 commented 2 years ago

不是因为你没有放图片吗?请问你把照片放哪了?

guowei-gong commented 2 years ago

不是因为你没有放图片吗?请问你把照片放哪了?

当我放好照片后,它们仍然是上下的排版,而不是预期的左右排版

CaiJimmy commented 2 years ago

https://gohugo.io/content-management/page-bundles/

是文件名不规范导致的。

要使用 Page Bundles 功能(插图),需要单独创建一个 page/photo 文件夹。把 photo.md 改名成 index.md,和页面图片一并移动到 page/photo 文件夹下。

guowei-gong commented 2 years ago

https://gohugo.io/content-management/page-bundles/

是文件名不规范导致的。

要使用 Page Bundles 功能(插图),需要单独创建一个 page/photo 文件夹。把 photo.md 改名成 index.md,和页面图片一并移动到 page/photo 文件夹下。

感谢,这个回答解决了我的问题~ image