Giter Site home page Giter Site logo

Comments (7)

erquhart avatar erquhart commented on May 19, 2024 1

Agreed - can you add a description with a little more info?

from one-click-hugo-cms.

brasilikum avatar brasilikum commented on May 19, 2024 1

@easherma, sorry, it's not public, but here is the structure I ended up going with:
screen shot 2018-11-07 at 9 51 41 pm

I am using the following snippet to get a specific image:

    {{ $page := . }}
    {{ with $.Site.GetPage "page" "img/index.md" }}
        {{ $imgPath := split $page.Params.images "/"}}
        {{ $img := index $imgPath 2 }}
        {{ with .Resources.GetMatch $img }}
            {{$img400 := .Fill "800x400 Center"}}
            <img src="{{ $img400.RelPermalink }}">
        {{ end }}
    {{ end }}

Images are flat under the img directory (because of netlify).

The only non image file is the index.md with the following content:

---
title: Images
headless: true
---

Hope it helps

from one-click-hugo-cms.

brasilikum avatar brasilikum commented on May 19, 2024

Done

from one-click-hugo-cms.

easherma avatar easherma commented on May 19, 2024

@brasilikum can you link to your approach? I'm wrestling with the same issue.

from one-click-hugo-cms.

easherma avatar easherma commented on May 19, 2024

from one-click-hugo-cms.

marcojakob avatar marcojakob commented on May 19, 2024

Thanks. Interesting approach.

Using Hugo's image processing will be much more straight forward once NetlifyCMS allows images to be stored relative to content. See decaporg/decap-cms#1472

Then we won't need the workaround with a separate img folder in content with a hack using a headless bundle.

from one-click-hugo-cms.

curzolapierre avatar curzolapierre commented on May 19, 2024

Hello, I can see that (decaporg/decap-cms#1472) issue has been fixed now.

What is the current status of the issue here?
What would be the best way to use the image processing now?

I tried to move the images to site/content/img but still, it seems that .Resources.GetMatch is not able to find them.

from one-click-hugo-cms.

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.