Automatic Unsplash Copyright Shortcode for Hugo

I use a lot of photos from unsplash as headers. This shortcode works in two ways to make that easier:

  1. Standard use
    {{< copyright name=“Malte Wingen” href=“” >}}

  2. Automatic parsing of filename
    {{< copyright >}}

First one allows you to customize the name and url, second one will infer that information from the default unsplash filename.

This assumes the following frontmatter data is present:

	- src: images/markus-winkler--TRcaFMV5vk-unsplash.jpg
	  name: "header"

Hope it helps :slight_smile: