adityatelange / hugo-PaperMod

A fast, clean, responsive Hugo theme.
https://adityatelange.github.io/hugo-PaperMod/
MIT License
10.22k stars 2.72k forks source link

[BUG] The cover image declared in the frontmatter doesn't appear anymore after the last theme update #1355

Closed nicfab closed 11 months ago

nicfab commented 11 months ago

Describe the bug

Steps to reproduce the behavior:

Under /folder/themes/PaperMod I run git stash and git pull to update the PaperMod theme Thus I ran hugo server to see the website and the cover image doesn't appear anymore. The same it happens if I deploy the local content to the server via rsync. You see what I mean here: https://notes.nicfab.eu/en/

Expected behavior:

To see the cover images of every post.

adityatelange commented 11 months ago

Hi @nicfab, didn't find issue with demo site please check https://adityatelange.github.io/hugo-PaperMod/posts/papermod/papermod-installation/ https://adityatelange.github.io/hugo-PaperMod/posts/markdown-syntax/

nicfab commented 11 months ago

Hi @nicfab, didn't find issue with demo site please check https://adityatelange.github.io/hugo-PaperMod/posts/papermod/papermod-installation/ https://adityatelange.github.io/hugo-PaperMod/posts/markdown-syntax/

Thank you for getting back to me.

My config.yml is the following:

baseURL: "https://notes.nicfab.eu/"
languageCode: en-us
timeZone: Europe/Rome
DefaultContentLanguage: en
defaultContentLanguageInSubdir: "true"
title: NicFab
paginate: 10

theme:
    - PaperMod
    - matomo
    - hugo-embed-pdf-shortcode

enableRobotsTXT: true
buildDrafts: false
buildFuture: false
buildExpired: false
enableEmoji: true

params:
    matomo:
        url: "https://matomo.nicfab.eu"
        id: 1
        track:
            button:
                "1. [EN]: **Allow** tracking (or choose 2) - [IT]: **Consento** al
                tracking (o scegli 2)"
            message:
                "**[EN] Confirmation**: You **allowed** tracking - **[IT] Conferma:**
                **Hai consentito** al tracking"
        block:
            button: "2. [EN]: **Disallow** tracking - [IT]: **Non consento** al tracking"
            message:
                "**[EN] Confirmation**: You are **not** tracked. - **[IT] Conferma:** I
                dati di sessione **non** sono raccolti."

    # profile-mode
    profileMode:
    enabled: false # needs to be explicitly set
    env: production
    title: NicFab Notes
    name: NicFab
    description: "NicFab Notes"
    keywords: [Blog, Privacy, Digitaltech]
    author: NicFab
    images: "static/images"
    DateFormat: "2 January 2006"
    displayFullLangName: true
    defaultTheme: light
    disableThemeToggle: true
    ShowReadingTime: true
    ShowShareButtons: true
    ShowPostNavLinks: true
    ShowBreadCrumbs: true
    ShowCodeCopyButtons: true
    ShowFullTextinRSS: true
    ShowWordCount: true
    ShowRssButtonInSectionTermList: true
    UseHugoToc: true
    disableSpecial1stPost: false
    disableScrollToTop: false
    comments: true
    hidemeta: false
    hideSummary: false
    showtoc: true
    tocopen: true
    enableInlineShortcodes: true
    mermaid: true

    assets:
        favicon: "/favicon.ico"
        favicon16x16: "/favicon-16x16.png"
        favicon32x32: "/favicon-32x32.png"
        apple_touch_icon: "/apple-touch-icon.png"
        safari_pinned_tab: "/safari-pinned-tab.svg"

    label:
        text: "NicFab Notes"
        icon: /images/logo.jpg
        iconHeight: 103

    homeInfoParams:
        Title: ""
        Content: ""

    socialIcons:
        - name: Mastodon
          url: "https://fosstodon.org/@nicfab"
        - name: twitter
          url: "https://twitter.com/nicfab"
        - name: LinkedIn
          url: "https://www.linkedin.com/in/nicfab/"
        - name: Facebook
          url: "https://facebook.com/nicfab"
        - name: github
          url: "https://github.com/nicfab"
        - name: xmpp
          url: "https://xmpp.org"
        - name: Matrix
          url: "https://matrix.to/#/@nicfab:matrix.org"
        - name: sessionmessenger
          url: "https://getsession.org"
        - name: telegram
          url: "https://t.me/nicfabnews"
        - name: ORCID
          url: "https://orcid.org/0000-0002-8188-7656"
        - name: researchgate
          url: "https://www.researchgate.net/profile/Nicola-Fabiano"
        - name: pgpkey
          url: "https://keys.openpgp.org/vks/v1/by-fingerprint/7CF4F08F23C727513BD9D7A4716C60CE54A3DEB5"

    cover:
        hidden: false
        hiddenInList: true
        hiddenInSingle: true

    fuseOpts:
        isCaseSensitive: false
        shouldSort: true
        location: 0
        distance: 1000
        threshold: 0.4
        minMatchCharLength: 0
        limit: 10 # refer: https://www.fusejs.io/api/methods.html#search
        keys: ["title", "permalink", "summary", "content"]

frontmatter:
    date:
        - date
        - publishDate
        - lastmod
    expiryDate:
        - expiryDate
    lastmod:
        - :git
        - lastmod
        - date
        - publishDate
    publishDate:
        - publishDate
        - date
        - :default

author:
    name: NicFab

