Fails to load locally required JS
Attempting to get this library to render a map and so far it has not worked out. This might be an issue that is specific to the hugo theme that I am incorporating. It facilitates postcss.js, which could be preventing the library from loading.
First off, I am unsure whether the library's files should be placed within the theme or within the site itself. You mentioned modifying the partial head.html, but did not clarify if we are to modify and save it to site/layouts/partials or whether we are to save it to site/themes/ourtheme/layouts/partials. The same for the css, imgs, and js. Do they belong in the theme or in the site, and do the js files need to be placed in /assets/js or in /static/js?
I have tried both ways and all at once, and the best that I receive is an error output that resembles "leaflet.elevation.{{$HASH}}.js cannot be loaded".
You can save it to site/layout/partials and /asset/js/.
I used library in this project
My apologies, your project is a brilliant contribution to Hugo, and now works. I should have closed this issue out weeks ago.
In order to employ use of the project, I wound up creating a shortcode for it.
But, while I am thinking of it. Is there anyway to load the coordinates for markers and map from a JSON file?
Hi @anoduck, can you maybe share that shortcode? I can't get the map to run either, unfortunately with my theme? When I add the shortcode {{< leaflet-map mapHeight="500px" mapWidth="100%" mapLat="27.66995" mapLon="85.43249" >}} nothing is being rendered. The only console error I am getting is (index):76 Uncaught ReferenceError: leafletMapsObj is not defined at (index):76. I think the leafletMapsObj is related to the mapID that is generated automatically? Any help is very much appreciated!
Sorry for my late response @Dkp22, to say the least, life has been too busy.
OK, so...a little heads up...I hacked this, it is not going to be pretty.
Here is the gist I created from the shortcode and the page.
Hope this helps out. Everyone has their own way of doing things, sometimes that way does not jive, and other times it does. So is life...
No matter what I do, I also can't get this to work. Console keeps showing the error leafletMapsObj is not defined.
It would be wonderful if this repo and the installation instructions could be updated.
Finally was able to get this working with the fixes here:
https://github.com/altrdev/hugo-leaflet/pull/9
@pensivedog Glad you took the initiative, and took care of business. I was rather disposed yesterday. Cheers.
I guess it is well past time for me to close this one out.