Skip to content
Snippets Groups Projects
Commit 615960fe authored by Tom N Harris's avatar Tom N Harris
Browse files

use generated CSS for RSS feeds

plugins can include styles with feed.css,
templates can use the media type feed in style.ini

darcs-hash:20061115101549-6942e-d1de56b343ce0cc11ca6b911c444197316f4a4eb.gz
parent afe99d00
No related branches found
No related tags found
No related merge requests found
......@@ -75,7 +75,7 @@
$rss->title = $conf['title'].(($ns) ? ' '.$ns : '');
$rss->link = DOKU_URL;
$rss->syndicationURL = DOKU_URL.'feed.php';
$rss->cssStyleSheet = DOKU_URL.'lib/styles/feed.css';
$rss->cssStyleSheet = DOKU_URL.'lib/exe/css.php?s=feed';
$image = new FeedImage();
$image->title = $conf['title'];
......
......@@ -236,7 +236,7 @@ function tpl_metaheaders($alt=true){
$head['link'][] = array('rel'=>'stylesheet', 'media'=>'screen', 'type'=>'text/css',
'href'=>DOKU_BASE.'lib/exe/css.php');
$head['link'][] = array('rel'=>'stylesheet', 'media'=>'print', 'type'=>'text/css',
'href'=>DOKU_BASE.'lib/exe/css.php?print=1');
'href'=>DOKU_BASE.'lib/exe/css.php?s=print');
// load javascript
$js_edit = ($ACT=='edit' || $ACT=='preview' || $ACT=='recover' || $ACT=='wordblock' ) ? 1 : 0;
......
......@@ -30,7 +30,15 @@ if(!defined('SIMPLE_TEST')){
function css_out(){
global $conf;
global $lang;
$print = (bool) $_REQUEST['print']; //print mode?
switch ($_REQUEST['s']) {
case 'print':
case 'feed':
$style = $_REQUEST['s'];
break;
default:
$style = '';
break;
}
// The generated script depends on some dynamic options
$cache = getCacheName('styles'.$conf['template'].$print,'.css');
......@@ -48,11 +56,12 @@ function css_out(){
// are needed to fix relative paths in the stylesheets
$files = array();
if (isset($tplstyles['all'])) $files = array_merge($files, $tplstyles['all']);
if($print){
if(!empty($style)){
$files[DOKU_INC.'lib/styles/'.$style.'.css'] = DOKU_BASE.'lib/styles/';
// load plugin, template, user styles
$files = array_merge($files, css_pluginstyles('print'));
if (isset($tplstyles['print'])) $files = array_merge($files, $tplstyles['print']);
$files[DOKU_CONF.'userprint.css'] = '';
$files = array_merge($files, css_pluginstyles($style));
if (isset($tplstyles[$style])) $files = array_merge($files, $tplstyles[$style]);
$files[DOKU_CONF.'user'.$style.'.css'] = '';
}else{
$files[DOKU_INC.'lib/styles/style.css'] = DOKU_BASE.'lib/styles/';
if($conf['spellchecker']){
......@@ -241,6 +250,9 @@ function css_pluginstyles($mode='screen'){
if($mode == 'print'){
$list[DOKU_PLUGIN."$p/print.css"] = DOKU_BASE."lib/plugins/$p/";
$list[DOKU_PLUGIN."$p/all.css"] = DOKU_BASE."lib/plugins/$p/";
}elseif($mode == 'feed'){
$list[DOKU_PLUGIN."$p/feed.css"] = DOKU_BASE."lib/plugins/$p/";
$list[DOKU_PLUGIN."$p/all.css"] = DOKU_BASE."lib/plugins/$p/";
}else{
$list[DOKU_PLUGIN."$p/style.css"] = DOKU_BASE."lib/plugins/$p/";
$list[DOKU_PLUGIN."$p/screen.css"] = DOKU_BASE."lib/plugins/$p/";
......
rss channel, feed, RDF {
font: 80% "Lucida Grande", Verdana, Lucida, Helvetica, Arial, sans-serif;
background-color: White;
color: Black;
background-color: __background__;
color: __text__;
margin: 0;
padding: 0;
}
......@@ -16,7 +16,7 @@ category, image {
item link, entry id {
display: block;
color:#436976;
color:__extern__;
text-decoration:underline;
}
......@@ -24,9 +24,9 @@ channel title, feed title {
display: block;
font-size:200%;
font-weight:bolder;
color:#436976;
color:__extern__;
text-decoration:none;
border-bottom: 20px solid #dee7ec;
border-bottom: 20px solid __background_alt__;
}
:root:before {
......@@ -36,23 +36,23 @@ channel title, feed title {
item, entry {
display: block;
margin: 1em 180px 1em 1em;
border-bottom: 1px solid #8cacbb;
border-bottom: 1px solid __border__;
padding-bottom: 1em;
}
item title, entry title {
display: block;
background: transparent none;
border: 0px solid #ffffff;
border: 0px solid __background_other__;
padding: 0;
color: #222;
color: __text_alt__;
font-size: 1.4em;
font-weight: bold;
}
item pubDate, entry modified, item date {
display: inline;
color: #AAA;
color: __text_neu__;
font: 1em trebuchet ms, arial, helvetica, sans-serif;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment