Initial work started for podcast-series

This commit is contained in:
Jeremy Gonyea
2017-09-29 20:25:38 -04:00
parent da9bc6331b
commit dc3a5e492f
21 changed files with 334 additions and 8 deletions

View File

@@ -1,12 +1,24 @@
# v2.0.0
## 09/29/2017
1. [](#new)
* New page type for podcast-series. Folder structure follows Channel->Series->Episode.
2. [](#improved)
* Vastly improved Twig templates for all three page types
3. [](#bugfix)
* Removed references to "speaker" (Issue #5)
# v1.0.1
## 08/05/2017
1. [](#new)
* No new features.
2. [](#improved)
* Cleaned up code for media display of individual podcast.
3. [](#bugfix)
* Version number in blueprints updated correctly.
@@ -17,10 +29,10 @@
1. [](#new)
* Audio duration now calculated via get-id3 Grav plugin
* Dependencies added to blueprints.yaml
2. [](#improved)
* Unessential GUID PHP functions removed
3. [](#bugfix)
* Spacing for duration meta data insertion fixed
@@ -28,10 +40,10 @@
## 07/11/2017
1. [](#new)
2. [](#improved)
* GUID now properly defined
3. [](#bugfix)
* Fixed typo in README file
* Spacing issue on rss feed item tag

25
assets/config.rb Normal file
View File

@@ -0,0 +1,25 @@
require 'compass/import-once/activate'
# Require any additional compass plugins here.
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "css"
sass_dir = "sass"
images_dir = "images"
javascripts_dir = "js"
# You can select your preferred output style here (can be overridden via the command line):
# output_style = :expanded or :nested or :compact or :compressed
# To enable relative paths to assets via compass helper functions. Uncomment:
# relative_assets = true
# To disable debugging comments that display the original location of your selectors. Uncomment:
# line_comments = false
# If you prefer the indented syntax, you might want to regenerate this
# project again passing --syntax sass, or you can uncomment this:
# preferred_syntax = :sass
# and then run:
# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass

5
assets/css/ie.css Normal file
View File

@@ -0,0 +1,5 @@
/* Welcome to Compass. Use this file to write IE specific override styles.
* Import this file using the following HTML or equivalent:
* <!--[if IE]>
* <link href="/stylesheets/ie.css" media="screen, projection" rel="stylesheet" type="text/css" />
* <![endif]--> */

67
assets/css/podcast.css Normal file
View File

@@ -0,0 +1,67 @@
/*
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
*/
/*
Created on : Sep 29, 2017, 4:57:01 PM
Author : jgonyea
*/
/* line 11, ../sass/podcast.scss */
.podcast-header {
clear: both;
box-sizing: inherit;
width: 100%;
display: inline-block;
border-bottom: 3px solid #000;
}
/* line 18, ../sass/podcast.scss */
.podcast-channel-image {
width: 25%;
float: left;
display: inline-block;
border: 1px solid #000;
}
/* line 25, ../sass/podcast.scss */
.channel-meta {
width: 74%;
float: left;
display: inline-block;
}
/* line 29, ../sass/podcast.scss */
.channel-meta h1 {
margin: 0;
}
/* line 32, ../sass/podcast.scss */
.channel-meta p.owner {
text-align: center;
margin: -1em 0 0 0;
}
/* line 37, ../sass/podcast.scss */
.channel-meta p.description {
margin-left: auto;
margin-right: auto;
text-align: center;
line-height: 1.2;
}
/* line 49, ../sass/podcast.scss */
#episodes {
width: 75%;
float: left;
}
/* line 53, ../sass/podcast.scss */
#podcast-series {
background: #ccc;
width: 24%;
float: right;
min-height: 16em;
}
/* line 58, ../sass/podcast.scss */
#podcast-series h2 {
font-size: 20px;
text-align: center;
}

3
assets/css/print.css Normal file
View File

@@ -0,0 +1,3 @@
/* Welcome to Compass. Use this file to define print styles.
* Import this file using the following HTML or equivalent:
* <link href="/stylesheets/print.css" media="print" rel="stylesheet" type="text/css" /> */

68
assets/css/screen.css Normal file
View File

@@ -0,0 +1,68 @@
/* Welcome to Compass.
* In this file you should write your main styles. (or centralize your imports)
* Import this file using the following HTML or equivalent:
* <link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css" /> */
/* line 5, ../../../../../../../../../xampp/ruby/lib/ruby/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font: inherit;
font-size: 100%;
vertical-align: baseline;
}
/* line 22, ../../../../../../../../../xampp/ruby/lib/ruby/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
html {
line-height: 1;
}
/* line 24, ../../../../../../../../../xampp/ruby/lib/ruby/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
ol, ul {
list-style: none;
}
/* line 26, ../../../../../../../../../xampp/ruby/lib/ruby/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
table {
border-collapse: collapse;
border-spacing: 0;
}
/* line 28, ../../../../../../../../../xampp/ruby/lib/ruby/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
caption, th, td {
text-align: left;
font-weight: normal;
vertical-align: middle;
}
/* line 30, ../../../../../../../../../xampp/ruby/lib/ruby/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
q, blockquote {
quotes: none;
}
/* line 103, ../../../../../../../../../xampp/ruby/lib/ruby/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
q:before, q:after, blockquote:before, blockquote:after {
content: "";
content: none;
}
/* line 32, ../../../../../../../../../xampp/ruby/lib/ruby/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
a img {
border: none;
}
/* line 116, ../../../../../../../../../xampp/ruby/lib/ruby/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section, summary {
display: block;
}

6
assets/sass/ie.scss Normal file
View File

@@ -0,0 +1,6 @@
/* Welcome to Compass. Use this file to write IE specific override styles.
* Import this file using the following HTML or equivalent:
* <!--[if IE]>
* <link href="/stylesheets/ie.css" media="screen, projection" rel="stylesheet" type="text/css" />
* <![endif]--> */

62
assets/sass/podcast.scss Normal file
View File

@@ -0,0 +1,62 @@
/*
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
*/
/*
Created on : Sep 29, 2017, 4:57:01 PM
Author : jgonyea
*/
.podcast-header {
clear: both;
box-sizing: inherit;
width: 100%;
display: inline-block;
border-bottom: 3px solid #000;
}
.podcast-channel-image {
width: 25%;
float: left;
display: inline-block;
border: 1px solid #000;
}
.channel-meta {
width: 74%;
float: left;
display: inline-block;
h1 {
margin: 0;
}
p.owner {
text-align: center;
margin: -1em 0 0 0;
}
p.description {
margin-left: auto;
margin-right: auto;
text-align: center;
line-height: 1.2;
}
}
.channel-content {
}
#episodes{
width: 75%;
float: left;
}
#podcast-series{
background: #ccc;
width: 24%;
float: right;
min-height: 16em;
h2 {
font-size: 20px;
text-align: center;
}
}

3
assets/sass/print.scss Normal file
View File

@@ -0,0 +1,3 @@
/* Welcome to Compass. Use this file to define print styles.
* Import this file using the following HTML or equivalent:
* <link href="/stylesheets/print.css" media="print" rel="stylesheet" type="text/css" /> */

6
assets/sass/screen.scss Normal file
View File

@@ -0,0 +1,6 @@
/* Welcome to Compass.
* In this file you should write your main styles. (or centralize your imports)
* Import this file using the following HTML or equivalent:
* <link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css" /> */
@import "compass/reset";

View File

@@ -0,0 +1,5 @@
title: Podcast Series
'@extends':
type: default
context: blueprints://podcast-series

View File

@@ -46,7 +46,8 @@ class PodcastPlugin extends Plugin
// Enable the main event we are interested in
$this->enable([
'onTwigTemplatePaths' => ['onTwigTemplatePaths', 0],
'onTwigTemplatePaths' => ['onTwigTemplatePaths', 1],
'onTwigSiteVariables' => ['onTwigSiteVariables', 0],
'onPageInitialized' => ['onPageInitialized', 0],
]);
}
@@ -70,6 +71,12 @@ class PodcastPlugin extends Plugin
$this->grav['twig']->twig_paths[] = __DIR__ . '/templates';
}
public function onTwigSiteVariables()
{
$this->grav['assets']
->addCss('plugin://podcast/assets/css/podcast.css');
}
/**
* Set metadata in header for podcast if audio file is attached.
*/

View File

@@ -0,0 +1,8 @@
<div id = "podcast-series">
<h2>Podcast Series</h2>
<ul>
{% for s in series %}
<li>{{ s }}</li>
{% endfor %}
</ul>
</div>

View File

@@ -1,5 +1,45 @@
{% extends 'partials/base.html.twig' %}
{% block content %}
{{ page.content }}
<div>
<div class = "podcast-header">
<div class = "podcast-channel-image">
{% set channel_image = ((header.podcast.itunes.image)|first) %}
{{ page.media[channel_image.name].resize(400, 400).html() }}
</div>
<div class = "channel-meta">
<h1>{{ header.title }}</h1>
<p class = "owner">by {{ header.podcast.itunes.owner.name}}</p>
<p class = "description">{{page.header.podcast.description}}</p>
</div>
{{ dump(page) }}
</div>
{% if (page.content) %}
<div class = "channel-content">
<p>
{{page.content}}
</p>
</div>
{% endif %}
<div id = "episodes">
{% set series = [] %}
<ul>
{% for p in page.collection %}
{% if p.name == 'podcast-episode.md' %}
<li>{{ p.title }}</li>
{% elseif p.name == 'podcast-series.md' %}
{% set series = series|merge({(p.title) : (p.title) }) %}
{% endif %}
{% endfor %}
</ul>
</div>
</div>
{% include 'partials/podcast_series_list.html.twig' %}
{% endblock %}

View File

@@ -0,0 +1,9 @@
{% extends 'partials/base.html.twig' %}
{% block content %}
<h1>{{ header.title }}</h1>
{{ page.content }}
{% endblock %}