Trac Blog Plugin

Description

A blogging system for Trac.

TracBlogPlugin allows one to harness the power of TagsPlugin to generate blogs. It provides a wiki macro so that blogs can be inserted in any wiki page. It also provides a navigation component.

Screenshots

Main blog page New Blog Post Blog admin

Bugs/Feature Requests

Existing bugs and feature requests for TracBlogPlugin are here.

If you have any issues, create a new ticket.

Download

Download the zipped source from here.

Source

You can check out TracBlogPlugin from here using Subversion, or browse the source with Trac.

Please do not bother with the 0.3 branch. It is known to not work. It is a work in progress. When it is ready, it will be moved out of the branch directory.

Installation

TracBlogPlugin will work with the current trunk and 0.9.x

Requirements

If using 0.9.x it may be necessary to install the TagsPlugin and the WebAdmin plugin globally instead of the project's plugin directory. This is due to the need for those plugins to load before the TracBlogPlugin loads. Unfortunately, 0.9.x does not support plugin dependencies, so the only way to get it to work properly is installing the above plugins globally via:

# python setup.py install

An indication that this may be the case is if a message similar to the following is displayed

...
resolve
    raise DistributionNotFound(req)  # XXX put more info here
DistributionNotFound: TracWebAdmin

Install in the same manner as any other Trac plugin:

# python setup.py bdist_egg
# cp dist/*.egg /srv/trac/env/plugins

If the TracBlogPlugin is installed system wide, then you will need to enable the plugin in your trac.ini:

[components]
tBlog.* = enabled

Example

[[BlogShow]]
Displays a blog based on tags The list of tags to be shown can be specified as arguments to the macro. If no tags are specified as parameters, then the default 'blog' tag is used.

The following options can be specified:

union - Specify whether the join for the tags listed should be a union or intersection(default).
num_posts - Number of posts to display.
year - Year for which to show posts.
month - Month for which to show posts.
day - Day of the month for which to show posts.
delta - How many days of posts should be shown.
mark_update - Specify whether to show "Updated on" for posts that have been updated.
hidecal - Hide the calendar (when set to true).

If specifying dates with year, month, and/or day, the current value is specified if missing. For example, if day is specified but year and month are not, then year will be filled in with the current year and month will be filled with the current month. If only year and month are specified, then that indicates the whole month is desired.

The num_posts options is bounded by the date options if combined. For example, if num_posts=5 and month=4 is specified, it will show up to 5 posts from the month of April. If only 3 posts exist, then only 3 are shown. If a date option is not specified, then it will show the last num_posts posts.

[[BlogShow()]]
[[BlogShow(blog,pacopablo)]]
[[BlogShow(blog,pacopablo,union=True)]]
[[BlogShow(blog,pacopablo,num_posts=5)]]
[[BlogShow(blog,pacopablo,month=4,num_posts=5)]]
[[BlogShow(blog,pacopablo,year=2006,month=4)]]
[[BlogShow(blog,pacopablo,year=2006,month=4,day=12)]]
[[BlogShow(blog,pacopablo,delta=5)]]
[[BlogShow(blog,pacopablo,delta=5,mark_updated=False)]]
[[BlogShow(blog,pacopablo,num_posts=3,hidecal=true)]]
[[BlogPost]]
Inserts a link to create a new blog post

Accepts keyword arguments that specify default parameters. The macro will be hidden unless the user has BLOG_POSTER permissions.

tag - Tag that populates the "Tag under" field. This key may be specified as a tuple or list to pass multiple values.
blogtitle - Default blog entry title.
text - Default entry body text.
pagename - Default wiki page name.
readonly - Default readonly page status.
link - Text to display as the link.

[[BlogPost()]]
[[BlogPost(tag=(blog,pacopablo))]]
[[BlogPost(tag=blog,blogtitle="A Simple Title",text="Body Text")]]
[[BlogPost(tag=blog,pagename=blog/newpage,readonly=1)]]    
[[BlogPost(tag=(blog,pacopablo),link="A New Blog Post")]]  

trac.ini Documentation

[blog]
date_format = %x %X              ; format string in strftime format
page_format = %Y/%m/%d/%H.%M     ; format string in strftime format
default_tag = blog               ; comma separated list of tags
post_size = 1024                 ; number of bytes to show before truncation
history_days = 30                ; number of days of blog entries to show
new_blog_link = New Blog Post    ; default value for new blog post link

Users

If you use TracBlog, please post a link to your blog:

Recent Changes

[1846] by pacopablo on 01/04/07 17:17:17

TracBlogPlugin:

  • Refs #736
  • Added a check when trying to load a WikiPage. This should compensate for empty Wiki pages.
  • Please test and close this bug if it does indeed solve the problem. I currently can't duplicate the issue

[1845] by pacopablo on 01/04/07 16:44:35

TracBlogPlugin:

  • Closes #657. Documentation added to Admin page and BlogShow macro

[1582] by pacopablo on 11/21/06 19:13:23

TracBlogPlugin:

  • Applied patch for RSS email addresses from kindlund@mitre.org, Closes #336
  • Removed reference to addHeadingLinks in new_blog.cs. Closes #786
  • Added code to redirect to the page where posting a new entry was selected. Closes #452
  • Added patch to allow for customizable footer on blog posts from dfaerch. Closes #745

Author/Contributors

Author: pacopablo
Contributors: