mirror of
https://github.com/nikdoof/website-hugo.git
synced 2025-12-13 12:12:18 +00:00
Render memberships as JSON
This commit is contained in:
@@ -4,6 +4,9 @@ subtitle: Become part of our community.
|
||||
hero_image: /images/hero-img.svg
|
||||
layout: membership
|
||||
show_cta: False
|
||||
outputs:
|
||||
- html
|
||||
- json
|
||||
---
|
||||
Leigh Hackspace is a social enterprise created for the benefit of our members and the wider Leigh community. We depend on memberships and grants to operate, and in return we offer members access to the hackspace's facilities and resources.
|
||||
|
||||
|
||||
7
layouts/page/membership.json
Normal file
7
layouts/page/membership.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{{ $len := (len $.Site.Data.memberships.membership_levels) }}
|
||||
{"memberships": [
|
||||
{{- with $.Site.Data.memberships.membership_levels }}
|
||||
{{- range $index, $element := . -}}
|
||||
{ "name": "{{ .name }}", "price": "{{ .price }}", "period": "{{ default "monthly" .period }}", "link": "{{ .link }}"}{{ if ne (add $index 1) $len }},{{ end }}
|
||||
{{- end }}
|
||||
{{- end }}]}
|
||||
Reference in New Issue
Block a user