Code Monkey home page Code Monkey logo

Comments (5)

gellenburg avatar gellenburg commented on July 19, 2024 1

To fix this, you could create a page bundle by adding an additional directory under 2023/08/ (e.g. 2023/08/name-of-post/ and use an index.md file for your post (instead of 01 - Signed the papers...) alongside the images in that directory.

That fixed it! Many thanks! I was just about ready to give up. :-) Appreciate your time and help.

from hugo-liftoff.

wjh18 avatar wjh18 commented on July 19, 2024

It should show up automatically with that naming even without frontmatter parameters as it glob matches *feature*. But the frontmatter you have should work too. Are you not seeing it in your post at all or just not in SEO metadata like OG and Twitter cards? Have you tried clearing cache?

from hugo-liftoff.

gellenburg avatar gellenburg commented on July 19, 2024

Sorry just saw your reply.

Are you not seeing it in your post at all or just not in SEO metadata like OG and Twitter cards?

Not seeing it at all.

Have you tried clearing cache?

Yes. Different browsers even. ;-)

This is the command string I'm using to render the site:

hugo server --buildDrafts --buildExpired --buildFuture --cleanDestinationDir --disableFastRender --disableLiveReload --forceSyncStatic --gc --ignoreCache --noHTTPCache --renderStaticToDisk --renderToDisk

And there is physically no featured image rendered out in the HTML that hugo generates.

from hugo-liftoff.

wjh18 avatar wjh18 commented on July 19, 2024

No problem @gellenburg. After further investigation, I realized the issue is related to page bundles. Page bundle resources are only available in a directory with an index.md or _index.md file. Generally when using page bundles, especially in nested sections, the name of the post should be index.md instead of the title of the post.

To fix this, you could create a page bundle by adding an additional directory under 2023/08/ (e.g. 2023/08/name-of-post/ and use an index.md file for your post (instead of 01 - Signed the papers...) alongside the images in that directory. Alternatively, if you only expect to have a single post within 2023/08/ you could create the index.md there and it would be considered a leaf bundle. There are archetypes for creating these automatically within sections (see docs).

With an _index.md, that would make it a branch bundle which is more appropriate for sections. But generally a leaf bundle is what you want for individual posts, and a branch bundle is only necessary if you want to create a section page for that directory. I hope that makes sense. I don't have much insight into how you want to structure your posts so if more clarification is needed for your specific use case I'd be happy to provide it.

Not sure why I didn't see this previously, so apologies for that. I could've sworn I added support for featured images to fall back to global resources as well but I did not. If that were the case, you would be able to place the images in /assets/ instead of creating a page bundle for them. Perhaps that's something to consider supporting in the future.

from hugo-liftoff.

wjh18 avatar wjh18 commented on July 19, 2024

Awesome, glad that helped.

from hugo-liftoff.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.