Skip to content

Commit

Permalink
Merge pull request #46 from tidyomics/improve-blog-structure
Browse files Browse the repository at this point in the history
Improve blog structure
  • Loading branch information
william-hutchison authored Mar 11, 2024
2 parents 1125b69 + 8bde91e commit 69a2075
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 15 deletions.
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ You can report mistakes or errors, add suggestions, additions, updates or improv

# How can I add a post to the blog?

This blog exists to showcase the tidyomics ecosystem. Possible posts include analysis which make use of the tidyomics ecosystem or the sharing of new features in our packages.

We are using Hugo and BlogDown to build our blog. These tools take care of most of the work for us, so that adding a new blog post is quick to do. If you would like more information about Hugo and BlogDown you can find the documentation here: https://bookdown.org/yihui/blogdown/hugo.html.

In brief, the process to add a post is:
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: tidyomicsBlog
Title: The tidyomics blog
Version: 1.2.1
Version: 1.2.2
Authors@R: c(
person("Stefano", "Mangiola", email="[email protected]",
role = c("aut","cre"),
Expand Down
4 changes: 0 additions & 4 deletions blog/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ menu:
name: Tags
url: /tags/
weight: 30
- identifier: categories
name: Categories
url: /categories/
weight: 40
params:
archivePaginate: 50
autoCollapseToc: no
Expand Down
13 changes: 3 additions & 10 deletions blog/content/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,8 @@ title: About
weight: 50
---

Hugo is a static site engine written in Go.
This is the blog of the tidyomics ecosystem. In it, we hope to share exciting updates on the development and use of our ecosystem.

You can find out more at our [homepage](https://github.com/tidyomics).

It makes use of a variety of open source projects including:

* [Cobra](https://github.com/spf13/cobra)
* [Viper](https://github.com/spf13/viper)
* [J Walter Weatherman](https://github.com/spf13/jWalterWeatherman)
* [Cast](https://github.com/spf13/cast)

Learn more and contribute on [GitHub](https://github.com/gohugoio).

This blog is part of [R-Bloggers](https://www.r-bloggers.com).
71 changes: 71 additions & 0 deletions blog/layouts/rss.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{{- /* Deprecate site.Author.email in favor of site.Params.author.email */}}
{{- $authorEmail := "" }}
{{- with site.Params.author }}
{{- if reflect.IsMap . }}
{{- with .email }}
{{- $authorEmail = . }}
{{- end }}
{{- end }}
{{- else }}
{{- with site.Author.email }}
{{- $authorEmail = . }}
{{- warnf "The author key in site configuration is deprecated. Use params.author.email instead." }}
{{- end }}
{{- end }}

{{- /* Deprecate site.Author.name in favor of site.Params.author.name */}}
{{- $authorName := "" }}
{{- with site.Params.author }}
{{- if reflect.IsMap . }}
{{- with .name }}
{{- $authorName = . }}
{{- end }}
{{- else }}
{{- $authorName = . }}
{{- end }}
{{- else }}
{{- with site.Author.name }}
{{- $authorName = . }}
{{- warnf "The author key in site configuration is deprecated. Use params.author.name instead." }}
{{- end }}
{{- end }}

{{- $pctx := . }}
{{- if .IsHome }}{{ $pctx = .Site }}{{ end }}
{{- $pages := slice }}
{{- if or $.IsHome $.IsSection }}
{{- $pages = $pctx.RegularPages }}
{{- else }}
{{- $pages = $pctx.Pages }}
{{- end }}
{{- $limit := .Site.Config.Services.RSS.Limit }}
{{- if ge $limit 1 }}
{{- $pages = $pages | first $limit }}
{{- end }}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}{{ end }}</title>
<link>{{ .Permalink }}</link>
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ .Site.Title }}</description>
<generator>Hugo -- gohugo.io</generator>
<language>{{ site.Language.LanguageCode }}</language>{{ with $authorEmail }}
<managingEditor>{{.}}{{ with $authorName }} ({{ . }}){{ end }}</managingEditor>{{ end }}{{ with $authorEmail }}
<webMaster>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</webMaster>{{ end }}{{ with .Site.Copyright }}
<copyright>{{ . }}</copyright>{{ end }}{{ if not .Date.IsZero }}
<lastBuildDate>{{ (index $pages.ByLastmod.Reverse 0).Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
{{- with .OutputFormats.Get "RSS" }}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{- end }}
{{- range $pages }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{- with $authorEmail }}<author>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</author>{{ end }}
<guid>{{ .Permalink }}</guid>
<description>{{ .Content | html }}</description>
</item>
{{- end }}
</channel>
</rss>

0 comments on commit 69a2075

Please sign in to comment.