This is a shortcode for adding a widget to your Hugo blog. It will display the current (or last) track you scrobbled to Last.fm.
-
Get yourself an API key at Last.fm.
-
Copy the contents of layouts/contents/shortcodes to the same directory in your Hugo source tree. If you don’t have that directory, create it.
-
Copy the contents of static to the same directory in your Hugo source tree. You probably have a static directory, but it might be empty if you haven’t added any static resources yet.
-
Time to add the widget to a page!
Here’s the shortcode:
{{< nowplaying user="LAST_FM_USER" key="LAST_FM_KEY" >}}
You should see a widget like this:
The styling is nothing to write home about. If you want to dress up the (ugh) CSS, feel free to send me a PR.