UNPKG

contentful-hugo

Version:

Node module that pulls data from Contentful and turns it into markdown files for Hugo. Can be used with other Static Site Generators, but has some Hugo specific features.

30 lines (23 loc) 897 B
<!-- For all entries you have access to the following parameters through .Get "id", "contentType", and "parentContentType" --> {{- $entryId := .Get "id" -}} {{- $contentType := .Get "contentType" -}} {{- $parentContentType := .Get "parentContentType" -}} <!-- render custom block or call partial depending on the contentType and/or parentContentType --> {{- if eq $contentType "__custom-content-type__" -}} <!-- fallback --> {{- else -}} <div style="background: <<BACKGROUND_COLOR>>; color: <<TEXT_COLOR>>; border: 1px solid <<BORDER_COLOR>>; border-radius: 5px; padding: 25px; margin-bottom: 1rem"> <div><strong>Unconfigured Embedded Entry</strong></div> <div>id: {{ $entryId }}</div> <div>contentType: {{ $contentType }}</div> <div>parentContentType: {{ $parentContentType }}</div> </div> {{- end -}}