sidebar calendar plugin
William Morgan
wmorgan-hobix-is-the-way at masanjin.net
Mon Sep 27 10:03:55 EDT 2004
Hi all,
I've whipped up a plugin that displays a calendar on the sidebar,
with links to days containing entries. A standard blog calendar kinda
thing.
screenshot:
http://www.masanjin.net/~wmorgan/sidebar-calendar/screenshot1.jpeg
the code:
http://www.masanjin.net/~wmorgan/sidebar-calendar/sidebar-calendar-0.0.tgz
It's a little complex to set up compared to the last one (3 files and
some messin with hobix.yaml), and no doubt many bugs remain, but It
Works For Me. Comments, bug reports, and patches welcome.
Here's the documentation:
## sidebar_calendar.rb -- Hobix calendar plugin version 0.0, 9/27/04
## (c) 2004 William Morgan. This file is released under the GNU Public
## License.
##
## This plugin displays a one-month calendar in the sidebar. The
## calendar links individual days to a daily, monthly or yearly index
## page. Daily and monthly index pages display the corresponding month
## in the sidebar; other pages display the current month.
##
## The plugin generates separate sidebar .html file for each month. It
## places these files in htdocs/sidebar-calendar/.
##
## This plugin replaces default sidebar plugin, but the two can be
## used concurrently.
##
## USAGE:
##
## 0) Place sidebar_calendar.rb in your lib/ directory.
## 1) Place sidebar_calendar.html.quick and sidebar-calendar.css in
## your skel/ directory.
## 2) In hobix.yaml, under the requires: section, add the line:
## - sidebar_calendar
## If you want to give it arguments, you can specify any of the
## following:
## - sidebar_calendar:
## start-on-monday: true
## point-to-index: daily
## day-symbols: ["Mon" "Tue" "Wed" "Thu" "Fri" "Sat" "Sun"]
## Options for point-to-index are daily, monthly and yearly.
## 3) Under hobix/out/quick, write a sidebar_calendar_list
## which has the same format as sidebar_list, but additionally has
## a 'sidebar_calendar' entry. For example, I have:
## sidebar_calendar_list:
## - sidebar_links
## - sidebar_section_map
## - sidebar_syndicate
## - sidebar_calendar
## - sidebar_hobix
## 4) If you want the <a name> jumping to work (very useful for
## monthly and yearly index pages), also place the following under
## hobix/out/quick:
## day_header: |
## <a name="<%= day.strftime( "%Y%m%d" ) %>"/>
## <h2 class="dayHeader"><%= day.strftime( "%A, %B %d, %Y" ) %></h2>
##
## BUGS
##
## 0) Right now, the sidebar is only updated if the last-modified time
## of any entry for that month changes. If you have other elements
## in your sidebar that change more frequently than that (e.g. a
## list of most popular entries), you'll have to hack the code
## yourself to get it to regenerate more often. There isn't a good
## solution to this that I know of; the only other general solution
## is to regenerate the sidebar files on every update---this is the
## default sidebar behavior, but I've chosen not to emulate it.
## 1) You'll probably need to modify the CSS file to your taste.
## 2) Using this sidebar with a yearly index is kind of weird because
## it displays January for that year. You might just want to use
## the regular (non-calendar) sidebar for yearly index pages.
##
## Good luck. -- William <wmorgan-hobix-sidebar-calendar at masanjin.net>
--
William <wmorgan-hobix-is-the-way at masanjin.net>
More information about the Hobix-is-the-way
mailing list