languages:
    en:
        contentDir: content/en/
        title: NicFab Notes
        languageCode: ":gb: EN"
        languageName: ":gb: EN"
        weight: 1
        menu:
            main:
                - identifier: home
                  name: Home
                  pageref: /
                  weight: 1
                - identifier: about
                  name: About
                  pageref: /about
                  weight: 2
                - identifier: blog
                  name: Blog
                  url: https://www.nicfab.it
                  weight: 3
                - identifier: mdown
                  name: Markdown
                  pageref: mkdown
                  weight: 4
                - identifier: apps&srvs
                  name: Apps&Servs
                  pageref: appsandservices
                  weight: 5
                - identifier: archive
                  name: Archive
                  pageref: archives
                  weight: 6
                - identifier: tags
                  name: Tags
                  pageref: tags
                  weight: 7
                - identifier: privacy
                  name: Privacy
                  pageref: /privacypolicy
                  weight: 8
                - identifier: search
                  name: Search
                  pageref: /search
                  weight: 9
    it:
        contentDir: content/it/
        title: Note di NicFab
        languageCode: ":it: IT"
        languageName: ":it: IT"
        weight: 2
        menu:
            main:
                - identifier: home
                  name: Home
                  pageref: /
                  weight: 1
                - identifier: about
                  name: About
                  pageref: /about.it
                  weight: 2
                - identifier: blog
                  name: Blog
                  url: https://www.nicfab.it
                  weight: 3
                - identifier: mdown
                  name: Markdown
                  pageref: mkdown.it
                  weight: 4
                - identifier: apps&srvs
                  name: Apps&Servs
                  pageref: appsandservices.it
                  weight: 5
                - identifier: archivio
                  name: Archive
                  pageref: archives.it
                  weight: 6
                - identifier: tags
                  name: Tags
                  pageref: tags
                  weight: 7
                - identifier: privacy
                  name: Privacy
                  pageref: /privacypolicy.it
                  weight: 8
                - identifier: cerca
                  name: Cerca
                  pageref: /search.it
                  weight: 9

minify:
    disableXML: true
    minifyOutput: true

menu:
    main:
        - identifier: categories
          name: categories
          url: /categories/
          weight: 10
outputs:
    home:
        - HTML
        - RSS
        - JSON

privacy:
    disqus:
        disable: true
    googleAnalytics:
        anonymizeIP: true
        disable: true
        respectDoNotTrack: true
        useSessionStorage: true
    instagram:
        disable: true
        simple: true
    twitter:
        disable: false
        enableDNT: false
        simple: false
    vimeo:
        disable: false
        enableDNT: false
        simple: false
    youtube:
        disable: true
        privacyEnhanced: true

markup:
    goldmark:
        extensions:
            definitionList: true
            footnote: true
            linkify: true
            strikethrough: true
            table: true
            taskList: true
            typographer: true
        parser:
            autoHeadingID: true
            autoHeadingIDType: github
            attribute:
                block: false
                title: true
        renderer:
            hardWraps: true
            unsafe: true
            xhtml: false
    highlight:
        anchorLineNos: false
        codeFences: true
        guessSyntax: false
        hl_Lines: ""
        lineAnchors: ""
        lineNoStart: 1
        lineNos: false
        lineNumbersInTable: true
        noClasses: true
        style: monokai
        tabWidth: 4

taxonomies:
    category: categories
    tag: tags
    series: series

The frontmatter of one article (I use the same for all) is the following:

---
title: "The XMPP Newsletter November 2023"
author: "NicFab"
subtitle: "The XMPP Newsletter November 2023"
summary: "This issue covers the month of November 2023 and will be the last publication for 2023. Many thanks to all our readers and all contributors!"
image: "/images/xmpp/2023/11-2023/gsoc-2023-logo.svg"
tags: ['XMPP','newsletter']
ShowToc: false
cover:
    image: "/images/xmpp/2023/11-2023/gsoc-2023-logo.svg"
    alt: ""
    caption: "XMPP"
    relative: false 
    linkFullImages: false
date: 2023-12-11T02:01:00+01:00
PublishDate: 2023-12-11T02:01:00+01:00
---

As you can see here: https://notes.nicfab.eu/en/ there are no cover images for all the posts.

Where am I wrong? I appreciate any help you can provide.

adityatelange commented 11 months ago

@nicfab I see the below lines

    cover:
        hidden: false
        hiddenInList: true
        hiddenInSingle: true

this hides them from List and Single pages

nicfab commented 11 months ago

@nicfab I see the below lines

    cover:
        hidden: false
        hiddenInList: true
        hiddenInSingle: true

this hides them from List and Single pages

Thank you very much! Yes, indeed. I appreciate your support.

Last thing: I wonder why the social icons on the home page are not centered https://notes.nicfab.eu. Any suggestion?

adityatelange commented 11 months ago

Any suggestion?

can add a custom css with text-align center for .social-icons class

adityatelange commented 11 months ago

@nicfab try

homeInfoParams:
        AlignSocialIconsTo: "center" # or left or right
nicfab commented 11 months ago

@nicfab try

homeInfoParams:
        AlignSocialIconsTo: "center" # or left or right

Thank you very much. You are very kind.

nicfab commented 11 months ago

@nicfab try

homeInfoParams:
        AlignSocialIconsTo: "center" # or left or right

Thank you, but it doesn't work. I found the solution by copying the social_icons.html file from the PaperMod folder to /layout/partials, editing it, and adding <center> and </center> as follows:

<div class="social-icons">
    <center>
    {{- range . }}
    <a href="{{ trim .url " " | safeURL }}" target="_blank" rel="noopener noreferrer me" title="{{ (.title | default .name) | title }}">
        {{ partial "svg.html" . }}
    </a>
    {{- end }}
</center>
</div>
kurotych commented 9 months ago

Thank you @nicfab I had the same problem and your solution helped me.