Skip to content

Commit e727101

Browse files
authored
Add pattern to plushie page (#813)
1 parent b35294a commit e727101

File tree

5 files changed

+44
-16
lines changed

5 files changed

+44
-16
lines changed

_collections/_merch/plushies.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,24 @@
22
layout: merch
33
title: TeX Plushies
44
slug: plushies
5-
purchase-url: https://www.guildofstudents.com/shop/product/10317460/
6-
options:
7-
- name: Plushie
8-
quantity: 1
9-
price: 13.99
10-
note: Limited to members only
5+
purchase-options:
6+
- url: https://www.guildofstudents.com/shop/product/10317460/
7+
type: guild
8+
text: Buy on Guild website
9+
icon: fa-arrow-up-right-from-square
10+
options:
11+
- name: Plushie
12+
quantity: 1
13+
price: 13.99
14+
note: Limited to members only
15+
- url: /assets/tex-pattern.pdf
16+
type: download
17+
text: Download
18+
icon: fa-download
19+
options:
20+
- name: Pattern
21+
price: 0
22+
note: For if you want to make one yourself!
1123
gallery:
1224
- url: /assets/images/tex-plushie/20250426_0008_lowres.jpg
1325
alt: TeX reading a book

_layouts/merch.html

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ <h2>Gallery</h2>
3232
{% endif %}
3333
<div class="purchase fadein">
3434
<h2>Purchase options</h2>
35-
{% for option in page.options %}
35+
{% for group in page.purchase-options %}
36+
{% for option in group.options %}
3637
<div class="purchase-option">
3738
{% if option.quantity %}
3839
<div class="option-label with-quantity">
@@ -45,14 +46,19 @@ <h2>Purchase options</h2>
4546
<span class="note">{{ option.note }}</span>
4647
{% endif %}
4748
</div>
48-
<span class="price">£{{ option.price }}</span>
49+
{% if option.price > 0 %}
50+
<span class="price">£{{ option.price }}</span>
51+
{% else %}
52+
<span class="price">Free</span>
53+
{% endif %}
4954
</div>
55+
{% endfor %}
56+
{% if group.url %}
57+
<a href="{{ group.url }}" target="_blank" class="button {{ group.type }}-button"><i class="fas {{ group.icon }}"></i>{{ group.text }}</a>
58+
{% else %}
59+
<a href="#" class="button unavailable-button"><i class="fas fa-ban"></i>Currently unavailable</a>
60+
{% endif %}
5061
{% endfor %}
51-
{% if page.purchase-url %}
52-
<a href="{{ page.purchase-url }}" target="_blank" class="button guild-button">Buy on Guild website <i class="fas fa-arrow-right"></i></a>
53-
{% else %}
54-
<a href="#" class="button unavailable-button"><i class="fas fa-ban"></i>Currently unavailable</a>
55-
{% endif %}
5662
</div>
5763
</div>
5864
</main>

assets/tex-pattern.pdf

71.2 KB
Binary file not shown.

css/merch.scss

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,15 @@
144144
background-color: #5bbaa2;
145145
}
146146

147+
.download-button {
148+
background-color: lightgray;
149+
color: black;
150+
151+
i {
152+
color: black;
153+
}
154+
}
155+
147156
.unavailable-button {
148157
background-color: gray;
149158
cursor: not-allowed;
@@ -180,7 +189,7 @@
180189

181190
.purchase {
182191
width: 100%;
183-
top: -60px;
192+
position: static;
184193
}
185194

186195
.merch-description {

merch.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ <h2 class="merch-title">{{ merch.title }}</h2>
2525
<div class="merch-excerpt">
2626
<p>{{ merch.excerpt | strip_html }}</p>
2727
</div>
28-
{% if merch.options %}
28+
<!-- todo: figure out something better to put here -->
29+
<!-- {% if merch.options %}
2930
{% assign options = merch.options | sort: 'price' %}
3031
<p class="merch-price">from £{{ options[0]['price'] }}</h2>
31-
{% endif %}
32+
{% endif %} -->
3233
</div>
3334
</a>
3435
{% endfor %}

0 commit comments

Comments
 (0)