Skip to content

Commit

Permalink
Improve the links at the top of source pages
Browse files Browse the repository at this point in the history
Adds the RSS icon to the feed links, reusing it from the footer.
Also improves the sectile fragments for these pages, by encouraging
reuse rather than specialisation.
  • Loading branch information
norm committed Jun 2, 2021
1 parent 1557c68 commit 1e45867
Show file tree
Hide file tree
Showing 27 changed files with 79 additions and 77 deletions.
17 changes: 17 additions & 0 deletions fragments/default/source_index_links.html
@@ -0,0 +1,17 @@
<ul class='links'>
[[ sectile insert source_index_links_type.html ]]
{% if homepage %}
<li><a href='{{homepage}}/'>Homepage</a></li>
{% endif %}
{% if imdb %}
<li><a href='https://www.imdb.com/title/{{imdb}}/'>IMDb</a></li>
{% endif %}
{% if wikipedia %}
<li><a href='https://en.wikipedia.org/wiki/{{wikipedia}}'>Wikipedia</a></li>
{% endif %}
<li class='atomfeed'><a href='index.atom'>Feed<svg
class='atomfeed' xmlns='http://www.w3.org/2000/svg' aria-label='RSS'
role='img' viewBox='0 0 16 16' width='16' height='16'
><use xlink:href='#atomfeed-icon'
/></svg></a></li>
</ul>
10 changes: 1 addition & 9 deletions fragments/source/act/body_content.html
@@ -1,13 +1,5 @@
<h1>{{title}}</h1>
<ul class='links'>
{% if imdb %}
<li><a href='https://www.imdb.com/title/{{imdb}}/'>IMDb</a></li>
{% endif %}
{% if wikipedia %}
<li><a href='https://en.wikipedia.org/wiki/{{wikipedia}}'>Wikipedia</a></li>
{% endif %}
<li><a href='index.atom'>Feed</a></li>
</ul>
[[ sectile insert source_index_links.html ]]

<div class='synopsis'>
{{body}}
Expand Down
1 change: 1 addition & 0 deletions fragments/source/act/source_index_links_type.html
@@ -0,0 +1 @@
<li>An act or performer</li>
9 changes: 4 additions & 5 deletions fragments/source/agency/body_content.html
@@ -1,10 +1,9 @@
<h1>NASA</h1>
<p class='subhead'>
Space missions.
<a href='index.atom'>Feed</a>.
</p>
<h1>{{title}}</h1>
[[ sectile insert source_index_links.html ]]

<div class='synopsis'>
{{body}}
</div>

<ul>
{% for mission in page.agency_set.filter(type='mission') %}
Expand Down
1 change: 1 addition & 0 deletions fragments/source/agency/source_index_links_type.html
@@ -0,0 +1 @@
<li>A government agency</li>
1 change: 1 addition & 0 deletions fragments/source/event/body_content.html
@@ -1,4 +1,5 @@
<h1>{{title}}</h1>
[[ sectile insert source_index_links.html ]]

<div class='synopsis'>
{{body}}
Expand Down
1 change: 1 addition & 0 deletions fragments/source/event/source_index_links_type.html
@@ -0,0 +1 @@
<li>An event</li>
13 changes: 1 addition & 12 deletions fragments/source/game/body_content.html
@@ -1,16 +1,5 @@
<h1>{{title}} ({{year}})</h1>
<ul class='links'>
{% if homepage %}
<li><a href='{{homepage}}'>Homepage</a></li>
{% endif %}
{% if imdb %}
<li><a href='https://www.imdb.com/title/{{imdb}}/'>IMDb</a></li>
{% endif %}
{% if wikipedia %}
<li><a href='https://en.wikipedia.org/wiki/{{wikipedia}}'>Wikipedia</a></li>
{% endif %}
<li><a href='index.atom'>Feed</a></li>
</ul>
[[ sectile insert source_index_links.html ]]

<div class='synopsis'>
{{body}}
Expand Down
1 change: 1 addition & 0 deletions fragments/source/game/source_index_links_type.html
@@ -0,0 +1 @@
<li>A video game</li>
12 changes: 3 additions & 9 deletions fragments/source/internet/body_content.html
@@ -1,15 +1,9 @@
<h1>{{title}}</h1>
[[ sectile insert source_index_links.html ]]

<ul class='links'>
<li>An Internet source</li>
<li><a href='{{url}}/'>{{title}}</a></li>
{% if wikipedia %}
<li><a href='https://en.wikipedia.org/wiki/{{wikipedia}}'>Wikipedia</a></li>
{% endif %}
<li><a href='index.atom'>Feed</a></li>
</ul>

<div class='synopsis'>
{{body}}
</div>

<ul class='thumbs'>
{% for gif in page.source_set.all().order_by('published') %}
Expand Down
1 change: 1 addition & 0 deletions fragments/source/internet/source_index_links_type.html
@@ -0,0 +1 @@
<li>An internet source</li>
1 change: 1 addition & 0 deletions fragments/source/mission/source_index_links_type.html
@@ -0,0 +1 @@
<li>A space mission</li>
10 changes: 1 addition & 9 deletions fragments/source/movie/body_content.html
@@ -1,13 +1,5 @@
<h1>{{title}} ({{year}})</h1>
<ul class='links'>
{% if imdb %}
<li><a href='https://www.imdb.com/title/{{imdb}}/'>IMDb</a></li>
{% endif %}
{% if wikipedia %}
<li><a href='https://en.wikipedia.org/wiki/{{wikipedia}}'>Wikipedia</a></li>
{% endif %}
<li><a href='index.atom'>Feed</a></li>
</ul>
[[ sectile insert source_index_links.html ]]

