Merge pull request 'template post and rss feed' (#1) from Nikurasu/simple-blog:main into main

Reviewed-on: https://git.oishi-ra.men/oishi-ramen/simple-blog/pulls/1
This commit is contained in:
Nikurasu 2022-06-23 03:09:47 -04:00
commit 789f2d007d
5 changed files with 42 additions and 3 deletions

View file

@ -5,4 +5,4 @@ Here is the template of my blog, released under the MIT license.
Format Date for Posts like here
https://unicode-org.github.io/icu/userguide/format_parse/datetime/#date-field-symbol-table
The main branch is the template and the nikus-blog branch is the template with my content.
The Blog needs at least one post to compile sucessfully, because of that, there is already a template.md in `source/_posts`

View file

@ -41,7 +41,7 @@
<section>
<p>Linkpage: <a href="https://nikurasu.de">https://nikurasu.de</a></p>
<p>E-Mail: <a href="mailTo({{ $page->email }})">{{ $page->email }}</p>
<p><a href="/feed.rss">RSS-Feed</a></p>
<p><a href="/rss.xml">RSS-Feed</a></p>
<p><a href="#">Proof of Identity</a></p>
</section>
</div>

View file

@ -1 +1,2 @@
*.md
*.md
!template.md

View file

@ -0,0 +1,6 @@
---
extends: _layouts.post
title: Template
date: 2017-03-23
---
A basic post is looking like this

32
source/rss.blade.xml Normal file
View file

@ -0,0 +1,32 @@
{!! '<'.'?'.'xml version="1.0" encoding="UTF-8" ?>' !!}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
<title>{{ $page->siteName }}</title>
<link>{{ $page->baseUrl }}</link>
<description><![CDATA[{{ $page->siteDescription }}]]></description>
<atom:link href="{{ $page->getUrl() }}" rel="self" type="application/rss+xml" />
<language>{{ $page->siteLanguage }}</language>
<lastBuildDate>{{ date(DateTime::RSS, $posts->first()->date) }}</lastBuildDate>
@foreach($posts as $post)
<item>
<title><![CDATA[{!! $post->title !!}]]></title>
<link>{{ $post->getUrl() }}</link>
<guid isPermaLink="true">{{ $post->getUrl() }}</guid>
<description><![CDATA[{!! $post->description !!}]]></description>
<content:encoded><![CDATA[{!! $post->getContent() !!}]]></content:encoded>
<dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">{{ $post->author }}</dc:creator>
<pubDate>{{ date(DateTime::RSS, $post->date) }}</pubDate>
@if($post->cover_image)
<media:content
medium="image"
url="{{ $page->baseUrl . $post->cover_image }}"
type="image/jpeg"
width="150"
height="150" />
@endif
</item>
@endforeach
</channel>
</rss>