Skip to content

Commit c6b8cd3

Browse files
committed
fix rss xml validation issues. thanks oliver!
Signed-off-by: Bruno Meilick <[email protected]>
1 parent e8205a1 commit c6b8cd3

File tree

6 files changed

+8
-5
lines changed

6 files changed

+8
-5
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# OS files
22
.DS_Store
33
.php_cs.cache
4+
.idea
45

56
# files of Composer dependencies that are not needed for the plugin
67
/vendor/**/.*
@@ -21,4 +22,4 @@
2122
/vendor/**/test/*
2223
/vendor/**/tests/*
2324
/vendor/**/php4/*
24-
/vendor/getkirby/composer-installer
25+
/vendor/getkirby/composer-installer

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ If you use these defaults you need to provide the fields `date (type: date)` and
3838
```php
3939
[
4040
'url' => site()->url(),
41+
'feedurl' => site()->url() . '/feed/',
4142
'title' => 'Feed',
4243
'description' => '',
4344
'link' => site()->url(),

classes/Feed.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public static function data($pages, $options = [])
6969
{
7070
$defaults = array(
7171
'url' => site()->url(),
72+
'feedurl' => site()->url() . '/feed/',
7273
'title' => 'Feed',
7374
'description' => '',
7475
'link' => site()->url(),

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "bnomei/kirby3-feed",
33
"type": "kirby-plugin",
4-
"version": "1.1.5",
4+
"version": "1.2.0",
55
"description": "Generate a RSS/JSON-Feed from a Pages-Collection",
66
"license": "MIT",
77
"authors": [

composer.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

snippets/feed/rss.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<title><?php echo Xml::encode($title) ?></title>
88
<link><?php echo Xml::encode($link) ?></link>
99
<lastBuildDate><?php echo $modified ?></lastBuildDate>
10-
<atom:link href="<?php echo Xml::encode($url) ?>" rel="self" type="application/rss+xml" />
10+
<atom:link href="<?php echo Xml::encode($feedurl) ?>" rel="self" type="application/rss+xml" />
1111

1212
<?php if (!empty($description)): ?>
1313
<description><?php echo Xml::encode($description) ?></description>
@@ -17,7 +17,7 @@
1717
<item>
1818
<title><?php echo Xml::encode($item->title()) ?></title>
1919
<link><?php echo Xml::encode($item->{$urlfield}()) ?></link>
20-
<guid><?php echo Xml::encode($item->id()) ?></guid>
20+
<guid><?php echo Xml::encode($item->url()) ?></guid>
2121
<pubDate><?php echo $datefield == 'modified' ? $item->modified('r', 'date') : date('r', $item->{$datefield}()->toTimestamp()) ?></pubDate>
2222
<description><![CDATA[<?php echo $item->{$textfield}()->kirbytext() ?>]]></description>
2323
</item>

0 commit comments

Comments
 (0)