How to add a background image to a post? #988
Answered
by
sahashirshendu
sahashirshendu
asked this question in
Q&A
-
Hello, in the website I would like to add a static background image for the whole post (something like this). It would be very helpful if anyone could give any idea how to do so. Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Answered by
sahashirshendu
Jul 20, 2022
Replies: 1 comment 1 reply
-
I figured it out: {{ if .Params.imgbg -}}
{{- range first 1 .Params.imgbg -}}
<style>.post-content {background-image: url('{{. | absURL}}');}</style>
{{- end -}}
{{- end -}} and then giving the image path in |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
sahashirshendu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I figured it out:
and then giving the image path in
imgbg
in post header ...Sorry for the inconvenience.