Add RSS and Atom link

Closes #317
This commit is contained in:
Frank Hochmuth 2024-02-04 23:27:17 +01:00 committed by GitHub
commit 5e218557b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
45 changed files with 222 additions and 15 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
fp-content/images/atom.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
fp-content/images/rss.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -26,8 +26,9 @@ $fp_plugins = array(
'favicon',
'commentcenter',
'mediamanager',
// 'datechanger' // Lets you change the publish date for (new) entries.
'datechanger', // Lets you change the publish date for (new) entries.
'gallerycaptions',
'photoswipe'
'photoswipe',
'feed' // Shows the RSS and Atom feed in the header and activates the widget
);
?>

View File

@ -20,7 +20,10 @@ $lang ['main'] = array(
'nocomments' => 'Přidej komentář',
'comment' => '1 komentář',
'comments' => 'komentáře'
'comments' => 'komentáře',
'rss' => 'Přihlásit se k odběru RSS feed',
'atom' => 'Přihlásit se k odběru Atom feed'
);
$lang ['search'] = array(

View File

@ -20,7 +20,10 @@ $lang ['main'] = array(
'nocomments' => 'Tilføj kommentar',
'comment' => '1 Kommentar',
'comments' => 'Kommentarer'
'comments' => 'Kommentarer',
'rss' => 'Abonner på RSS-feed',
'atom' => 'Abonner på Atom-feed'
);
$lang ['search'] = array(

View File

@ -20,7 +20,10 @@ $lang ['main'] = array(
'nocomments' => 'Kommentar hinzufügen',
'comment' => '1 Kommentar',
'comments' => 'Kommentare'
'comments' => 'Kommentare',
'rss' => 'RSS-Feed abonnieren',
'atom' => 'Atom-Feed abonnieren'
);
$lang ['search'] = array(

View File

@ -20,7 +20,10 @@ $lang ['main'] = array(
'nocomments' => 'Προσθήκη σχολίου',
'comment' => '1 σχόλιο',
'comments' => 'σχόλια'
'comments' => 'σχόλια',
'rss' => 'Εγγραφείτε στο RSS Feed',
'atom' => 'Εγγραφείτε στο Atom Feed'
);
$lang ['search'] = array(

View File

@ -20,7 +20,10 @@ $lang ['main'] = array(
'nocomments' => 'Add a comment',
'comment' => '1 comment',
'comments' => 'comments'
'comments' => 'comments',
'rss' => 'Subscribe RSS feed',
'atom' => 'Subscribe Atom feed'
);
$lang ['search'] = array(

View File

@ -20,7 +20,10 @@ $lang ['main'] = array(
'nocomments' => 'Agregar un Comentario',
'comment' => '1 comentario',
'comments' => 'comentarios'
'comments' => 'comentarios',
'rss' => 'Suscribirse a RSS Feed',
'atom' => 'Suscribirse a Atom Feed'
);
$lang ['search'] = array(

View File

@ -20,7 +20,10 @@ $lang ['main'] = array(
'nocomments' => 'Ajouter un commentaire',
'comment' => '1 commentaire',
'comments' => 'commentaires'
'comments' => 'commentaires',
'rss' => 'S\'abonner au flux RSS',
'atom' => 'S\'abonner au flux Atom'
);
$lang ['search'] = array(

View File

@ -20,7 +20,10 @@ $lang ['main'] = array(
'nocomments' => 'Aggiungi un commento',
'comment' => '1 commento',
'comments' => 'commenti'
'comments' => 'commenti',
'rss' => 'Iscriviti al feed RSS',
'atom' => 'Iscriviti al feed Atom'
);
$lang ['search'] = array(

View File

@ -20,7 +20,10 @@ $lang['main'] = array(
'nocomments' => 'コメントを追加する',
'comment' => '1コメントあります',
'comments' => 'コメントあります'
'comments' => 'コメントあります',
'rss' => 'RSSフィードを購読する',
'atom' => 'Atomフィードを購読する'
);
$lang['search'] = array(

View File

@ -20,7 +20,10 @@ $lang ['main'] = array(
'nocomments' => 'Voeg een commentaar toe',
'comment' => '1 commentaar',
'comments' => 'commentaren'
'comments' => 'commentaren',
'rss' => 'Abonneren op RSS-feed',
'atom' => 'Abonneren op Atom-feed'
);
$lang ['search'] = array(

View File

@ -20,7 +20,10 @@ $lang ['main'] = array(
'nocomments' => 'Adicione comentário',
'comment' => '1 comentário',
'comments' => 'comentários'
'comments' => 'comentários',
'rss' => 'Assine o RSS Feed',
'atom' => 'Assine o Atom Feed'
);
$lang ['search'] = array(

View File

@ -20,7 +20,10 @@ $lang ['main'] = array(
'nocomments' => 'Добавить комментарий',
'comment' => '1 комментарий',
'comments' => 'комментарии'
'comments' => 'комментарии',
'rss' => 'Подписаться на RSS-канал',
'atom' => 'Подписаться на Atom-канал'
);
$lang ['search'] = array(

View File

@ -20,7 +20,10 @@ $lang ['main'] = array(
'nocomments' => 'Dodajte komentar',
'comment' => '1 komentar',
'comments' => 'komentarji'
'comments' => 'komentarji',
'rss' => 'Naročite se na vir RSS',
'atom' => 'Naročite se na vir Atom'
);
$lang ['search'] = array(

View File

@ -129,6 +129,12 @@ h1 { /* Title of the blog */
text-decoration: none
}
#head a img.feed {
float: right;
margin: 0px !IMPORTANT;
height: 12px
}
h2 { /* Titles of the entry */
font-size: 1.4em;
color: #333333;

View File

@ -11,6 +11,10 @@
<div id="body-container">
<div id="head">
{if function_exists('plugin_feed_head')}
<a href="{$smarty.const.BLOG_BASEURL}?x=feed:atom" title="{$lang.main.atom}" target="_blank"><img class="feed" src="{$smarty.const.BLOG_BASEURL}fp-content/images/atom-white.png" alt="atom-feed"></a>
<a href="{$smarty.const.BLOG_BASEURL}?x=feed:rss2" title="{$lang.main.rss}" target="_blank"><img class="feed" src="{$smarty.const.BLOG_BASEURL}fp-content/images/rss-white.png" alt="rss-feed"></a>
{/if}
<h1><a href="{$smarty.const.BLOG_BASEURL}">{$flatpress.title}</a></h1>
<p class="subtitle">{$flatpress.subtitle}</p>
</div> <!-- end of #head -->

View File

@ -180,6 +180,12 @@ h4 { font-size: 1.2em }
margin: .5em 0 0 0
}
#head a img.feed {
float: right;
margin: 0px !IMPORTANT;
height: 16px
}
/* ===== DIV CONTAINER "MAIN" ===== */
#outer-container {
position: relative;

View File

@ -202,6 +202,12 @@ h4 { font-size: 1.2em }
margin: .5em 0 1em 1.2em
}
#head a img.feed {
float: right;
margin: 0px !IMPORTANT;
height: 16px
}
/* ===== DIV CONTAINER "MAIN" ===== */
#outer-container {

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
fp-plugins/feed/img/rss.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -0,0 +1,7 @@
<?php
$lang ['plugin'] ['feed'] = array(
'subject' => 'Přihlaste se k odběru na',
'rss' => 'Přihlásit se k odběru RSS feed',
'atom' => 'Přihlásit se k odběru Atom feed'
);
?>

View File

@ -0,0 +1,7 @@
<?php
$lang ['plugin'] ['feed'] = array(
'subject' => 'Abonnieren',
'rss' => 'Abonner på RSS-feed',
'atom' => 'Abonner på Atom-feed'
);
?>

View File

@ -0,0 +1,7 @@
<?php
$lang ['plugin'] ['feed'] = array(
'subject' => 'Abonnieren',
'rss' => 'RSS-Feed abonnieren',
'atom' => 'Atom-Feed abonnieren'
);
?>

View File

@ -0,0 +1,7 @@
<?php
$lang ['plugin'] ['feed'] = array(
'subject' => 'Εγγραφείτε στην τροφοδοσία',
'rss' => 'Εγγραφείτε στο RSS Feed',
'atom' => 'Εγγραφείτε στο Atom Feed'
);
?>

View File

@ -0,0 +1,7 @@
<?php
$lang ['plugin'] ['feed'] = array(
'subject' => 'Subscribe',
'rss' => 'Subscribe RSS feed',
'atom' => 'Subscribe Atom feed'
);
?>

View File

@ -0,0 +1,7 @@
<?php
$lang ['plugin'] ['feed'] = array(
'subject' => 'Suscribirse al feed',
'rss' => 'Suscribirse a RSS Feed',
'atom' => 'Suscribirse a Atom Feed'
);
?>

View File

@ -0,0 +1,7 @@
<?php
$lang ['plugin'] ['feed'] = array(
'subject' => 'S\'abonner &#224;',
'rss' => 'S\'abonner au flux RSS',
'atom' => 'S\'abonner au flux Atom'
);
?>

View File

@ -0,0 +1,7 @@
<?php
$lang ['plugin'] ['feed'] = array(
'subject' => 'Iscriviti al feed',
'rss' => 'Iscriviti al feed RSS',
'atom' => 'Iscriviti al feed Atom'
);
?>

View File

@ -0,0 +1,7 @@
<?php
$lang ['plugin'] ['feed'] = array(
'subject' => 'フィードを購読する',
'rss' => 'RSSフィードを購読する',
'atom' => 'Atomフィードを購読する'
);
?>

View File

@ -0,0 +1,7 @@
<?php
$lang ['plugin'] ['feed'] = array(
'subject' => 'Abonneren op feed',
'rss' => 'Abonneren op RSS-feed',
'atom' => 'Abonneren op Atom-feed'
);
?>

View File

@ -0,0 +1,7 @@
<?php
$lang ['plugin'] ['feed'] = array(
'subject' => 'Assinar o feed',
'rss' => 'Assine o RSS Feed',
'atom' => 'Assine o Atom Feed'
);
?>

View File

@ -0,0 +1,7 @@
<?php
$lang ['plugin'] ['feed'] = array(
'subject' => 'Подписаться на фид',
'rss' => 'Подписаться на RSS-канал',
'atom' => 'Подписаться на Atom-канал'
);
?>

View File

@ -0,0 +1,7 @@
<?php
$lang ['plugin'] ['feed'] = array(
'subject' => 'Naročite se na vir',
'rss' => 'Naročite se na vir RSS',
'atom' => 'Naročite se na vir Atom'
);
?>

View File

@ -0,0 +1,50 @@
<?php
/*
* Plugin Name: RSS and Atom Feed
* Version: 1.0.0
* Plugin URI: https://www.flatpress.org
* Author: FlatPress
* Author URI: https://www.flatpress.org
* Description: Activates feed buttons in the <a href="./admin.php?p=widgets" title="Widget menu">widget menu</a>. Part of the standard distribution.
*/
function plugin_feed_head() { // stytesheet-file
$pdir = plugin_geturl('feed');
echo '
<!-- BOF Feed-Button Stylesheet -->
<link rel="stylesheet" type="text/css" href="' . $pdir . 'res/feed.css">
<!-- EOF Feed Stylesheet -->
';
}
function plugin_feed_widget() {
$lang = lang_load('plugin:feed');
$baseurl = BLOG_BASEURL;
$imgdir = IMAGES_DIR;
$widget ['subject'] = $lang ['plugin'] ['feed'] ['subject'];
$rss = $lang ['plugin'] ['feed'] ['rss'];
$atom = $lang ['plugin'] ['feed'] ['atom'];
$widget ['content'] = '
<!-- BEOF Feed-Buttons -->
<ul>
<li>
<a href="' . $baseurl . '?x=feed:rss2" title="' . $rss . '" target="_blank"><img class="feed-widget" src="' . $imgdir . 'rss.png" alt="RSS"></a>
<a href="' . $baseurl . '?x=feed:atom" title="' . $atom . '" target="_blank"><img class="feed-widget" src="' . $imgdir . 'atom.png" alt="Atom"></a>
</li>
</ul>
<!-- EOF Feed-Buttons -->
';
return $widget;
}
register_widget('feed', 'RSS and Atom Feed', 'plugin_feed_widget'); // feed-widget
add_action('wp_head', 'plugin_feed_head'); // stytesheet-file
?>

View File

@ -0,0 +1,4 @@
.feed-widget {
margin: 0px !IMPORTANT;
height: 16px;
}