Adding card theme

This commit is contained in:
burden 2018-06-19 15:51:22 -07:00
parent 4e69413b4e
commit 39d3a016d2
14 changed files with 510 additions and 54 deletions

View File

@ -14,7 +14,7 @@ before_script:
- bower install
script:
- bundle exec jekyll build
- bundle exec htmlproofer ./www
- bundle exec htmlproofer --assume_extension ./www
deploy:
provider: pages # https://docs.travis-ci.com/user/deployment/pages/
skip-cleanup: true

View File

@ -1,6 +1,21 @@
[![Build Status](https://travis-ci.org/burden/jekyll-cards-boilerplate.svg?branch=master)](https://travis-ci.org/burden/jekyll-cards-boilerplate)
## Cards
Cards can be added to the `_data` folder.
Configure cards in `_config.yml`
```
cards:
data: cards # yaml file in _data (without .yml)
categories:
name: decades # name of category (ex: industries)
group_by: decade # field in yaml to group by
icon: folder-open
```
## Features
- bulma 0.7.1
- bulma 0.6.2
- jquery 3.2.1
- Google Analytics
- jekyll-assets

View File

@ -13,15 +13,15 @@
# you will see them accessed via {{ site.title }}, {{ site.email }}, and so on.
# You can create any custom variable you would like, and they will be accessible
# in the templates via {{ site.myvariable }}.
title: jekyll-bulma-boilerplate
title: jekyll-cards-boilerplate
email: burden@burden.cc
description: >- # this means to ignore newlines until "baseurl:"
A nifty boilerplate for Jekyll made magnificent with the help of Bulma.
A card theme for Jekyll made awesome using Bulma.
baseurl: "" # the subpath of your site, e.g. /blog
url: "" # the base hostname & protocol for your site, e.g. http://example.com
# Social settings
github: burden/jekyll-bulma-boilerplate
github: burden/jekyll-cards-boilerplate
maintainers:
- burden
@ -35,6 +35,13 @@ source: src
destination: www
markdown: kramdown
cards:
data: cards # yaml file in _data (without .yml)
categories:
name: decades # name of category (ex: industries)
group_by: decade # field in yaml to group by
icon: folder-open
compress_html:
ignore:
envs: ["development"]

View File

@ -17,6 +17,6 @@
],
"dependencies": {
"jquery": "^3.2.1",
"bulma": "^0.7.1"
"bulma": "^0.6.2"
}
}

View File

@ -1 +1 @@
jekyll-bulma-boilerplate.burden.cc
jekyll-cards-boilerplate.burden.cc

View File

@ -4,11 +4,26 @@
html {
body {
@include font-smoothing(on);
}
.burger {
color: $grey-dark;
}
.navbar-item{
font-size: 1em;
.burger {
color: $grey-dark;
}
.navbar-item{
font-size: 1em;
}
.controls {
box-sizing: initial !important;
}
.box {
&.use-theme {
min-height: 350px;
max-height: 350px;
overflow: auto;
.info {
padding: 10px 0px;
border-bottom: 1px solid $grey-lighter;
border-top: 1px solid $grey-lighter;
}
}
}
}
}

361
src/_data/cards.yml Normal file
View File

