This project provides a shortcode to easily embed Spotify tracks and albums in your micro.blog posts.
To use this shortcode, you can install it from the micro.blog plugin directory.
Navigate to the settings of the plugin (Plugins on the sidebar, then settings next to this plugin) and you've a few options to play with:
- Top margin: Sets the CSS
margin-topinrem. This defaults to 0. - Bottom margin: Sets the CSS
margin-bottominrem. Default is 0. - Height: Sets the vertical size of the embed. Can be
tallorcompact. Default iscompact. - Use colorful theme: Set to
truefor colorful theme,falsefor default spotify theme.
To embed a Spotify track or album, simply use the Spotify share sheet to select a song or album and then use the following shortcode in your Hugo content files, replacing the URL with what you've copied:
{{< spotify url="https://open.spotify.com/track/5vdEuDGGG5PuyHwN6xtc6W?si=0316b808513942d6" >}}Note: You don't need to remove any additional queries that spotify appends to the URL like in the example above. The plugin will strip them for you.
You can also override the default configuration by passing additional parameters:
url: The Spotify URL of the track or album (required).width: The width of the embed. Default is100%.margin-top: Top margin inrem. Overrides the default configuration.margin-bottom: Bottom margin inrem. Overrides the default configuration.
Example usage with additional parameters:
{{< spotify url="https://open.spotify.com/track/5vdEuDGGG5PuyHwN6xtc6W?si=0316b808513942d6" width="80%" margin-top="1" margin-bottom="1" >}}This project is licensed under the MIT License.