Comments (11)
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.
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.
Caused by
0c596f1
I reverted the changes in my fork and it works.
https://blog.tusharmishra.in/
from hugo-nederburg-theme.
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.
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.
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.
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.
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.
Sounds good. Thanks for the fix :)
from hugo-nederburg-theme.
Thanks @appernetic! I just tried your changes with success.
from hugo-nederburg-theme.
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)
- Date format HOT 3
- horizontal lines when clicking on side bar HOT 4
- Licensing Issue HOT 5
- Show post description as summary in homepage HOT 3
- images are cropped HOT 1
- Anyone know why we need static/js/production.min.js ? HOT 2
- Lightbox
- Flickr HOT 5
- function "newScratch" not defined HOT 3
- .RSSLink is deprecated and will be removed in a future release HOT 2
- logo problem HOT 4
- Upgrade from jQuery v1.12.4 to v3.4.1
- No grid post on Homepage (not like the screenshot) HOT 3
- How to display a description for categories ?
- multilanguage support HOT 3
- Hugo .57.2 and later break for RSS HOT 1
- Add site logo to left of title/slogan HOT 2
- Reduce minimum window width to collapse 'Home' bar
- Is there any sign of life for this theme? Someone have a fork with fixes/new features? HOT 1
- can't build site anymore after upgrade of Hugo HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hugo-nederburg-theme.