Skip to content
This repository has been archived by the owner on Jan 1, 2022. It is now read-only.

Commit

Permalink
First Video Page, Support for QueerTube
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkkelly committed Apr 25, 2019
1 parent d53f1d1 commit f4699b0
Show file tree
Hide file tree
Showing 8 changed files with 178 additions and 17 deletions.
2 changes: 1 addition & 1 deletion content/contrapoints.md → content/contrapoints/_index.md
Expand Up @@ -11,7 +11,7 @@ videos:
- PbBzhqJK3bg
- S6GodWn4XMM
- 9bbINLWtMKI
- z1afqR5QkDM
- theaesthetic
- fD2briZ6fB0
- hyaftqCORT4
- j1dJ8whOM8E
Expand Down
9 changes: 9 additions & 0 deletions content/contrapoints/theaesthetic.md
@@ -0,0 +1,9 @@
---
title: "The Aesthetic"
type: "videos"
channel: "contrapoints"
video: "theaesthetic"
menu:
main:
parent: "Channels"
---
Expand Up @@ -3,4 +3,9 @@ title: The Aesthetic
channel: contrapoints
description: What matters more—the way things are or the way things look?
series: Contrapoints
source: youtube
providers:
youtube:
id: z1afqR5QkDM
queertube:
id: 10db232f-8c7f-4cd2-b83d-d79f422649f9
slug: theaesthetic
59 changes: 59 additions & 0 deletions layouts/channel/list.html
@@ -0,0 +1,59 @@
{{ define "main" }}
{{ $channelSlug := (or .Params.channel (index (split .Page.RelPermalink "/") 1)) }}
{{ $channels := $.Site.Data.channels }}
{{ $scratch := newScratch }}
{{ range $channels }}
{{ if eq .slug $channelSlug }}
{{ $scratch.Set "channel" . }}
{{ end }}
{{ end }}
{{ $channel := $scratch.Get "channel" }}

<div class="content">
<h1 class="heading"><a href="{{ .Page.RelPermalink }}">{{ .Title }}</a></h1>
<img src="/img/channels/{{ $channel.slug }}.jpg" class="channel-image heading-image" alt=" {{ $channel.name }}" />
<p>{{ $channel.description | markdownify }}</p>
{{ with $channel.description_more }}
<p>{{ . | markdownify }}</p>
{{ end }}

{{ with $channel.providers.website }}
<a href="{{ .url }}" target="_blank" title="{{ .slug }}">{{ .slug }}</a>
{{ end }}
{{ with $channel.providers.patreon }}
<a href="{{ .url }}" target="_blank" title="{{ .name }}">Patreon</a>
{{ end }}
{{ with $channel.providers.actionnetwork }}
<a href="{{ .url }}" target="_blank" title="{{ .name }}">Action Network</a>
{{ end }}
{{ with $channel.providers.steadyhq }}
<a href="{{ .url }}" target="_blank" title="{{ .name }}">Steady</a>
{{ end }}
{{ with $channel.providers.youtube }}
<a href="{{ .url }}" target="_blank" title="{{ .name }}">YouTube</a>
{{ end }}
{{ with $channel.providers.twitter }}
<a href="{{ .url }}" target="_blank" title="@{{ .slug }}">Twitter</a>
{{ end }}
{{ with $channel.providers.mastodon }}
<a href="{{ .url }}" target="_blank" title="@{{ .slug }}">Mastodon</a>
{{ end }}
{{ with $channel.providers.instagram }}
<a href="{{ .url }}" target="_blank" title="@{{ .slug }}">Instagram</a>
{{ end }}
{{ with $channel.providers.twitch }}
<a href="{{ .url }}" target="_blank" title="{{ .slug }}">Twitch</a>
{{ end }}
{{ with $channel.providers.facebook }}
<a href="{{ .url }}" target="_blank" title="{{ .slug }}">Facebook</a>
{{ end }}
{{ with $channel.providers.mewe }}
<a href="{{ .url }}" target="_blank" title="{{ .slug }}">Mewe</a>
{{ end }}
{{ with $channel.providers.paypal }}
<a href="{{ .url }}" target="_blank" title="{{ .name }}">Paypal</a>
{{ end }}
</div>

{{ partial "playlists/videos.html" . }}
{{ end }}
29 changes: 15 additions & 14 deletions layouts/partials/channels/heading.html
@@ -1,37 +1,38 @@
<h1 class="heading"><a href="{{ .Page.RelPermalink }}">{{ .Title }}</a></h1>
<img src="/img/channels/{{ .channel.slug }}.jpg" class="channel-image heading-image" alt=" {{ .channel.name }}" />
<p>{{ .channel.description | markdownify }}</p>
{{ $channel := .scratch.Get "channel" }}
<h1 class="heading"><a href="/{{ $channel.slug }}">{{ $channel.name }}</a></h1>
<img src="/img/channels/{{ $channel.slug }}.jpg" class="channel-image heading-image" alt=" {{ $channel.name }}" />
<p>{{ $channel.description | markdownify }}</p>

