mirror of
https://github.com/hazemKrimi/personal-website.git
synced 2026-05-01 18:00:26 +00:00
Custom rss template
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
---
|
||||
title: "Home"
|
||||
title: 'Home'
|
||||
date: 2023-10-18T20:03:43+01:00
|
||||
---
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
---
|
||||
layout: "about"
|
||||
title: "About"
|
||||
layout: 'about'
|
||||
title: 'About'
|
||||
date: 2023-10-18T20:03:43+01:00
|
||||
---
|
||||
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
---
|
||||
layout: "contact"
|
||||
title: "Contact"
|
||||
layout: 'contact'
|
||||
title: 'Contact'
|
||||
date: 2023-10-18T20:03:43+01:00
|
||||
---
|
||||
|
||||
|
||||
@@ -18,4 +18,4 @@ This is a project that I made as a step in the interview process for my final ye
|
||||
|
||||
## Screenshots
|
||||
|
||||
{{< figure src="https://res.cloudinary.com/dun9hhyz1/image/upload/v1643548378/personal-website/portfolio/react-weather-app/screenshot_ueu2a4.png" >}}
|
||||
{{< figure src="react-weather-app-screenshot.png" >}}
|
||||
@@ -1,12 +1,10 @@
|
||||
languageCode = 'en-us'
|
||||
languageCode = 'en'
|
||||
title = 'Hazem Krimi'
|
||||
paginate = 5
|
||||
enableRobotsTXT = true
|
||||
[outputs]
|
||||
home = ['html', 'rss']
|
||||
section = ['html', 'rss']
|
||||
taxonomy = ['html']
|
||||
term = ['html']
|
||||
[sitemap]
|
||||
changeFreq = ''
|
||||
filename = 'sitemap.xml'
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
{{- /* 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 }}
|
||||
|
||||
{{- $projectsPages := where .Site.RegularPages "Section" "projects" }}
|
||||
{{- $blogPages := where .Site.RegularPages "Section" "blog" }}
|
||||
|
||||
{{- $limit := .Site.Config.Services.RSS.Limit }}
|
||||
{{- if ge $limit 1 }}
|
||||
{{- $projectsPages = $projectsPages | first $limit }}
|
||||
{{- $blogPages = $blogPages | 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>Hazem Krimi's content</title>
|
||||
<link>{{ .Permalink }}</link>
|
||||
<description>Hazem Krimi's projects and blog</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>{{ .Date.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 $projectsPages }}
|
||||
<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>{{ .Params.description | html }}</description>
|
||||
</item>
|
||||
{{- end }}
|
||||
{{- range $blogPages }}
|
||||
<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>{{ .Params.description | html }}</description>
|
||||
</item>
|
||||
{{- end }}
|
||||
</channel>
|
||||
</rss>
|
||||
Reference in New Issue
Block a user