GithubHelp home page GithubHelp logo

Comments (11)

 avatar commented on May 26, 2024 3

Pushed!

So from now on just add usepostimgfolder = true to the config.toml file under [params] if you want a non standard set-up, eg use post folder for images. Simple as that :-)

from hugo-nederburg-theme.

pks111607 avatar pks111607 commented on May 26, 2024

I used the following directory structure:

site
  |--content
    |--post
      |--some-directory-heading
        |--index.md
        |--railroad-forest1.jpg

Images seem to be relative to the directory, so the image URL would simply be:

image = "railroad-forest1.jpg"

Perhaps you have a different use case?

from hugo-nederburg-theme.

tmess567 avatar tmess567 commented on May 26, 2024

Caused by
0c596f1

I reverted the changes in my fork and it works.
https://blog.tusharmishra.in/

from hugo-nederburg-theme.

brorio avatar brorio commented on May 26, 2024

Hm, to me the simplest solution seems to be @pks111607. Why revert changes then?

Maybe there is a need for better documentation. I will look in to this.

from hugo-nederburg-theme.

fleaz avatar fleaz commented on May 26, 2024

Just ran into the same issue with this theme.
Imho keeping the content and the images separated is the cleaner and also more intuitive way to go. With the current codebase the header image would be in the content/posts/ folder, whereas all images used inside the post would still be in static/.

Therefore I'm also running a fork where the mentioned commit is reverted.

from hugo-nederburg-theme.

tmess567 avatar tmess567 commented on May 26, 2024

Netlify-cms (which I use for authoring content) defaults to a static directory.

Configuration options are listed here.
Netlify-cms configuration

from hugo-nederburg-theme.

scottyw avatar scottyw commented on May 26, 2024

I ran into the same issue, which brought me here too.

I'm finding the exampleSite to be broken at the moment, plus the live demo on themes.gohugo.io seems to show the same problem: https://themes.gohugo.io/theme/hugo-nederburg-theme/

from hugo-nederburg-theme.

 avatar commented on May 26, 2024

Ok, I will try to see if this would work.

In config settings

# Unmark to use post folder for images. Default is static folder.

#UsePostImgFolder = true

In templates image tags:

{{if isset .Site.Params "usepostimgfolder"}}data-background="{{ .Permalink }}{{ .Params.image }}{{ else }}data-background="{{ .Params.image | absURL }}"{{ end }}

This way it will work as before and if you want to have images in the post folder you unmark the seetings in the config file if you have it there.

from hugo-nederburg-theme.

fleaz avatar fleaz commented on May 26, 2024

Sounds good. Thanks for the fix :)

from hugo-nederburg-theme.

scottyw avatar scottyw commented on May 26, 2024

Thanks @appernetic! I just tried your changes with success.

from hugo-nederburg-theme.

 avatar commented on May 26, 2024

It still does not seem to work on Hugo Themes and there is other weird issues with links there.

from hugo-nederburg-theme.

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.