@ -0,0 +1,361 @@
# Template
#
# Card Name:
# category: # Company category, one of:
# url: # Home page
# description: " # Company description and how Elixir is used"
Reefer Madness:
year: 1938
decade: 1930s
url: https://www.rottentomatoes.com/m/reefer_madness
description: "Reefer Madness (originally released as Tell Your Children and sometimes titled or subtitled as The Burning Question, Dope Addict, Doped Youth, and Love Madness) is a 1936 American exploitation film and propaganda work revolving around the melodramatic events that ensue when high school students are lured by pushers to try marijuana—from a hit and run accident, to manslaughter, suicide, attempted rape, and descent into madness."
No Orchids for Miss Blandish:
year: 1948
decade: 1940s
url: https://www.rottentomatoes.com/m/no_orchids_for_miss_blandish
description: "No Orchids for Miss Blandish, a British gangster film adapted from the 1939 novel by James Hadley Chase, received a very hostile reception from the press. This was mainly due to the film's high (for the time) level of sexual and violent content, but also because its attempt to portray Americans using a largely British cast (including an early role for Sid James) was seen as unconvincing."
The Babe Ruth Story:
year: 1948
decade: 1940s
url: https://www.rottentomatoes.com/m/the_babe_ruth_story
description: "The Babe Ruth Story is a 1948 baseball film biography of Babe Ruth, starring William Bendix."
Glen or Glenda:
year: 1953
decade: 1950s
Robot Monster:
year: 1953
decade: 1950s
The Conqueror:
year: 1956
decade: 1950s
Fire Maidens from Outer Space:
year: 1956
decade: 1950s
Plan 9 from Outer Space:
year: 1959
decade: 1950s
The Beast of Yucca Flats:
year: 1961
decade: 1960s
Eegah:
year: 1962
decade: 1960s
The Creeping Terror:
year: 1964
decade: 1960s
The Horror of Party Beach:
year: 1964
decade: 1960s
The Incredibly Strange Creatures Who Stopped Living and Became Mixed-Up Zombies:
year: 1964
decade: 1960s
Santa Claus Conquers the Martians:
year: 1964
decade: 1960s
Monster a Go-Go!:
year: 1965
decade: 1960s
"Manos: The Hands of Fate":
year: 1966
decade: 1960s
A Place for Lovers:
year: 1968
decade: 1960s
Myra Breckinridge:
year: 1970
decade: 1970s
Zaat:
year: 1971
decade: 1970s
An American Hippie in Israel:
year: 1972
decade: 1970s
Bat Pussy:
year: 1973?
decade: 1970s
At Long Last Love:
year: 1975
decade: 1970s
"Exorcist II: The Heretic":
year: 1977
decade: 1970s
The Swarm:
year: 1978
decade: 1970s
I Spit on Your Grave:
year: 1978
decade: 1970s
Caligula:
year: 1979
decade: 1970s
Heaven's Gate:
year: 1980
decade: 1980s
Inchon:
year: 1981
decade: 1980s
Tarzan, the Ape Man:
year: 1981
decade: 1980s
Mommie Dearest:
year: 1981
decade: 1980s
Dünyayı Kurtaran Adam (The Man Who Saved the World):
year: 1982
decade: 1980s
Cannonball Run II:
year: 1984
decade: 1980s
Howard the Duck:
year: 1986
decade: 1980s
Ishtar:
year: 1987
decade: 1980s
Nukie:
year: 1987
decade: 1980s
"Superman IV: The Quest for Peace":
year: 1987
decade: 1980s
The Garbage Pail Kids Movie:
year: 1987
decade: 1980s
Leonard Part 6:
year: 1987
decade: 1980s
Hobgoblins:
year: 1988
decade: 1980s
Mac and Me:
year: 1988
decade: 1980s
Things:
year: 1989
decade: 1980s
Troll 2:
year: 1990
decade: 1990s
"Highlander 2: The Quickening":
year: 1991
decade: 1990s
Cattive ragazze (Bad Girls):
year: 1992
decade: 1990s
North:
year: 1994
decade: 1990s
Dis en historie om kjærlighet (A Story About Love):
year: 1995
decade: 1990s
Showgirls:
year: 1995
decade: 1990s
Striptease:
year: 1996
decade: 1990s
Le Jour et la Nuit (Day and Night):
year: 1997
decade: 1990s
Batman & Robin:
year: 1997
decade: 1990s
The Avengers:
year: 1998
decade: 1990s
Cinderela Baiana (Bahian Cinderella):
year: 1998
decade: 1990s
Parting Shots:
year: 1999
decade: 1990s
The Underground Comedy Movie:
year: 1999
decade: 1990s
Battlefield Earth:
year: 2000
decade: 2000s
Honest:
year: 2000
decade: 2000s
"Titanic: The Legend Goes On":
year: 2000
decade: 2000s
Freddy Got Fingered:
year: 2001
decade: 2000s
Glitter:
year: 2001
decade: 2000s
The Master of Disguise:
year: 2002
decade: 2000s
"Ballistic: Ecks vs. Sever":
year: 2002
decade: 2000s
Ben and Arthur:
year: 2002
decade: 2000s
From Justin to Kelly:
year: 2003
decade: 2000s
The Room:
year: 2003
decade: 2000s
Gigli:
year: 2003
decade: 2000s
Sex Lives of the Potato Men:
year: 2004
decade: 2000s
Catwoman:
year: 2004
decade: 2000s
Daniel Der Zauberer (Daniel The Wizard):
year: 2004
decade: 2000s
"Superbabies: Baby Geniuses 2":
year: 2004
decade: 2000s
Alone in the Dark:
year: 2005
decade: 2000s
Aag:
year: 2007
decade: 2000s
Disaster Movie:
year: 2008
decade: 2000s
The Hottie and the Nottie:
year: 2008
decade: 2000s
"Birdemic: Shock and Terror":
year: 2010
decade: 2010s
The Last Airbender:
year: 2010
decade: 2010s
"Bucky Larson: Born to Be a Star":
year: 2011
decade: 2010s
Jack and Jill:
year: 2011
decade: 2010s
description: "Jack and Jill is a comedy film starring Adam Sandler as Jack, a commercial director, who is visited by his \"identical\" twin sister, Jill (played by Sandler, in drag), during the holidays."
That's My Boy:
year: 2012
decade: 2010s
description: "That's My Boy concerns a middle school student named Donny Berger who has sex with his teacher, gets her pregnant, and in turn, earns a lifestyle of a minor celebrity, something he never intended to happen. Years later, Donny crashes his now-adult son's wedding and bachelor party to get his money so he can pay his taxes, therefore avoiding prison."
Run for Your Wife:
year: 2012
decade: 2010s
description: "A British comedy film based on the stage farce of the same name"
Movie 43:
year: 2013
decade: 2010s
description: >-
Movie 43 is a comedy film consisting of several vignettes each by a different director and a sizable cast of recognizable actors and actresses
Several critics have called it one of the worst films ever made
Fateful Findings:
year: 2013
decade: 2010s
description: "_Fateful Findings_ follows an author-turned-hacker with supernatural powers who uses his abilities to reveal government and corporate secrets while struggling with his wife's drug addiction and his attraction to his stepdaughter, ending with an extended press conference scene where politicians and businesspeople confess to corruption and kill themselves before an applauding crowd."
Humshakals:
year: 2014
decade: 2010s
description: "A Bollywood comedy film described as \"an atrocious, regressive, misogynistic, sexist, homophobic cinematic product force-fed to paying audiences\""
Saving Christmas:
year: 2014
decade: 2010s
description: "Saving Christmas is a faith-based Christmas comedy film starring Kirk Cameron, who plays a fictionalized version of himself attempting to convince his brother-in-law that Christmas is still a Christian holiday."
United Passions:
year: 2014
decade: 2010s
description: >-
English-language French drama film about the origins of the soccer world governing body Fédération Internationale de Football Association (FIFA).
United Passions was also a box office bomb, becoming the lowest-grossing film of all time in American history (with $918)

View File

@ -13,13 +13,13 @@
<div class="navbar-menu" id="navMain">
<div class="navbar-start">
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link is-active">Categories</a>
<a class="navbar-link is-active">{{ site.cards.categories.name | capitalize }}</a>
<div id="moreDropdown" class="navbar-dropdown">
<a class="navbar-item" href="/"><span class="has-text-weight-bold">Page 1</span></a>
<a class="navbar-item" href="/"><span class="has-text-weight-bold">Page 2</span></a>
{% for category in site.data['categories'] %}
<a class="navbar-item" href="/{{ site.cards.categories.name }}/{{ category['path'] }}"><span class="has-text-weight-bold">{{ category['name'] }}</span></a>
{% endfor %}
</div>
</div>
<a class="navbar-item" href="/">About</a>
</div>
<div class="navbar-end">
<a class="navbar-item is-hidden-mobile" href="https://github.com/{{ site.github }}" target="_blank"><span class="icon has-text-grey-darker"><i class="fab fa-lg fa-github"></i></span></a>

19
src/_includes/card.html Normal file
View File

@ -0,0 +1,19 @@
<div class="use-theme box">
<div class="content has-text-centered">
<p class="title is-4 thin">{{include['data']['name']}}</p>
</div>
<div class="content info has-text-left">
<p class="is-size-7">
<span class="icon accent"><i class="far fa-fw fa-{{ site.cards.categories.icon }}"></i></span> <a href="/{{ site.cards.categories.name }}/{{ include['data'][site.cards.categories.group_by] | downcase }}">{{ include['data'][site.cards.categories.group_by] | truncate: 40 }}</a><br>
{% if include['data']['year'] %}
<span class="icon accent"><i class="far fa-fw fa-calendar"></i></span> {{include['data']['year']}}<br>
{% endif %}
{% if include['data']['url'] %}
<span class="icon accent"><i class="fas fa-fw fa-globe"></i></span> <a target="_blank" href="{{include['data']['url']}}">{{include['data']['url'] | replace: "http://", "" | replace: "https://", "" | replace: "www.", "" | truncate: 40 }}</a><br>
{% endif %}
</p>
</div>
<div class="content is-size-7 has-text-centered">
{{ include['data']['description'] | markdownify }}
</div>
</div>

