3d9b2047d0
added key attribute to merchant array changed item to merchant for clearity added fallback for when no logo is found (no image can be provided) updated guidelines updated json
48 lines
1.9 KiB
Plaintext
48 lines
1.9 KiB
Plaintext
extends ./layout
|
|
|
|
// Merchandise page : when adding a merchandise make sure to add following resources
|
|
+ image of merchandise -- eg. teespring.png
|
|
+ logo of merchant -- eg. teespring-logo.png
|
|
+ update merch.json with extra info about merchandise
|
|
- merch-MERCHANT.KEY-summary -- eg. merch-teespring-summary -> Teespring is and will always be...
|
|
- merch-MERCHANT.KEY-goto -- eg. merch-teespring-goto -> Get myself a Habitica T-Shirts
|
|
+ update this page with an extra merchant (var merchants)
|
|
- key (used in locale files)
|
|
- name (if no logo, this will be shown instead)
|
|
- link
|
|
- image
|
|
- logo (if non provided, name will be shown)
|
|
eg. -> merchants.push({key: 'teespring', name: 'Teespring', link: 'https://teespring.com/habitica-gryphon-t-shirt', image: 'teespring.png', logo: 'teespring-logo.png'})
|
|
|
|
block vars
|
|
- var layoutEnv = env
|
|
|
|
- var merchants = []
|
|
- merchants.push({key: 'teespring', name: 'Teespring', link: 'https://teespring.com/habitica-gryphon-t-shirt', image: 'teespring.png', logo: 'teespring-logo.png'})
|
|
- merchants.push({key: 'stickermule', name: 'Stickermule', link: 'https://www.stickermule.com/uk/marketplace/9317-habitica-gryphon-sticker', image: 'stickermule.png', logo: 'stickermule-logo.png'})
|
|
|
|
block title
|
|
title=env.t('merch')
|
|
|
|
block content
|
|
.row
|
|
.col-md-12
|
|
.page-header
|
|
h3=env.t('merch')
|
|
|
|
// Merchandise block - START
|
|
each merchant, index in merchants
|
|
if (index+1) % 2 !== 0
|
|
.row
|
|
|
|
.col-lg-6.col-md-6.col-sm-12
|
|
.merch-block
|
|
if merchant.logo
|
|
img(src="/merch/" + "#{merchant.logo}")
|
|
else
|
|
h3=merchant.name
|
|
div: a(href="#{merchant.link}" target='_blank'): img.img-rendering-auto(src="/merch/" + "#{merchant.image}")
|
|
p=env.t('merch-' + merchant.key + '-summary')
|
|
a.btn(href="#{merchant.link}" target='_blank')=env.t('merch-' + merchant.key + '-goto')
|
|
// Merchandise block - END
|