Browse Source

added feeds page and fixed feeds

master
jk 4 years ago
parent
commit
add22a4935
  1. 7
      config.toml
  2. 5
      content/all.md
  3. 4
      content/feeds.md
  4. 29
      layouts/_default/rss.xml
  5. 4
      layouts/_default/section.html
  6. 54
      layouts/all/single.html
  7. 15
      layouts/feeds/single.html
  8. 5
      themes/nipponalba/layouts/_default/single.html
  9. 20
      themes/nipponalba/static/css/style.css

7
config.toml

@ -44,7 +44,6 @@ bookmark-of = "bookmark-of"
posttype = "posttype"
slug = "slug"
[params]
title = "Jon's Place"
author = "Jon Kelbie󠁧󠁢󠁳󠁣󠁴󠁿"
@ -118,6 +117,12 @@ weight = 700
url = "/resume/"
identifier = "resume"
[[languages.en.menu.main]]
name = "Feeds"
weight = 800
url = "/feeds/"
identifier = "feeds"
[languages.jp]
weight = 10
languageName = "日本語"

5
content/all.md

@ -0,0 +1,5 @@
---
title: "All feeds"
type: all
section: all
---

4
content/feeds.md

@ -0,0 +1,4 @@
---
title: "Feeds"
type: feeds
---

29
layouts/_default/rss.xml

