Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Use with Cloudinary #177

Open
billhennessy opened this issue Apr 15, 2021 · 1 comment
Open

How to Use with Cloudinary #177

billhennessy opened this issue Apr 15, 2021 · 1 comment

Comments

@billhennessy
Copy link

I am trying to move my image hosting Cloudinary for performance reasons, but I cannot figure out how to get Chunky Poster to use the absolute path.

I've changed the img tag in Card.html to <img src="{{ $.Site.Params.cloudinary_base_url }}/{{ with $page.Params.images }}{{ index . 0 }}{{ end }}" class="card-img-top mx-auto d-block" alt="{{ $page.Title }}">.

In local testing, this produces: http://localhost:1313/https://res.cloudinary/.... I cannot figure out why the base URL to the site is prepended.

Thanks.

@eri24816
Copy link

eri24816 commented Nov 16, 2021

I had a similar issue that I want to put my image on imgur.
It worked after changing

{{- with $page.Params.images -}}
    {{- $images := . -}}
    {{- with $page.Site.GetPage "section" "images" -}}
        {{- with .Resources.GetMatch (strings.TrimPrefix "/images/" (index $images 0)) -}}
            {{- $image := .Fill "700x350" -}}
            <img data-src="{{ $image.RelPermalink }}" class="card-img-top mx-auto d-block" alt="{{ $page.Title }}">
        {{- end -}}
    {{- end -}}
{{- end -}}

to
<img src="{{ $page.Params.image }}" class="card-img-top mx-auto d-block" alt="{{ $page.Title }}">
and adding image: "https://i.imgur.com/dVY5HyZ.jpg" to my post.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants