Comments (7)
Agreed - can you add a description with a little more info?
from one-click-hugo-cms.
@easherma, sorry, it's not public, but here is the structure I ended up going with:
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.
Done
from one-click-hugo-cms.
@brasilikum can you link to your approach? I'm wrestling with the same issue.
from one-click-hugo-cms.
from one-click-hugo-cms.
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.
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)
- Serve site from subdirectory HOT 1
- Dependency Dashboard
- Image preview on Value page not working HOT 3
- Bug: 1-click site generation fails HOT 2
- switch from master to main HOT 1
- Git Gateway Error accessing Admin panel on a brand-new one-click deployment HOT 5
- Build and start issues (maybe sass related) HOT 2
- Found no layout file for “HTML” for kind “taxonomy”: You should create a template file which matches Hugo Layouts Lookup Rules for this combination HOT 1
- Adds maintenance tooling HOT 1
- New stewardship and direction HOT 2
- Updating the build pipeline to include custom CMS templates for preview HOT 1
- [Production mode] Tachyons media queries are not working HOT 3
- Styling appears differently when running locally vs deployed to netlify HOT 4
- Deployment
- No rendered page after deploying on Netlify HOT 2
- Supplied tech.md page not editiable through the Netlify CMS interface
- Delete master branch and merge #479 into main HOT 1
- Teste site
- Response for config.yml was not yaml HOT 1
- npm install fails with npm ERR! notarget No matching version found for decap-cms-widget-date@^2.5.7. HOT 6
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 one-click-hugo-cms.