How to use hugo-leaflet library or just using leaflet in an Hugo template

59 Views Asked by At

I try to use the library hugo-leaflet but I wasn't able to move forward the first explications.

  • Font Awesome icons is in my project,
  • I downloaded the zip, placed the shortcodes files in theme>layouts>shortcodes,
  • the JS files in theme>assets>js,
  • the images in my-project>assets>images
  • and the min.css file in my-project>public>css
  • I added {{ partial "leaflet-loader" . }} in the html page of my project i wanted to work on
  • and in my <head> {{ if .HasShortcode "leaflet-map" }} {{ partial "leaflet-loader" . }} {{ end }}

but when I pasted {{< leaflet-map mapHeight="500px" mapWidth="100%" mapLat="27.66995" mapLon="85.43249" >}} in my .md content file I have this error in my console: failed to unmarshal YAML: yaml: line 7: could not find expected ':'

I guess I'm doing something wrong but I can't find what. It's the first time I use Hugo and Leaflet and now I'm quite lost. What can I try next?

I try to use leaflet without the library but I wasn't able to use customIcon and clusterMarker.

0

There are 0 best solutions below