@ -12,7 +12,8 @@
{{ with .OutputFormats.Get "RSS" }}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{ end }}
{{ range .Pages }}
{{ if eq (trim .Permalink "index.xml") (string .Site.BaseURL)}}
{{ range where .Site.Pages "Kind" "page" }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
@ -25,7 +26,7 @@
<description>
{{ .Content | plainify }}
({{ .Permalink }})
{{ range .Params.Photo }}
{{ range .Params.Photo }}
{{ if not ( in . "http" ) }}
<media:content xmlns:media="http://search.yahoo.com/mrss" url="https://jk.nipponalba.scot{{.}}" medium="image" type="image/jpeg"/>
{{ else }}
@ -35,5 +36,29 @@
</description>
</item>
{{ end }}
{{else}}
{{ range .Pages}}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
{{ if eq .Params.posttype "in-reply-to" }}<link>{{ index .Params "in-reply-to" }}</link>{{ end }}
{{ if eq .Params.posttype "like-of" }}<link>{{ index .Params "like-of" }}</link>{{ end }}
{{ if eq .Params.posttype "repost-of" }}<link>{{ index .Params "repost-of" }}</link>{{ end }}
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid>
<description>
{{ .Content | plainify }}
({{ .Permalink }})
{{ range .Params.Photo }}
{{ if not ( in . "http" ) }}
<media:content xmlns:media="http://search.yahoo.com/mrss" url="https://jk.nipponalba.scot{{.}}" medium="image" type="image/jpeg"/>
{{ else }}
<media:content xmlns:media="http://search.yahoo.com/mrss" url="{{.}}" medium="image" type="image/jpeg"/>
{{ end }}
{{ end }}
</description>
</item>
{{ end }}{{ end }}
</channel>
</rss>

4
layouts/_default/section.html

@ -3,12 +3,12 @@
<section class="author" style="display:none;">
<a rel="author" class="p-author h-card" rel="me" href="https://jon.kelbie.scot">{{ .Site.Params.Author }}<img src="/images/profile1.jpg"/></a>
</section>
<span id="pagination-top">{{ partial "pagination.html" . }}</span>
<span id="pagination-top">{{ partial "pagination.html" . }}</span>
{{ range .Paginator.Pages}}
{{ if not (eq .Type "response")}}<section data-post-type="{{ .Type }}" class="feed h-entry {{.Type }}">
{{ with .Page.Params.Image }}<center>{{ partial "image.html" . }}</center>{{ end }}
<article class="index_content">
{{if eq .Type "article" }}<a href="{{ .Permalink }}" class="u-url"><h3 class="p-name entry-title">{{ .Title }}</h3></a><b>{{ .Description }}</b>{{ end }}
{{if eq .Type "article"}}<a href="{{ .Permalink }}" class="u-url"><h3 class="p-name entry-title">{{ .Title }}</h3></a><b>{{ .Description }}</b>{{ end }}
{{ if eq .Type "article" }}<section class="info">
<span class="blogs_span">{{ with .Page.Params.Blog }}Blog: {{ partial "taxonomy/blog.html" . }}{{ end }}</span><span class="info-date"><time class="dt-published" datetime="{{ .Date.Format "2 Jan 2006 15:04 GMT" }}">{{ .Date.Format "02/01/2006 15:04 GMT" }}</time></span><br/>
<span class="categories_span">{{ with .Page.Params.category }}Categories: {{ partial "taxonomy/categories.html" . }}{{ end }}</span><span class="reading-time">{{ .ReadingTime }}-minute read</span><br/>

54
layouts/all/single.html

@ -0,0 +1,54 @@
{{ define "main" }}
<section class="stream h-feed">
<section class="author" style="display:none;">
<a rel="author" class="p-author h-card" rel="me" href="https://jon.kelbie.scot">{{ .Site.Params.Author }}<img src="/images/profile1.jpg"/></a>
</section>
{{ range where .Site.Pages "Kind" "page"}}
{{ if not (eq .Type "response")}}<section data-post-type="{{ .Type }}" class="feed h-entry {{.Type }}">
{{ with .Page.Params.Image }}<center>{{ partial "image.html" . }}</center>{{ end }}
<article class="index_content">
{{if eq .Type "article"}}<a href="{{ .Permalink }}" class="u-url"><h3 class="p-name entry-title">{{ .Title }}</h3></a><b>{{ .Description }}</b>{{ end }}
{{ if eq .Type "article" }}<section class="info">
<span class="blogs_span">{{ with .Page.Params.Blog }}Blog: {{ partial "taxonomy/blog.html" . }}{{ end }}</span><span class="info-date"><time class="dt-published" datetime="{{ .Date.Format "2 Jan 2006 15:04 GMT" }}">{{ .Date.Format "02/01/2006 15:04 GMT" }}</time></span><br/>
<span class="categories_span">{{ with .Page.Params.category }}Categories: {{ partial "taxonomy/categories.html" . }}{{ end }}</span><span class="reading-time">{{ .ReadingTime }}-minute read</span><br/>
<span class="tags_span">{{ with .Page.Params.tag }}Tags: {{ partial "taxonomy/tags.html" . }}{{ end }}</span>
</section>{{ end }}
<section class="e-content">
{{ .Content }}
{{ if eq .Type "photo"}}
<section class="photogrid">
{{$link := .Permalink}}
{{$summary := .Content}}
{{ range .Page.Params.Photo }}
{{ if isset . "value" }}
<a href="{{ $link }}" class="u-url"><img class="u-photo thumb" src="{{ replace .value "800." "300."}}" title="{{ $summary }}" alt="{{ .alt }}"/></a>
{{ else }}
<a href="{{ $link }}" class="u-url"><img class="u-photo thumb" src="{{ replace . "800." "300."}}" title="{{ $summary }}" alt="Alt not yet added, will fix!"/></a>
{{end}}{{end}}
</section>
{{end}}
</section><br/>
{{ if not (eq .Type "article") }}<section class="info">
<span class="categories_span">{{ with .Page.Params.category }}Categories: {{ partial "taxonomy/categories.html" . }}{{ end }}</span><span class="info-date"><a href="{{ .Permalink }}" class="u-url"><time class="dt-published" datetime="{{ .Date.Format "2 Jan 2006 15:04 GMT" }}">{{ .Date.Format "02/01/2006 15:04 GMT" }}</time></a></span><br/>
</section>{{ end }}
</article>
</section>
{{ else }}
<section data-post-type="{{ .Params.posttype }}" data-post-id="{{ .Params.slug }}" class="h-entry" id="response">
<article class="h-cite"><p class="response-top">{{ .Site.Params.Firstname }}
{{ if eq .Params.posttype "in-reply-to" }} replied to <a href="{{ index .Params "in-reply-to" }}" class="u-in-reply-to">{{ index .Params "in-reply-to" }}</a>{{ end }}
{{ if eq .Params.posttype "like-of" }} liked <a href="{{ index .Params "like-of" }}" class="u-like-of">{{ index .Params "like-of" }}</a>{{ end }}
{{ if eq .Params.posttype "repost-of" }} shared <a href="{{ index .Params "repost-of" }}" class="u-repost-of">{{ index .Params "repost-of" }}</a>{{ end }}</p>
{{ if .Content }}<section class="p-name p-content">{{ .Content }}</section>{{end}}
{{ if not (eq .Type "article") }}<section class="info">
<span class="categories_span">{{ with .Page.Params.category }}Categories: {{ partial "taxonomy/categories.html" . }}{{ end }}</span><span class="info-date"><a href="{{ .Permalink }}" class="u-url"><time class="dt-published" datetime="{{ .Date.Format "2 Jan 2006 15:04 GMT" }}">{{ .Date.Format "02/01/2006 15:04 GMT" }}</time></a></span><br/>
</section>{{ end }}
</article>
</section>
{{end}}
{{ end }}
</section>
{{ end }}

15
layouts/feeds/single.html

@ -0,0 +1,15 @@
{{ define "main" }}
<article class="feeds">
<header><h3 class="title">All feeds</h3>
<p class="p-summary">This is a list of all of the feeds on this site for both microformats 2 (MF2) and RSS for following using your reader of choice.</p></header>
<p class="feedrow"><span class="description">All feeds - everything!</span><span class="feedlinks"><a href="/index.xml" class="u-url">RSS</a> | <a href="/all/" class="u-url">MF2</a></span></p>
<p class="feedrow"><span class="description">All articles - long form blog posts</span><span class="feedlinks"><a href="/article/index.xml" class="u-url">RSS</a> | <a href="/article/" class="u-url">MF2</a></span></p>
<p class="feedrow"><span class="description">Brewshido articles</span><span class="feedlinks"><a href="/blog/brewshido/index.xml" class="u-url">RSS</a> | <a href="/blog/brewshido/" class="u-url">MF2</a></span></p>
<p class="feedrow"><span class="description">Bushido Dreams articles</span><span class="feedlinks"><a href="/blog/bushido-dreams/index.xml" class="u-url">RSS</a> | <a href="/blog/bushido-dreams/" class="u-url">MF2</a></span></p>
<p class="feedrow"><span class="description">Whitabootery articles</span><span class="feedlinks"><a href="/blog/whitabootery/index.xml" class="u-url">RSS</a> | <a href="/blog/whitabootery/" class="u-url">MF2</a></span></p>
<p class="feedrow"><span class="description">Kilted Scot articles (currently dormant)</span><span class="feedlinks"><a href="/blog/kilted-scot/index.xml" class="u-url">RSS</a> | <a href="/blog/kilted-scot/" class="u-url">MF2</a></span></p>
<p class="feedrow"><span class="description">Notes - short form notes</span><span class="feedlinks"><a href="/note/index.xml" class="u-url">RSS</a> | <a href="/note/" class="u-url">MF2</a></span></p>
<p class="feedrow"><span class="description">Photos</span><span class="feedlinks"><a href="/photo/index.xml" class="u-url">RSS</a> | <a href="/photo/" class="u-url">MF2</a></span></p>
<p class="feedrow"><span class="description">Responses - likes, replies, shares, mentions.</span><span class="feedlinks"><a href="/response/index.xml" class="u-url">RSS</a> | <a href="/response/" class="u-url">MF2</a></span></p>
</article>
{{ end }}

5
themes/nipponalba/layouts/_default/single.html

@ -77,7 +77,7 @@
{{ end }}
{{ end }}
{{ end }}</section>
{{ else }}
{{ else}}
<article class="h-entry" id="response">
<section class="author" style="display:none;">
<a rel="author" class="p-author h-card" rel="me" href="https://jon.kelbie.scot">{{ .Site.Params.Author }}<img src="/images/profile1.jpg"/></a>
@ -92,6 +92,5 @@
</section>
</section>
</article>{{ end }}
{{end}}
{{ end }}
{{end}}

20
themes/nipponalba/static/css/style.css

@ -153,12 +153,12 @@ nav li i{
margin:0;
padding-left:10px;
}
nav > li:nth-child(8) {
nav > li:nth-child(9) {
margin-left: auto;
padding-right:5px;
display:none;
}
nav > li:nth-child(9) {
nav > li:nth-child(10) {
padding-right:0;
margin-left: auto;
}
@ -256,7 +256,7 @@ main{
color: var(--text-colour);
}
.index-note, .feed, .post, #response .h-cite,
.resume header, .workhistory, .education, .skills {
.resume header, .workhistory, .education, .skills, .feeds {
width: 98%;
box-shadow: 0 2px 3px var(--shadow-colour);
border: 1px solid var(--border-colour);
@ -732,6 +732,20 @@ hr{
.anchor:target {
display:block;
}
.feeds {
width: 95%;
margin-top: 20px;
}
.feedrow {
display:grid;
grid-template-columns: 80% auto;
}
.feedrow .description{
grid-column: 1;
}
.feedrow .feedlinks{
grid-column: 2;
}
@media screen and (max-width: 960px) {
#page-top {

Loading…
Cancel
Save