Skip to content

Commit a65d8fc

Browse files
committed
demo page
1 parent dd42e6c commit a65d8fc

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

11ty-source/_layouts/demo.liquid

+13-7
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,23 @@ layout: default.liquid
4848
<hr>
4949

5050
<ul class="pager">
51+
5152
{% assign prevDemo = collections.demo-item | getPreviousCollectionItem %}
5253
{% if prevDemo %}
5354
<li class="previous">
5455
<a href="{{prevDemo.url}}" title="Previous">
55-
{% comment %} <img src="<%= @getThumbnail("/images/demos/#{@getPagerPrevious('demos').attributes.title}.png", "zoomcrop", { w: 70, h:70 }) %>" alt="Previous"> {% endcomment %}
56+
{% capture imgURL %}src/files/images/demos/{{prevDemo.data.title}}.png{% endcapture %}
57+
{% image imgURL, "Previous", 70, 70 %}
5658
</a>
5759
</li>
5860
{% endif %}
5961

60-
{% comment %} this is to loop back to the last demo, if you're on the first one {% endcomment %}
6162
{% unless prevDemo %}
63+
{% assign lastDemo = collections.demo-item | last %}
6264
<li class="previous">
63-
<a href="<%= @getLast('demos').attributes.url %>" title="Previous">
64-
{% comment %} <img src="<%= @getThumbnail("/images/demos/#{@getLast('demos').attributes.title}.png", "zoomcrop", { w: 70, h:70 }) %>" alt="Previous"> {% endcomment %}
65+
<a href="{{lastDemo.url}}" title="Previous">
66+
{% capture imgURL %}src/files/images/demos/{{lastDemo.data.title}}.png{% endcapture %}
67+
{% image imgURL, "Previous", 70, 70 %}
6568
</a>
6669
</li>
6770
{% endunless %}
@@ -70,16 +73,19 @@ layout: default.liquid
7073
{% if nextDemo %}
7174
<li class="next">
7275
<a href="{{ nextDemo.url }}" title="Next">
73-
{% comment %} <img src="<%= @getThumbnail("/images/demos/#{@getPagerNext('demos').attributes.title}.png", "zoomcrop", {w: 70, h:70 }) %>" alt="Next">
74-
> {% endcomment %}
76+
{% capture imgURL %}src/files/images/demos/{{ nextDemo.data.title }}.png{% endcapture %}
77+
{% image imgURL, "Next", 70, 70 %}
7578
</a>
7679
</li>
7780
{% endif %}
7881

7982
{% comment %} gets the first demo, if the "next" one doesn't exist {% endcomment %}
8083
{% unless nextDemo %}
84+
{% assign firstDemo = collections.demo-item | first %}
8185
<li class="next">
82-
<a href="{{ nextDemo.url }}" title="Next">
86+
<a href="{{ firstDemo.url }}" title="Next">
87+
{% capture imgURL %}src/files/images/demos/{{ firstDemo.data.title }}.png{% endcapture %}
88+
{% image imgURL, "Next", 70, 70 %}
8389
{% comment %} <img src="<%= @getThumbnail("/images/demos/#{@getFirst('demos').attributes.title}.png", "zoomcrop", { w:70, h:70 }) %>" alt="Next">
8490
> {% endcomment %}
8591
</a>

0 commit comments

Comments
 (0)