From 64c0de03b96e78b62ba1190ceb5fcffe909c16d3 Mon Sep 17 00:00:00 2001 From: joerg Date: Sat, 20 Dec 2008 20:15:28 +0000 Subject: [PATCH] - Use django template for index.html - move files into a common/ dir which we can easily symlink to new planets - add a template config for language based planets git-svn-id: svn+ssh://svn.debian.org/svn/planet-debian/trunk@1057 c2f067bf-98e0-425f-9c98-e76020cfa380 --- config/config.ini | 52 +++++++++------ config/config.ini.tmpl | 120 +++++++++++++++++++++++++++++++++++ templates/index.html.dj | 110 ++++++++++++++++++++++++++++++++ templates/index.html.tmpl | 118 ---------------------------------- www/{ => common}/atom.png | Bin www/{ => common}/boxless.css | 0 www/{ => common}/debian.png | Bin www/{ => common}/favicon.ico | Bin www/{ => common}/foaf.png | Bin www/{ => common}/hacker.png | Bin www/{ => common}/hide.js | 0 www/{ => common}/minus-8.png | Bin www/{ => common}/opml.png | Bin www/{ => common}/planet.png | Bin www/{ => common}/plus-8.png | Bin www/{ => common}/rss10.png | Bin www/{ => common}/rss20.png | Bin 17 files changed, 263 insertions(+), 137 deletions(-) create mode 100644 config/config.ini.tmpl create mode 100644 templates/index.html.dj delete mode 100644 templates/index.html.tmpl rename www/{ => common}/atom.png (100%) rename www/{ => common}/boxless.css (100%) rename www/{ => common}/debian.png (100%) rename www/{ => common}/favicon.ico (100%) rename www/{ => common}/foaf.png (100%) rename www/{ => common}/hacker.png (100%) rename www/{ => common}/hide.js (100%) rename www/{ => common}/minus-8.png (100%) rename www/{ => common}/opml.png (100%) rename www/{ => common}/planet.png (100%) rename www/{ => common}/plus-8.png (100%) rename www/{ => common}/rss10.png (100%) rename www/{ => common}/rss20.png (100%) diff --git a/config/config.ini b/config/config.ini index 0bf7ed1..afd0126 100644 --- a/config/config.ini +++ b/config/config.ini @@ -2,54 +2,68 @@ # 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: Your planet's name. +# link: Link to the main planet page name = Planet Debian link = http://planet.debian.org/ + +# output_dir: Directory to place output files. Add your 2letter Language code +# date_format: strftime format for the default 'date' template variable +# new_date_format: strftime format for the 'new_date' template variable +# cache_directory: Where cached feeds are stored. Add your 2letter Language code +output_dir = www +date_format = %d %B, %Y %I:%M%p +new_date_format = %B %d, %Y +cache_directory = cache + +# Translate the following to your language. Do not change the names, just the +# text after the = +syndicationtext = A complete feed is available in any of your favourite syndication formats linked by the buttons below. +searchtext = Search +lastupdatetext = Last updated: +utctext = All times are UTC. +contacttext = Contact: +hiddenfeedstext = Hidden Feeds +hiddenfeedstext2 = You currently have hidden entries. +showalltext = Show all +subscriptionstext = Subscriptions +feedtext = feed + + +# Do not change config values below here, just skip to the feeds +# Do not change config values below here, just skip to the feeds owner_name = Debian Planet Maintainers owner_email = planet@debian.org -# cache_directory: Where cached feeds are stored +search = true # 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 = 1 log_level = DEBUG spider_threads = 15 # template_files: Space-separated list of output template files -template_files = templates/index.html.tmpl templates/atom.xml.tmpl templates/rss20.xml.tmpl templates/rss10.xml.tmpl templates/opml.xml.tmpl templates/foafroll.xml.tmpl +template_files = templates/index.html.dj templates/atom.xml.tmpl templates/rss20.xml.tmpl templates/rss10.xml.tmpl templates/opml.xml.tmpl templates/foafroll.xml.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 -output_dir = www items_per_page = 60 days_per_page = 0 -date_format = %d %B, %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). - -# Provide no more than 7 days articles on the front page [templates/index.html.tmpl] date_format = %I:%M%P +[templates/index.html.dj] +date_format = %I:%M%P + # Options placed in the [DEFAULT] section provide defaults for the feed # sections. Placing a default here means you only need to override the diff --git a/config/config.ini.tmpl b/config/config.ini.tmpl new file mode 100644 index 0000000..b5238b0 --- /dev/null +++ b/config/config.ini.tmpl @@ -0,0 +1,120 @@ +# Planet configuration file + +# The following rules apply for a new language planet: +# +# * The feeds contain the same content as one would put on planet.debian.org, +# ie. mostly Debian related / from people involved in Debian +# +# * The feeds provide an own category with only the language for this planet. +# +# * At least 10 feeds have to be there before a new language gets added. +# +# * Language planets will appear as planet.debian.org/$LANGUAGE, +# where $LANGUAGE will be the two-letter code for it. + + +# Little documentation for multi-language planet: + +# In the following, above "Do not change", replace $LANGUAGE with the +# name of your language, $2LETTERCODE with the 2 letter iso code. +# For example, a german planet would use Deutsch and DE. +# Feel free to edit the other values as shown. +# Please do not touch the config values below "Do not change", just +# skip to the feed list. + +# When you are done, send this file to planet@debian.org and ask for the +# addition of the new language planet. Do NOT just commit it, it won't get +# picked up by the scripts. + +# After the new language is activated, feel free to edit this file following +# the normal rules for all planet config.ini files. + +# Hint: You can use hackergotchis the same way as on main planet. But it is +# *one* central storage for hackergotchis, not one per different language. + + +# Every planet needs a [Planet] section +[Planet] +# name: Your planet's name. +name = Planet Debian $LANGUAGE +# link: Link to the main planet page +link = http://planet.debian.org/$2LETTERCODE/ + +# output_dir: Directory to place output files. Add your 2letter Language code +output_dir = www/$2LETTERCODE +# date_format: strftime format for the default 'date' template variable +date_format = %d %B, %Y %I:%M%p +# new_date_format: strftime format for the 'new_date' template variable +new_date_format = %B %d, %Y +# cache_directory: Where cached feeds are stored. Add your 2letter Language code +cache_directory = cache/$2LETTERCODE + +# Translate the following to your language. Do not change the names, just the +# text after the = +syndicationtext = A complete feed is available in any of your favourite syndication formats linked by the buttons below. +searchtext = Search +lastupdatetext = Last updated: +utctext = All times are UTC. +contacttext = Contact: +hiddenfeedstext = Hidden Feeds +hiddenfeedstext2 = You currently have hidden entries. +showalltext = Show all +subscriptionstext = Subscriptions +feedtext = feed + + +# Do not change config values below here, just skip to the feeds +# Do not change config values below here, just skip to the feeds +owner_name = Debian Planet Maintainers +owner_email = planet@debian.org + +# Currently no search for Language planets +search = false +# new_feed_items: Number of items to take from new feeds +# log_level: One of DEBUG, INFO, WARNING, ERROR or CRITICAL +new_feed_items = 1 +log_level = DEBUG +spider_threads = 15 + +# template_files: Space-separated list of output template files +template_files = templates/index.html.dj templates/atom.xml.tmpl templates/rss20.xml.tmpl templates/rss10.xml.tmpl templates/opml.xml.tmpl templates/foafroll.xml.tmpl + +# The following provide defaults for each template: +# 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) +# 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 +items_per_page = 60 +days_per_page = 0 +encoding = utf-8 +# locale = C + +[templates/index.html.dj] +date_format = %I:%M%P + + +# Options placed in the [DEFAULT] section provide defaults for the feed +# sections. Placing a default here means you only need to override the +# special cases later. +[DEFAULT] +# Hackergotchi default size. +# If we want to put a face alongside a feed, and it's this size, we +# can omit these variables. +facewidth = 65 +faceheight = 85 +future_dates = ignore_date + + +############################## FEEDS ############################## +# +# ADD YOURSELF IN ALPHABETICAL ORDER BELOW +# +################################################################### + +# The URL of the feed goes in the []s. +# name = Your name +# face = filename of your hackergotchi in heads (or leave out entirely) +# facewidth/faceheight = size of your hackergotchi, if not default diff --git a/templates/index.html.dj b/templates/index.html.dj new file mode 100644 index 0000000..951e0bb --- /dev/null +++ b/templates/index.html.dj @@ -0,0 +1,110 @@ + + + + {{ name }} + + + + + + + + + + + + + + +{% for item in Items %} +{% ifchanged item.new_date %} +

{{ item.new_date }}

+{% endifchanged %} + +
+ {% ifchanged item.channel_name %} + {% if item.channel_face %} + + hackergotchi for {{ item.channel_author|safe }} + + {% endif %} +

+ {{ item.channel_name|safe }} + +

+ + {% endifchanged %} +
+{% endfor %} + + + + + diff --git a/templates/index.html.tmpl b/templates/index.html.tmpl deleted file mode 100644 index 6719f6c..0000000 --- a/templates/index.html.tmpl +++ /dev/null @@ -1,118 +0,0 @@ - - - - - -<TMPL_VAR name> -"> - - - - - - - - - - - - - - - - - - - - - -

-
- - -
- -">" width="" height="" alt=""> - -

" title=""> - -

- - - -
- - - - - - diff --git a/www/atom.png b/www/common/atom.png similarity index 100% rename from www/atom.png rename to www/common/atom.png diff --git a/www/boxless.css b/www/common/boxless.css similarity index 100% rename from www/boxless.css rename to www/common/boxless.css diff --git a/www/debian.png b/www/common/debian.png similarity index 100% rename from www/debian.png rename to www/common/debian.png diff --git a/www/favicon.ico b/www/common/favicon.ico similarity index 100% rename from www/favicon.ico rename to www/common/favicon.ico diff --git a/www/foaf.png b/www/common/foaf.png similarity index 100% rename from www/foaf.png rename to www/common/foaf.png diff --git a/www/hacker.png b/www/common/hacker.png similarity index 100% rename from www/hacker.png rename to www/common/hacker.png diff --git a/www/hide.js b/www/common/hide.js similarity index 100% rename from www/hide.js rename to www/common/hide.js diff --git a/www/minus-8.png b/www/common/minus-8.png similarity index 100% rename from www/minus-8.png rename to www/common/minus-8.png diff --git a/www/opml.png b/www/common/opml.png similarity index 100% rename from www/opml.png rename to www/common/opml.png diff --git a/www/planet.png b/www/common/planet.png similarity index 100% rename from www/planet.png rename to www/common/planet.png diff --git a/www/plus-8.png b/www/common/plus-8.png similarity index 100% rename from www/plus-8.png rename to www/common/plus-8.png diff --git a/www/rss10.png b/www/common/rss10.png similarity index 100% rename from www/rss10.png rename to www/common/rss10.png diff --git a/www/rss20.png b/www/common/rss20.png similarity index 100% rename from www/rss20.png rename to www/common/rss20.png -- 2.39.2