Closed torieketcham closed 3 years ago
Hmm. Hard to see what is going on here.
The files seem to be in the correct place, and the widget is showing up on the page:
The problem is that the image is not found at the address it is expected (https://marinebon2.netlify.app/static/media/mbon_goos_framework.png). The image is actually being served at https://marinebon2.netlify.app/media/mbon_goos_framework.png. I'm not sure why the /static/
is getting removed. For some reason the CMS is assuming one url when uploading the image and another url when looking for it. I don't see anything in the .toml files to explain this.
Need to do some more looking.
Looking at this again now.
It looks like the relevant config options for the netlify CMS should be in /admin/config.yml
(config options docs).
We don't have that file in this repo.
We don't even have an /admin/
dir.
The values must be inheriting from the academic template, the wowchemy base code, or else defaults are being used by hugo.
I think we can create a /admin/config.yml
in this repo to override those settings but I want to find where the issue stems from first.
/admin/
dir. There is a /config/_default/config.yaml
file, but that is something different - hugo config I think.config.yaml
either. After some more creative searching I did find /wowchemy-cms/data/wowchemy_cms_tpl.yaml, which looks like a template of the netlify config file. I can't confirm that without digging deeper into how wowchemy, netlify, & hugo work. It looks like that file might be getting injected here, but how that works is unclear at this time. The netlify config docs specify that a custom url can be used along with a link tag and rel="cms-config-url"
; weirdly: a search for cms-config-url
turns up nothing - however this works is confusing.Created a new homepage widget to reproduce the error with new config.yml in place. Exact same result, as expected.
I am still not understanding what is happening here.
Images are going into static/media
but I think /admin/config.yml
says they should go to /static/media
- that directory DNE.
The change to /admin/config.yml
might not have any affect at all - in fact I think it would be throwing errors if it were being used b/c of the handlebars ({{ }}
) in there.
The only relevant search result from the academic template for static
is this section of init_kickstart.sh
.
I don't know how that file gets used; a search for init_kickstart
returned no results.
did another test of adding an image widget. The issue persists.
I need to revisit and dig deeper into where the netlify config is coming from.
The /admin/config.yml
file is being ignored and that is unexpected.
@bbest : have you used wowchemy/netlify for another site? I am having a lot of trouble setting netlify's configuration options and I don't understand where the netlify configuration options are coming from for this repository.
@bbest and I debugging more now:
update_wowchemy.sh
.
/static/media
and now it is /assets/media
go.mod
and go.sum
files. These were updated by the update_wowchemy.sh
script and the content looks reasonable when comparing to the latest from starter-academic.Gonna take a break from this then come back. Tentative plan for moving forward is to find a workaround for getting images onto the homepage - possibly without using the widgets.
Since migrating all static/media
instances to assets/media
, the /admin interface will properly upload imagery into /assets/media/
and browse for selection there, but creating a new homepage entry image requires manually stripping off the excess prefix:
image: /assets/media/mbon_goos_framework.png
image: mbon_goos_framework.png
For instance, see difference in commit https://github.com/marinebon/www_marinebon2/commit/676b48dac5dd6601f94a328e9572ac75f61d7802.
Here's a bit more background.
If the image
path isn't set right, the problems show up in the Netlify Deplyoys (https://app.netlify.com/sites/marinebon2/deploys) like so:
4:20:00 PM: ────────────────────────────────────────────────────────────────
4:20:00 PM: 1. build.command from netlify.toml
4:20:00 PM: ────────────────────────────────────────────────────────────────
4:20:00 PM:
4:20:00 PM: $ hugo --gc --minify -b $URL
4:20:02 PM: hugo: collected modules in 1735 ms
4:20:02 PM: Start building sites …
4:20:03 PM: ERROR 2021/05/03 23:20:02 Couldn't find `/static/media/intro_image_test2.png` in the `assets/media/` folder - please add it.
ERROR 2021/05/03 23:20:03 Couldn't find `/static/media/intro_image_test3.png` in the `assets/media/` folder - please add it.
ERROR 2021/05/03 23:20:03 Couldn't find `https://marinebon2.netlify.app/media/intro_image_test2.png` in the `assets/media/` folder - please add it.
@torieketcham : Take a look at the images added to the homepage. The full-width one that scrolls weirdly is the default behavior of the widget as you were trying to use it. If we want that behavior we can make it happen but I think your intention was probably different for this image.
I just added a section for the image in a different way and I think it better matches your intention. I think adding th
![](/assets/media/mbon_goos_framework.png)
to ![](https://marinebon2.netlify.app/media/mbon_goos_framework.png)
https://marinebon2.netlify.app/media/intro_image_test4-bb.png
work but https://marinebon2.netlify.app/assets/media/mbon_goos_framework.png
does not? Weird....So I guess this doesn't work right now.
Hi @7yl4r - yes, I was going to ask you both about removing that parallax effect on the image. I had tried moving the image to the body section too, with no luck.
Hey @7yl4r,
Unfortunately this commit ∆ test label in netlify cms · marinebon/www_marinebon3@ff672f4 and visiting marinebon3.netlify.app/admin demonstrated that copying from wowchemy/wowchemy-hugo-modules: data/wowchemy_cms_tpl.yaml into admin/config.yml does not allow us to tweak the Netlify CMS interface to fix this issue.
Other possibilities:
Fork wowchemy/wowchemy-hugo-modules into marinebon, edit wowchemy-cms/data/wowchemy_cms_tpl.yaml and update our own marinebon/www_marinebon3: config.yaml like so:
module:
imports:
- path: github.com/marinebon/wowchemy-hugo-modules/wowchemy-cms
@bbest @7yl4r just checking back in with this. Can you let me know how I should be adding images for the homepage (and subpages) - or are we still working through the issue?
We are still working on this. I am feeling stuck on it. @bbest : do you have more ideas?
Do you think I should continue to work on other aspects of the site (right now I am adding publications, which have their own minor challenges, although they don't seem to be insurmountable)? I'm just wary of expending a lot of effort if our determination is that we should move forward with a different solution.
No matter what solution we choose I am certain it will work with markdown formatted documents. Any effort spent creating markdown documents will not be wasted.
It's fixed.
I don't exactly know how but part of our issue was putting the CMS config at /admin/config.yml
but it should have been at /content/admin/config.yml
.
Let's leave this issue open until we finish ironing this out and cleaning up our testing messes.
/content/admin/config.yml
to be sure all is as it should be (rm -TEST
stuff I added)Does this mean that adding new images to the /assets/media folder (for example arms_mbon.png) will work? I tried to do so on a news article but without success.
Does this mean that adding new images to the /assets/media folder (for example arms_mbon.png) will work? I tried to do so on a news article but without success.
You are talking about https://marinebon2.netlify.app/post/arms-mbon-a-new-network-for-genetic-monitoring-and-early-detection-of-non-indigenous-marine-species/ ? It looks like the image is working as expected.
There may be better ways to organize the placement of images.
Maybe folders within /assets/media
?
Maybe images can also go in /content/post/*
folders?
I do not know what might works or makes most sense for this.
I solved the problem on that page by uploading the image directly within the Netlify interface rather than trying to link to an existing image URL. It looks like it's set up so that images for a given section (posts, products etc) will go in that particular folder.
As a follow-on to this, I attempted to add an image to this page, both with markdown and using the prose.io interface, and nothing is showing up. So I am not sure how to make this work.
I'm bypassing Wowchemy templates completely and just using a blank widget with markup for the intro on the homepage, but still running into trouble with images. Any way you could take another look at this?
I just posted a discussion to the wowchemy folks here. Hopefully some fresh eyes on the problem will help because this seemingly simple problem has fried my brain.
Here is a possible workaround:
/static/
so they are served without hugo checking urls (ref).![my image alt text](/static/img/post2/whatever.png)
.Interestingly, while your above recommendation does not appear to work, the image is now showing up as mbon_goos_framework.png (i.e. without anything else in the image path), which it was not doing until just now (I've had it up there for several days and it was displaying as a broken link).
As additional context:
https://marinebon2.netlify.app/static/img/post2/mbon_goos_framework.png - does not work
https://marinebon2.netlify.app/assets/media/mbon_goos_framework.png - does not work
https://marinebon2.netlify.app/mbon_goos_framework.png - now works (but didn't before?)
Okay. Some small surprises here but we can work with it:
https://marinebon2.netlify.app/static/img/post2/mbon_goos_framework.png - does not work
This would work if the image was moved into a directory /static/static/img/post2/
.
https://marinebon2.netlify.app/assets/media/mbon_goos_framework.png - does not work
This is the one that should work using the media_folder
but isn't.
https://marinebon2.netlify.app/mbon_goos_framework.png - now works (but didn't before?)
This means stuff in /static/
get put onto the domain directly.
Here is what I think we should do (assuming it will work):
/static/media_content/
/static/media_content/
as needed to match /content/
subdirectories/static/
location corresponding to the page using them in /content/
![alt txt](/media_content/{img_path}.png)
Example for mbon_goos_framework.png
on the homepage.
/static/media_content/home/
to match /content/home/
intro-image_mbon_goos_framework.png
into /static/media_content/home/
(NOTE: I prefixed the filename with the name of the .md
using it)intro-image.md
to use the image like ![mbon goos framework](/media_content/home/intro-image_mbon_goos_framework.png)
Thoughts?
That works! I've added an image here as well, using your recommendation, and it's showing up too.
Seems like we have figured out a workable workflow for this so I will close in spite of us being unable to make things work as they should.
I'm trying to add an image to the homepage via a blank widget which I've called "Intro-image". It doesn't show up on the site, even though you can see it here Is there something I am missing?