Browse Source

added feeds page and fixed feeds

master
jk 4 years ago
parent
commit
052bdf056c
  1. 16
      config.toml
  2. 5
      content/all.md
  3. 4
      content/feeds.md
  4. 29
      layouts/_default/rss.xml
  5. 54
      layouts/all/single.html
  6. 16
      layouts/feeds/single.html
  7. 4
      themes/nipponalba/static/css/style.css

16
config.toml

@ -1,17 +1,17 @@
baseURL = "https://jk.nipponalba.scot"
languageCode = "en-gb"
title = "JK's homepage"
theme=["hugo-atom-feed","nipponalba"]
theme=["nipponalba"]
summarylength=30
enableEmoji=true
defaultContentLanguage="en"
[outputs]
home = ["html", "rss", "atom"] # default = ["HTML", "RSS"]
section = ["html", "rss", "atom"] # default = ["HTML", "RSS"]
term = ["html", "rss", "atom"] # default = ["HTML", "RSS"]
taxonomy = ["html", "rss", "atom"] # default = ["HTML", "RSS"]
home = ["html", "rss"] # default = ["HTML", "RSS"]
section = ["html", "rss"] # default = ["HTML", "RSS"]
term = ["html", "rss"] # default = ["HTML", "RSS"]
taxonomy = ["html", "rss"] # default = ["HTML", "RSS"]
[markup]
[markup.goldmark]
@ -119,6 +119,12 @@ name = "Bookmarks"
weight = 600
url = "/bookmarks/"
[[languages.en.menu.main]]
name = "Feeds"
weight = 700
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>

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 }}

16
layouts/feeds/single.html

@ -0,0 +1,16 @@
{{ 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">Sovereign Scot articles (currently dormant)</span><span class="feedlinks"><a href="/blog/sovereign-scot/index.xml" class="u-url">RSS</a> | <a href="/blog/sovereign-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 }}

4
themes/nipponalba/static/css/style.css

@ -152,12 +152,12 @@ nav li i{
margin:0;
padding-left:10px;
}
nav > li:nth-child(7) {
nav > li:nth-child(8) {
margin-left: auto;
padding-right:5px;
display:none;
}
nav > li:nth-child(8) {
nav > li:nth-child(9) {
padding-right:0;
margin-left: auto;
}