View File

@ -1,14 +1,11 @@
{% capture cards_count %}{{ site.data[site.cards.data] | size }}{% endcapture %}
<section class="hero is-primary">
<div class="hero-body">
<div class="container has-text-centered">
<div class="content">
<h1 class="title is-4 thin">{{ site.description }}</h1>
<p><a target="_blank" class="button is-white is-rounded is-outlined" href="https://github.com/{{ site.github }}/blob/master/CONTRIBUTING.md">
<span class="icon">
<i class="fab fa-github"></i>
</span>
<span class="has-text-weight-bold is-uppercase">Contribute</span>
</a></p>
<p>With <span class="has-text-weight-bold">{{cards_count}}</span> of the most awesomely bad movies ever, and counting...</p>
</div>
</div>
</div>

21
src/_layouts/cards.html Normal file
View File

@ -0,0 +1,21 @@
---
layout: default
---
{% assign cards = site.data[site.cards.data] | slice: 0, 8 %}
{% include hero-intro.html %}
<section class="section">
<div class="container">
<div class="content">
<h1 class="title is-3 fancy">Recent releases</h1>
{{ content }}
<div class="columns is-desktop is-multiline">
{% for card in cards %}
<div class="column is-one-quarter-desktop">
{% include card.html data=card %}
</div>
{% endfor %}
</div> <!-- /columns -->
</div> <!-- /content -->
</div> <!-- /container -->
</section>

View File

@ -0,0 +1,17 @@
---
layout: default
---
<section class="section">
<div class="container">
<div class="content">
<h1 class="title is-3 fancy">{{ page[site.cards.categories.group_by] }}</h1>
<div class="columns is-desktop is-multiline">
{% for card in page[site.cards.data] %}
<div class="column is-one-quarter-desktop">
{% include card.html data=card %}
</div>
{% endfor %}
</div>
</div>
</div> <!-- /container -->
</section>

34
src/_plugins/generator.rb Normal file
View File

@ -0,0 +1,34 @@
class CardGenerator < Jekyll::Generator
def generate(site)
data_file = site.config["cards"]["data"] # ex: companies
complete_info = site
.data[data_file]
.map { |name, details| details.merge({'name' => name}) }
site.data[data_file] = complete_info.reverse
categories = complete_info
.group_by { |category| [category[site.config["cards"]["categories"]["group_by"]], category[site.config["cards"]["categories"]["group_by"]].downcase.gsub(/[^0-9a-zA-Z]/, "-")] }
.sort_by { |key, _values| key[0] }
.reduce([]) do |acc, group|
acc << { data_file => group.last, 'name' => group.first.first, 'path' => group.first.last }
end
site.data['categories'] = categories
categories.each { |category| site.pages << build_category_page(site, category) }
end
def build_category_page(site, category)
data = site.config["cards"]["data"]
category_name = site.config["cards"]["categories"]["name"]
category_field = site.config["cards"]["categories"]["group_by"]
page = Jekyll::PageWithoutAFile.new(site, site.source, category_name, "#{category['path']}.md")
page.data[category_field] = category['name']
page.data[data] = category[data]
page.data['layout'] = 'category'
page
end
end

View File

@ -1,33 +1,3 @@
---
layout: home
layout: cards
---
## Features
- bulma 0.7.1
- jquery 3.2.1
- Google Analytics
- jekyll-assets
- compress.html
- html-proofer
## Dependencies
1. Install bundler `gem install bundler`
2. Install bower `npm install -g bower`
## Getting Started
```
$ bundle install
$ bower install
$ jekyll serve
```
## Deploy to Github Pages from Travis
1. Point Travis to repository
2. Configure Travis
3. Generate a [Personal Access Token](https://github.com/settings/tokens) from Github
- The only scope needed is repo:public_repo
4. Set `GITHUB_API=<token>` on Travis
- Make sure `Display value in build log` toggle is set to `Off`!