Skip to content

Instantly share code, notes, and snippets.

wvuwebgist

Block or report user

Report or block wvuwebgist

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@wvuwebgist
wvuwebgist / cleanslate_files_bg_image_loop.html
Created Jan 3, 2020
An example of how to output an inline background image in a style tag from a label in CleanSlate CMS.
View cleanslate_files_bg_image_loop.html
<!-- NOTE: We need to make the label unique for each page -->
<!-- We're using the page slug to define the name of the label -->
<!-- EG: If we had https://developer.wvu.edu/html, the label would -->
<!-- be: "html-hero-background". This is the name of the label you'd -->
<!-- create in CleanSlate. If the URL was /html/anchor-tag, it'd be: -->
<!-- "anchor-tag-hero-background" -->
<r:set_var name="bgurl">
<r:page:slug />-hero-background
</r:set_var>
@wvuwebgist
wvuwebgist / profile_index--simple.html
Created Jan 1, 2020
A profile index CleanSlate CMS template that only outputs a linked name for each child page.
View profile_index--simple.html
---
layout: default
---
<r:children:each>
<h2> <!-- Outputs each person's name: -->
<a href="<r:page:url />">
<r:page:content name="wvu-profile__name" />
</a>
</h2>
@wvuwebgist
wvuwebgist / profile_index.html
Created Jan 1, 2020
A Profile Index template for CleanSlate CMS.
View profile_index.html
---
layout: default
---
<div class="wvu-container">
<div id="maincontent" class="main">
<h1><r:page:name /></h1>
<ul class="wvu-profile">
@wvuwebgist
wvuwebgist / profile_individual.html
Created Jan 1, 2020
A Profile Individual template for CleanSlate CMS
View profile_individual.html
---
layout: default
---
<div class="wvu-container">
<div id="maincontent" class="main">
<h1 class="wvu-profile__name">
<r:editable_region name="wvu-profile__name" type="simple">
@wvuwebgist
wvuwebgist / dynamic-tags.html
Last active Nov 22, 2019
Assign the tags/labels you want to pull dynamically via Custom Data in CleanSlate CMS.
View dynamic-tags.html
---
layout: default
custom_data_attributes:
- tags_to_pull
---
<!--
Step 1: ☝️ Add the `tags_to_pull` custom data attribute to the
page template you want to output the feed on.
-->
@wvuwebgist
wvuwebgist / cleanslate-custom-page-data-example.yml
Last active Jan 20, 2020
An example of the available types and options for Custom Data in CleanSlate CMS.
View cleanslate-custom-page-data-example.yml
---
layout: default
# These are the custom data attributes that can be applied to the page.
custom_data_attributes:
- fancy_description:
type: text
title: "Fancy Description"
rows: 6
maxlength: 200
wrap: "soft"
@wvuwebgist
wvuwebgist / w3c-valid.html
Created Nov 26, 2018
A barebones, W3C valid HTML page.
View w3c-valid.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>A W3C Valid HTML Document</title>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>
@wvuwebgist
wvuwebgist / nav.html
Created Jul 9, 2018
Output of r:site_menu with the sub_ul_class attribute.
View nav.html
<!-- Output of: -->
<!-- <r:site_menu max_depth="2" ul_class="wvu-nav__items" has_children_class="dropdown" sub_ul_class="sub-menu" /> -->
<!-- https://bitbucket.org/wvudigital/brand-patterns/src/7bb0f85a11bfcce06191d13902d5653f9dc9aa91/views/patterns/_wvu-nav-dropdowns.html#lines-18 -->
<ul class="wvu-nav__items">
<li><a href="#">Home</a></li>
<li class="dropdown">
<a href="#">General Guidelines</a>
<ul class="sub-menu sub-menu--level-1">
<li><a class="cs-external-link " title="" target="_self" href="#">Brand Guidelines</a></li>
@wvuwebgist
wvuwebgist / _random-image-loop--different-sizes.html
Created Jun 15, 2018
CleanSlate: Randomize the hero image and generate variables for different sizes based on a label:
View _random-image-loop--different-sizes.html
<r:comment><!-- Randomize the hero image and generate variables for different sizes based on a label: --></r:comment>
<r:files:each labels="random-image-collection" limit="1" types="image" random="true">
<r:set_var name="image_small"><r:file:image_url size="500x400" /></r:set_var>
<r:set_var name="image_large"><r:file:image_url size="1000x800" /></r:set_var>
</r:files:each>
<style>
.wvu-hero {
background-image: url(<r:var name="image_small" />);
} /* /.wvu-hero */
@wvuwebgist
wvuwebgist / _exclude-labelled-blog-posts.html
Created Mar 19, 2018
CleanSlate: Pull a feed from your blog while excluding certain labels.
View _exclude-labelled-blog-posts.html
<r:blog id="1234"> <!-- Change this to your blog's ID. -->
<r:articles limit="5" tags_op="none" tags="dont-show-stuff-with-this-label" >
<r:if_articles>
<ul>
<r:each>
<li><a href="<r:article:path />"><r:article:name /></a></li>
</r:each>
</ul>
</r:if_articles>
<r:if_no_articles>
You can’t perform that action at this time.