Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions _includes/layouts/wants.njk
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
---
layout: layouts/base.njk
section: wants
permalink: "/wants/{% if pagination.pageNumber > 0 %}page/{{ pagination.pageNumber + 1 }}{% else %}index{% endif %}.html"
pagination:
data: collections.wants
size: 10
alias: wants
---
{% from "macros.njk" import paginate %}

Expand All @@ -27,9 +21,13 @@ pagination:
});
</script>

{% if wants.length > 0 %}
{% set wantsToShow = wants if wants else collections.wantsBySubmissionDate %}
{% if wantsToShow.length > 0 %}
{% set wants = wantsToShow %}
{% include "components/wants.njk" %}
{{ paginate( "Page", pagination ) }}
{% if pagination %}
{{ paginate( "Page", pagination ) }}
{% endif %}
{% else %}
<p>No one has submitted a want yet. <a href="/#submit">Wanna be the first?</a></p>
{% endif %}
12 changes: 0 additions & 12 deletions pages/wants.md

This file was deleted.

41 changes: 41 additions & 0 deletions wants/index.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
layout: layouts/base.njk
title: What We Want
description: Here is a run-down of all of the "wants" submitted as part of this program.
date: 2019-01-02T00:00:00.000Z
permalink: /wants/
navtitle: Wants
tags:
- nav
includeInSitemap: true
section: wants
---
{% from "macros.njk" import want %}

<h1>{{ title | widont }}</h1>

<p>Here is a run-down of the {{ collections.wants.length }} "wants" submitted as part of this program. Check 'em out and if there's something you want, <a href="/#submit">send it in</a>!</p>

<div id="search"><p>Search existing wants:</p></div>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@algolia/algoliasearch-netlify-frontend@1/dist/algoliasearchNetlify.css" />
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@algolia/algoliasearch-netlify-frontend@1/dist/algoliasearchNetlify.js"></script>
<script type="text/javascript">
algoliasearchNetlify({
appId: 'DHNCDDF8RA',
apiKey: 'b8b628b83ba4b077f0d1225dd553f18f',
siteId: '770267f7-c04f-4418-aca2-3a377b1059e0',
branch: 'main',
selector: 'div#search',
});
</script>

{% if collections.wants.length > 0 %}
<ul class="wants">
{% for w in collections.wants %}
{{ want( 'li', '', w.url, 'h2', w.data.title, w.data.submitter ) }}
{% endfor %}
</ul>
{% else %}
<p>No one has submitted a want yet. <a href="/#submit">Wanna be the first?</a></p>
{% endif %}
Loading