Skip to content

Instantly share code, notes, and snippets.

@wvuwebgist
Created January 15, 2021 21:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wvuwebgist/fd94d14a4811e0a0d616d8663d528eb7 to your computer and use it in GitHub Desktop.
Save wvuwebgist/fd94d14a4811e0a0d616d8663d528eb7 to your computer and use it in GitHub Desktop.
A profile index template for CleanSlate CMS written in Liquid.
---
layout: default
---
<div class="wvu-container">
<div id="maincontent" class="main">
<h1>{{ page.name }}</h1>
<ul class="wvu-profile">
{% comment %} First, we must get the ID of the current profile_index page, then assign it to a "pages" variable: {% endcomment %}
{% assign pages = site | get_page: page.id %}
{% comment %} Then we take the "pages" variable, get the children from that variable and assign it to a "profiles" variable which we iterate through: {% endcomment %}
{% assign profiles = pages.children %}
{% for profile in profiles.all %}
<li class="wvu-profile__individual">
<div class="wvu-profile__individual-photo">
<a href="{{ profile.url }}">
{{ profile.content['wvu-profile__photo'] }}
</a>
</div> <!-- /.wvu-profile__individual-photo -->
<div class="wvu-profile__individual-info">
<h2>
<a id="aria__profile--{{ profile.id }}" href="{{ profile.url }}">
{{ profile.content['wvu-profile__name'] }}
</a>
</h2>
<h3>{{ profile.content['wvu-profile__job-title'] }}</h3>
<p><a href="tel:{{ profile.content['wvu-profile__phone'] }}">{{ profile.content['wvu-profile__phone'] }}</a></p>
<p>{{ profile.content['wvu-profile__email'] }}</p>
<p>{{ profile.content['wvu-profile__short-description'] }}</p>
<p><a aria-labelledby="aria__profile--{{ profile.id }}" class="button" href="{{ profile.url }}">Read Full Bio</a></p>
</div> <!-- /.wvu-profile__individual-info -->
</li> <!-- /.wvu-profile__individual -->
{% endfor %}
</ul>
</div> <!-- /.main -->
</div> <!-- /.wvu-container -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment