Add planet blog aggregator feeds to website

Generate a new section of the website to aggregate Blog posts
about TripleO.

Change-Id: I719973e350aec432a3a2ad1413ea873b1edf95e5
This commit is contained in:
Dan Prince 2016-05-02 21:26:42 -04:00
parent 43c1926514
commit 3f8d9f19a4
4 changed files with 166 additions and 2 deletions

2
.gitignore vendored
View File

@ -8,3 +8,5 @@ scripts/website/reviewday/
scripts/website/tripleo-ci/
scripts/website/tripleo-docs/
scripts/website/tripleosphinx/
scripts/website/planet-2.0/
scripts/website/planet.html.tmplc

View File

@ -20,6 +20,7 @@ OUT_HTML=${OUT_HTML:-'out_html'}
REVIEWDAY_INPUT_FILE="${SCRIPT_DIR}/tripleo-reviewday.yaml"
SKIP_REVIEWDAY=${SKIP_REVIEWDAY:-''}
SKIP_CI_REPORTS=${SKIP_CI_REPORTS:-''}
SKIP_BLOG=${SKIP_BLOG:-''}
# TRIPLEO-DOCS
if [ ! -d tripleo-docs ]; then
@ -73,6 +74,13 @@ else
popd
fi
#Planet (Blog Feed Aggregator)
if [ ! -d planet-2.0 ]; then
wget http://www.planetplanet.org/download/planet-2.0.tar.bz2
tar xvf planet-2.0.tar.bz2
rm planet-2.0.tar.bz2
fi
#-----------------------------------------
source tripleo-docs/.tox/docs/bin/activate
pushd tripleosphinx
@ -99,7 +107,7 @@ if [ -z "$SKIP_REVIEWDAY" ]; then
echo "<h1>TripleO Reviews</h1>" >> $OUT_FILE
sed -e "s|<title>.*|<title>TripleO: Reviews</title>|" -i $OUT_FILE # custom title
sed -e "s|<title>.*|<title>TripleO: Reviews</title><meta name='description' content='OpenStack Deployment Program Reviews'/>|" -i $OUT_FILE # custom title
echo $DATA >> $OUT_FILE
echo "$DATA" >> $OUT_FILE
sed -n '/.*Custom Content Here/,$p' $TEMPLATE_FILE >> $OUT_FILE #second half
fi
@ -116,7 +124,24 @@ if [ -z "$SKIP_CI_REPORTS" ]; then
sed -n '1,/.*Custom Content Here/p' $TEMPLATE_FILE > $OUT_FILE #first half
echo "<h1>TripleO CI Status</h1>" >> $OUT_FILE
sed -e "s|<title>.*|<title>TripleO: CI Status</title><meta name='description' content='OpenStack Deployment Program CI Status results'/>|" -i $OUT_FILE # custom title
echo $DATA >> $OUT_FILE
echo "$DATA" >> $OUT_FILE
sed -n '/.*Custom Content Here/,$p' $TEMPLATE_FILE >> $OUT_FILE #second half
fi
# Planet
if [ -z "$SKIP_BLOG" ]; then
cp $SCRIPT_DIR/tripleo-ci/scripts/website/planet* $SCRIPT_DIR/planet-2.0/
pushd $SCRIPT_DIR/planet-2.0
mkdir output
python planet.py planet.config.ini
popd
DATA=$(cat planet-2.0/output/planet.html)
OUT_FILE=$SCRIPT_DIR/tripleo-docs/doc/build/html/planet.html
TEMPLATE_FILE=$SCRIPT_DIR/tripleosphinx/doc/build/html/blank.html
sed -n '1,/.*Custom Content Here/p' $TEMPLATE_FILE > $OUT_FILE #first half
echo "<h1>Planet TripleO</h1>" >> $OUT_FILE
sed -e "s|<title>.*|<title>Planet TripleO</title><meta name='description' content='OpenStack Deployment Program Planet'/>|" -i $OUT_FILE # custom title
echo "$DATA" >> $OUT_FILE
sed -n '/.*Custom Content Here/,$p' $TEMPLATE_FILE >> $OUT_FILE #second half
fi

View File

@ -0,0 +1,90 @@
# Planet configuration file
# Every planet needs a [Planet] section
[Planet]
# name: Your planet's name
# link: Link to the main page
# owner_name: Your name
# owner_email: Your e-mail address
name = TripleO
link = http://www.tripleo.org/
owner_name = Fatty Owl
owner_email = devnull@tripleo.org
# cache_directory: Where cached feeds are stored
# new_feed_items: Number of items to take from new feeds
# log_level: One of DEBUG, INFO, WARNING, ERROR or CRITICAL
cache_directory = cache
new_feed_items = 2
log_level = DEBUG
# template_files: Space-separated list of output template files
#template_files = examples/basic/index.html.tmpl examples/atom.xml.tmpl examples/rss20.xml.tmpl examples/rss10.xml.tmpl examples/opml.xml.tmpl examples/foafroll.xml.tmpl
template_files = planet.html.tmpl
# The following provide defaults for each template:
# output_dir: Directory to place output files
# items_per_page: How many items to put on each page
# days_per_page: How many complete days of posts to put on each page
# This is the absolute, hard limit (over the item limit)
# date_format: strftime format for the default 'date' template variable
# new_date_format: strftime format for the 'new_date' template variable
# encoding: output encoding for the file, Python 2.3+ users can use the
# special "xml" value to output ASCII with XML character references
# locale: locale to use for (e.g.) strings in dates, default is taken from your
# system. You can specify more locales separated by ':', planet will
# use the first available one
output_dir = output
items_per_page = 20
days_per_page = 0
date_format = %B %d, %Y %I:%M %p
new_date_format = %B %d, %Y
encoding = utf-8
# locale = C
# To define a different value for a particular template you may create
# a section with the same name as the template file's filename (as given
# in template_files).
#
# [examples/rss10.xml.tmpl]
# items_per_page = 30
# encoding = xml
# Any other section defines a feed to subscribe to. The section title
# (in the []s) is the URI of the feed itself. A section can also be
# have any of the following options:
#
# name: Name of the feed (defaults to the title found in the feed)
#
# Additionally any other option placed here will be available in
# the template (prefixed with channel_ for the Items loop). You can
# define defaults for these in a [DEFAULT] section, for example
# Planet Debian uses the following to define faces:
#
# [DEFAULT]
# facewidth = 64
# faceheight = 64
#
# [http://www.blog.com/rss]
# face = foo.png
# faceheight = 32
#
# The facewidth of the defined blog defaults to 64.
# NOTE: Feeds here should also get added to planet.openstack.org.
# This section is just to slice out the TripleO topics to highlight
# on tripleo.org.
[http://blog-slagle.rhcloud.com/?tag=tripleo&feed=rss2]
name = James Slagle
[http://blog.nemebean.com/taxonomy/term/5/feed]
name = Ben Nemec
[http://hardysteven.blogspot.com/feeds/posts/default/-/tripleo?alt=rss]
name = Steven Hardy
[http://giuliofidente.com/feeds/tag/tripleo.atom.xml]
name = Giulio Fidente

View File

@ -0,0 +1,47 @@
<body>
<div style="float: right">
<b>Subscriptions</b>
<ul>
<TMPL_LOOP Channels>
<li><a href="<TMPL_VAR link ESCAPE="HTML">" title="<TMPL_VAR title ESCAPE="HTML">"><TMPL_VAR name></a> <a href="<TMPL_VAR url ESCAPE="HTML">">(feed)</a></li>
</TMPL_LOOP>
</ul>
</div>
### The other loop is the Items loop, which will get iterated for each
### news item.
<TMPL_LOOP Items>
### Visually distinguish articles from different days by checking for
### the new_date flag. This demonstrates the <TMPL_IF varname> ... </TMPL_IF>
### check.
<TMPL_IF new_date>
<h3 style='width: 75%'><TMPL_VAR new_date></h3>
</TMPL_IF>
### Group consecutive articles by the same author together by checking
### for the new_channel flag.
<TMPL_IF new_channel>
<p><a href="<TMPL_VAR channel_link ESCAPE="HTML">" title="<TMPL_VAR channel_title ESCAPE="HTML">"><TMPL_VAR channel_name></a></p>
</TMPL_IF>
<TMPL_IF title>
<h4 style='width: 75%'><a href="<TMPL_VAR link ESCAPE="HTML">"><TMPL_VAR title></a></h4>
</TMPL_IF>
<p>
<TMPL_VAR content>
</p>
<p>
<em><a href="<TMPL_VAR link ESCAPE="HTML">"><TMPL_IF author>by <TMPL_VAR author> at </TMPL_IF><TMPL_VAR date></a></em>
</p>
</TMPL_LOOP>
<hr>
<p>
<em>Last updated: <TMPL_VAR date></em>
</p>