{{ with .channel.providers.website }}
{{ with $channel.providers.website }}
<a href="{{ .url }}" target="_blank" title="{{ .slug }}">{{ .slug }}</a>
{{ end }}
{{ with .channel.providers.patreon }}
{{ with $channel.providers.patreon }}
<a href="{{ .url }}" target="_blank" title="{{ .name }}">Patreon</a>
{{ end }}
{{ with .channel.providers.steadyhq }}
{{ with $channel.providers.steadyhq }}
<a href="{{ .url }}" target="_blank" title="{{ .name }}">Steady</a>
{{ end }}
{{ with .channel.providers.youtube }}
{{ with $channel.providers.youtube }}
<a href="{{ .url }}" target="_blank" title="{{ .name }}">YouTube</a>
{{ end }}
{{ with .channel.providers.twitter }}
{{ with $channel.providers.twitter }}
<a href="{{ .url }}" target="_blank" title="@{{ .slug }}">Twitter</a>
{{ end }}
{{ with .channel.providers.mastodon }}
{{ with $channel.providers.mastodon }}
<a href="{{ .url }}" target="_blank" title="@{{ .slug }}">Mastodon</a>
{{ end }}
{{ with .channel.providers.instagram }}
{{ with $channel.providers.instagram }}
<a href="{{ .url }}" target="_blank" title="@{{ .slug }}">Instagram</a>
{{ end }}
{{ with .channel.providers.twitch }}
{{ with $channel.providers.twitch }}
<a href="{{ .url }}" target="_blank" title="{{ .slug }}">Twitch</a>
{{ end }}
{{ with .channel.providers.facebook }}
{{ with $channel.providers.facebook }}
<a href="{{ .url }}" target="_blank" title="{{ .slug }}">Facebook</a>
{{ end }}
{{ with .channel.providers.mewe }}
{{ with $channel.providers.mewe }}
<a href="{{ .url }}" target="_blank" title="{{ .slug }}">Mewe</a>
{{ end }}
{{ with .channel.providers.paypal }}
{{ with $channel.providers.paypal }}
<a href="{{ .url }}" target="_blank" title="{{ .name }}">Paypal</a>
{{ end }}
12 changes: 11 additions & 1 deletion layouts/partials/videos/card.html
@@ -1,3 +1,5 @@
{{ $slug := .video.slug }}

{{ if .videoIframe }}
<li class="channel-video">
<ul>
Expand Down Expand Up @@ -27,7 +29,15 @@
</div>
<div class="video-text">
<div class="video-title">
{{ .video.title }}
{{ if $slug }}
<a class="video-link" href="/{{ .channel.slug }}/{{ .video.slug }}">
{{ .video.title }}
</a>
{{ else }}
<a class="video-link" href="https://youtu.be/{{ .video.id }}" target="_blank">
{{ .video.title }}
</a>
{{ end }}
</div>
<div class="video-description">
{{ .video.description }}
Expand Down
52 changes: 52 additions & 0 deletions layouts/videos/single.html
@@ -0,0 +1,52 @@
{{ define "main" }}
{{ $scratch := newScratch }}

{{ $channelSlug := .Params.channel }}
{{ $channels := $.Site.Data.channels }}
{{ range $channels }}
{{ if eq .slug $channelSlug }}
{{ $scratch.Set "channel" . }}
{{ end }}
{{ end }}

{{ $videoSlug := .Params.video }}
{{ $videos := $.Site.Data.videos }}
{{ range $channel, $videos := $videos }}
{{ range $videos }}
{{ if (eq .channel $channel) }}
{{ if and (eq .slug $videoSlug) }}
{{ $scratch.Set "video" . }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ $video := $scratch.Get "video" }}

<div class="content">
{{ partial "channels/heading.html" (dict "scratch" $scratch) }}
</div>

<h1 class="heading"><a href="/{{ $channelSlug }}/{{ $videoSlug }}">{{ $video.title }}</a></h1>

{{ with $video }}
<ul class="iframe-list">
{{ with .providers.youtube }}
<li>
<h3><a href="https://youtu.be/{{ .id }}">YouTube</a></h3>
<div class="iframe-container">
<iframe title="{{ $video.title }}" src="https://www.youtube.com/embed/{{ .id }}" allowfullscreen></iframe>
</div>
</li>
{{ end }}

{{ with .providers.queertube }}
<li>
<h3><a href="https://queertube.org/videos/watch/{{ .id }}">QueerTube</a></h3>
<div class="iframe-container">
<iframe title="{{ $video.title }}" src="https://queertube.org/videos/embed/{{ .id }}" allowfullscreen></iframe>
</div>
</li>
{{ end }}
</ul>
{{ end }}
{{ end }}
25 changes: 25 additions & 0 deletions static/css/breadtube.css
Expand Up @@ -764,3 +764,28 @@ button, select, input, textarea { font-family: inherit; }
max-width: 35rem;
margin-bottom: 0.5rem;
}

.iframe-list {
overflow: hidden;
}

.iframe-list li {
float: left;
width: 600px;
margin-right: 10px;
}

.iframe-container {
overflow: hidden;
padding-top: 56.25%;
position: relative;
}

.iframe-container iframe {
border: 0;
height: 100%;
left: 0;
position: absolute;
top: 0;
width: 100%;
}

0 comments on commit f4699b0

Please sign in to comment.