<div class='synopsis'>
{{body}}
Expand Down
1 change: 1 addition & 0 deletions fragments/source/movie/source_index_links_type.html
@@ -0,0 +1 @@
<li>A movie</li>
3 changes: 2 additions & 1 deletion fragments/source/music-video/body_content.html
@@ -1,7 +1,8 @@
<h1>{{title}}</h1>
[[ sectile insert source_index_links.html ]]

<div class='synopsis'>
A music video by <a href='{{page.artist.path}}'>{{page.artist.title}}</a>.
{{body}}
</div>

<ul class='thumbs'>
Expand Down
2 changes: 2 additions & 0 deletions fragments/source/music-video/source_index_links_type.html
@@ -0,0 +1,2 @@
<li>A music video by
<a href='{{page.artist.path}}'>{{page.artist.title}}</a></li>
10 changes: 1 addition & 9 deletions fragments/source/recording-artist/body_content.html
@@ -1,13 +1,5 @@
<h1>{{title}}</h1>
<ul class='links'>
{% if imdb %}
<li><a href='https://www.imdb.com/title/{{imdb}}/'>IMDb</a></li>
{% endif %}
{% if wikipedia %}
<li><a href='https://en.wikipedia.org/wiki/{{wikipedia}}'>Wikipedia</a></li>
{% endif %}
<li><a href='index.atom'>Feed</a></li>
</ul>
[[ sectile insert source_index_links.html ]]

{{body}}

Expand Down
@@ -0,0 +1 @@
<li>A recording artist</li>
1 change: 1 addition & 0 deletions fragments/source/tv-episode/source_index_links_type.html
@@ -0,0 +1 @@
<li>An episode of a TV series</li>
13 changes: 3 additions & 10 deletions fragments/source/tv-show/body_content.html
@@ -1,16 +1,9 @@
<h1>{{title}}</h1>
<ul class='links'>
<li>A TV series</li>
{% if imdb %}
<li><a href='https://www.imdb.com/title/{{imdb}}/'>IMDb</a></li>
{% endif %}
{% if wikipedia %}
<li><a href='https://en.wikipedia.org/wiki/{{wikipedia}}'>Wikipedia</a></li>
{% endif %}
<li><a href='index.atom'>Feed</a></li>
</ul>
[[ sectile insert source_index_links.html ]]

<div class='synopsis'>
{{body}}
</div>

<ul>
{% for episode in page.show_set.filter(type='tv-episode').order_by('-season') %}
Expand Down
1 change: 1 addition & 0 deletions fragments/source/tv-show/source_index_links_type.html
@@ -0,0 +1 @@
<li>A TV series</li>
9 changes: 1 addition & 8 deletions fragments/source/youtube/body_content.html
@@ -1,12 +1,5 @@
<h1>{{title}}</h1>
<p class='subhead'>
{% if video %}
A <a href='https://www.youtube.com/watch?v={{video}}'>YouTube video</a>.
{% elif playlist %}
A <a href='https://www.youtube.com/playlist?list={{playlist}}'>YouTube playlist</a>.
{% endif %}
<a href='index.atom'>Feed</a>
</p>
[[ sectile insert source_index_links.html ]]

<div class='synopsis'>
{{body}}
Expand Down
8 changes: 8 additions & 0 deletions fragments/source/youtube/source_index_links_type.html
@@ -0,0 +1,8 @@
{% if video %}
<li>A
<a href='https://www.youtube.com/watch?v={{video}}'>YouTube video</a></li>
{% elif playlist %}
<li>A
<a href='https://www.youtube.com/playlist?list={{playlist}}'>YouTube
playlist</a></li>
{% endif %}
21 changes: 16 additions & 5 deletions sass/site.scss
Expand Up @@ -116,7 +116,7 @@ h1 + div.static > p:first-child {
}

p.subhead {
margin-top: -0.5em;
margin-top: 0;
}

figure {
Expand Down Expand Up @@ -353,18 +353,29 @@ ul.links {
color: #fff;
}

&:before {
&:after {
content: '';
padding-right: 4px;
padding-left: 4px;
}

&:first-child {
&:before {
&:last-child {
&:after {
content: '';
padding: 0;
}
}
}

li.atomfeed {
position: relative;
padding-right: 20px;

svg {
position: absolute;
right: 0;
top: 3px;
}
}
}

ul.tags {
Expand Down
2 changes: 2 additions & 0 deletions source/eddie-izzard/index.markdown
Expand Up @@ -2,4 +2,6 @@
title = 'Eddie Izzard'
source = true
type = 'act'
wikipedia = 'Eddie_Izzard'
imdb = 'nm0412850'
```
2 changes: 2 additions & 0 deletions source/flo-and-joan/index.markdown
Expand Up @@ -2,4 +2,6 @@
title = 'Flo and Joan'
source = true
type = 'act'
wikipedia = 'Flo_and_Joan'
imdb = 'nm11256034'
```
4 changes: 4 additions & 0 deletions source/nasa/index.markdown
Expand Up @@ -2,4 +2,8 @@
title = 'NASA'
type = 'agency'
source = true
wikipedia = 'Nasa'
homepage = 'https://nasa.gov'
```

Missions … in … SPAAAAAACE!

0 comments on commit 1e45867

Please sign in to comment.