From 99626615ff41a257090414bf500a83674e8fdc27 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 25 Aug 2009 13:39:33 -0400 Subject: Fix example blog's tags/life to not have a broken PageSpec. Closes: #543510 --- doc/examples/blog/tags/life.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/examples') diff --git a/doc/examples/blog/tags/life.mdwn b/doc/examples/blog/tags/life.mdwn index ddc2e646c..719f2b192 100644 --- a/doc/examples/blog/tags/life.mdwn +++ b/doc/examples/blog/tags/life.mdwn @@ -1,4 +1,4 @@ This feed contains pages in the "life" category. -[[!inline pages="link(tags/life) and ./posts/* and !*/Discussion" +[[!inline pages="link(tags/life) and !*/Discussion" show="10" actions=yes]] -- cgit v1.2.3 From 9d96253d2b10f5bf56b7bd64635754508d969cb6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 25 Sep 2009 15:41:13 -0400 Subject: add comments page to example blog, listing all comments --- doc/examples/blog/comments.mdwn | 3 +++ doc/examples/blog/index.mdwn | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 doc/examples/blog/comments.mdwn (limited to 'doc/examples') diff --git a/doc/examples/blog/comments.mdwn b/doc/examples/blog/comments.mdwn new file mode 100644 index 000000000..c46f95df7 --- /dev/null +++ b/doc/examples/blog/comments.mdwn @@ -0,0 +1,3 @@ +This page will show all comments made to posts in my [[blog|index]]. + +[[!inline pages="*/Discussion or internal(./posts/*/comment_*)"]] diff --git a/doc/examples/blog/index.mdwn b/doc/examples/blog/index.mdwn index 84c732dd1..aef46eb68 100644 --- a/doc/examples/blog/index.mdwn +++ b/doc/examples/blog/index.mdwn @@ -3,7 +3,7 @@ Welcome to my blog. Have a look at the most recent posts below, or browse the tag cloud on the -right. An archive of all [[posts]] is also available. +right. Archives of all [[posts]] and all [[comments]] are also available. [[!inline pages="./posts/* and !*/Discussion" show="10" actions=yes rootpage="posts"]] -- cgit v1.2.3 From 0cb9e588e4253d317945399120a1ef5780b59d7a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 5 Oct 2009 20:54:38 -0400 Subject: add among limit to pagestats --- doc/examples/blog/index.mdwn | 2 +- doc/examples/blog/tags.mdwn | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/examples') diff --git a/doc/examples/blog/index.mdwn b/doc/examples/blog/index.mdwn index aef46eb68..01b714fcd 100644 --- a/doc/examples/blog/index.mdwn +++ b/doc/examples/blog/index.mdwn @@ -1,4 +1,4 @@ -[[!pagestats pages="./tags/*"]] +[[!pagestats pages="./tags/*" among="./posts/*"]] Welcome to my blog. diff --git a/doc/examples/blog/tags.mdwn b/doc/examples/blog/tags.mdwn index 53cc8d368..b5eca5b71 100644 --- a/doc/examples/blog/tags.mdwn +++ b/doc/examples/blog/tags.mdwn @@ -1,3 +1,3 @@ -[[!pagestats pages="./tags/*"]] +[[!pagestats pages="./tags/*" among="./posts/*"]] On the right you can see the tag cloud for this blog. -- cgit v1.2.3 From 0fb4474cf82ffe0ccd2b206843ba4f61160e4cf8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 7 Oct 2009 13:55:02 -0400 Subject: limit to discussion pages of blog posts, not whole wiki --- doc/examples/blog/comments.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/examples') diff --git a/doc/examples/blog/comments.mdwn b/doc/examples/blog/comments.mdwn index c46f95df7..4735dea08 100644 --- a/doc/examples/blog/comments.mdwn +++ b/doc/examples/blog/comments.mdwn @@ -1,3 +1,3 @@ This page will show all comments made to posts in my [[blog|index]]. -[[!inline pages="*/Discussion or internal(./posts/*/comment_*)"]] +[[!inline pages="./posts/*/Discussion or internal(./posts/*/comment_*)"]] -- cgit v1.2.3 From e1939185d29e1431861e63d6526cb3a498d6033e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 11 Oct 2009 16:42:49 -0400 Subject: ikiwiki-calendar: New command automates creation of archive pages using the calendar plugin. --- debian/changelog | 7 +++++ doc/examples/blog.mdwn | 4 +++ doc/ikiwiki-calendar.mdwn | 51 ++++++++++++++++++++++++++++++++ doc/ikiwiki/directive/calendar.mdwn | 29 ++++++++++++------ doc/plugins/calendar.mdwn | 8 ++--- ikiwiki-calendar | 59 +++++++++++++++++++++++++++++++++++++ templates/calendarmonth.tmpl | 3 ++ templates/calendaryear.tmpl | 1 + 8 files changed, 147 insertions(+), 15 deletions(-) create mode 100644 doc/ikiwiki-calendar.mdwn create mode 100755 ikiwiki-calendar create mode 100644 templates/calendarmonth.tmpl create mode 100644 templates/calendaryear.tmpl (limited to 'doc/examples') diff --git a/debian/changelog b/debian/changelog index a79faf7fb..22935955a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +ikiwiki (3.20091010) UNRELEASED; urgency=low + + * ikiwiki-calendar: New command automates creation of archive pages + using the calendar plugin. + + -- Joey Hess Sun, 11 Oct 2009 15:54:45 -0400 + ikiwiki (3.20091009) unstable; urgency=low * parentlinks: Add has_parentlinks template parameter to allow styling diff --git a/doc/examples/blog.mdwn b/doc/examples/blog.mdwn index 2155d7fea..f542cad0c 100644 --- a/doc/examples/blog.mdwn +++ b/doc/examples/blog.mdwn @@ -23,3 +23,7 @@ Some additional configuration you might want to do: enable comments to posts to the blog: comments_pagespec => 'blog/posts/* and !*/Discussion', + +* Enable the [[calendar|plugins/calendar]] plugin and run the + [[ikiwiki-calendar]] command from cron daily to get an interlinked + set of calendar archives. diff --git a/doc/ikiwiki-calendar.mdwn b/doc/ikiwiki-calendar.mdwn new file mode 100644 index 000000000..e2cc612f3 --- /dev/null +++ b/doc/ikiwiki-calendar.mdwn @@ -0,0 +1,51 @@ +# NAME + +ikiwiki-calendar - create calendar archive pages + +# SYNOPSIS + +ikiwiki-calendar [-f] your.setup [pagespec] [year] + +# DESCRIPTION + +`ikiwiki-calendar` creates pages that use the [[ikiwiki/directive/calendar]] +directive, allowing the archives to be browsed one month +at a time, with calendar-based navigation. + +You must specify the setup file for your wiki. The pages will +be created inside its `srcdir`, beneath the `archivebase` +directory used by the calendar plugin (default "archives"). + +You will probably want to specify a [[ikiwiki/PageSpec]] +to control which pages are included on the calendars. The +default is all pages. To limit it to only posts in a blog, +use something like "posts/* and !*/Discussion". + +It defaults to creating calendar pages for the current +year, as well as the previous year, and the next year. +If you specify a year, it will create pages for that year. + +Existing pages will not be overwritten by this command by default. +Use the `-f` switch to force it to overwrite any existing pages. + +## CRONTAB + +While this command only needs to be run once a year to update +the archive pages for each new year, you are recommended to set up +a cron job to run it daily, at midnight. Then it will also update +the calendars to highlight the current day. + +An example crontab: + + 0 0 * * * ikiwiki-calendar ~/ikiwiki.setup "posts/* and !*/Discussion" + +# TEMPLATES + +This command uses two [[template|wikitemplates]] to generate +the pages, `calendarmonth.tmpl` and `calendaryear.tmpl`. + +# AUTHOR + +Joey Hess + +Warning: this page is automatically made into ikiwiki-calendar's man page, edit with care diff --git a/doc/ikiwiki/directive/calendar.mdwn b/doc/ikiwiki/directive/calendar.mdwn index 8a257d6eb..b2ac75b11 100644 --- a/doc/ikiwiki/directive/calendar.mdwn +++ b/doc/ikiwiki/directive/calendar.mdwn @@ -1,5 +1,4 @@ The `calendar` directive is supplied by the [[!iki plugins/calendar desc=calendar]] plugin. -This plugin requires extra setup. See the plugin documentation for details. This directive displays a calendar, similar to the typical calendars shown on some blogs. @@ -12,16 +11,28 @@ some blogs. \[[!calendar type="year" year="2005" pages="blog/* and !*/Discussion"]] +## setup + The calendar is essentially a fancy front end to archives of previous pages, usually used for blogs. It can produce a calendar for a given month, -or a list of months for a given year. - -The month format calendar simply links to any page posted on each -day of the month. The year format calendar links to archive pages, with -names like `archives/2007` (for all of 2007) and `archives/2007/01` -(for January, 2007). For this to work, you'll need to create these archive -pages. They typically use [[inline]] to display or list pages created in -the given time frame. +or a list of months for a given year. The month format calendar simply +links to any page posted on each day of the month. The year format calendar +links to archive pages, with names like `archives/2007` (for all of 2007) +and `archives/2007/01` (for January, 2007). + +While you can insert calendar directives anywhere on your wiki, including +in the sidebar, you'll also need to create these archive pages. They +typically use this directive to display a calendar, and also use [[inline]] +to display or list pages created in the given time frame. + +The `ikiwiki-calendar` command can be used to automatically generate the +archive pages. It also refreshes the wiki, updating the calendars to +highlight the current day. This command is typically run at midnight from +cron. An example crontab: + +An example crontab: + + 0 0 * * * ikiwiki-calendar ~/ikiwiki.setup "posts/* and !*/Discussion" ## usage diff --git a/doc/plugins/calendar.mdwn b/doc/plugins/calendar.mdwn index 8ade70004..bc1bc6c71 100644 --- a/doc/plugins/calendar.mdwn +++ b/doc/plugins/calendar.mdwn @@ -3,13 +3,9 @@ This plugin provides a [[ikiwiki/directive/calendar]] [[ikiwiki/directive]]. The directive displays a calendar, similar to the typical calendars shown on -some blogs. +some blogs. -Since ikiwiki is a wiki compiler, to keep the calendar up-to-date, -wikis that include it need to be periodically refreshed, typically by cron -at midnight. Example crontab: - - 0 0 * * * ikiwiki -setup ~/ikiwiki.setup -refresh +The [[ikiwiki-calendar]] command is used to keep the calendar up-to-date. ## CSS diff --git a/ikiwiki-calendar b/ikiwiki-calendar new file mode 100755 index 000000000..ec572cb7c --- /dev/null +++ b/ikiwiki-calendar @@ -0,0 +1,59 @@ +#!/usr/bin/perl +use warnings; +use strict; +use IkiWiki; +use IkiWiki::Setup; +use Getopt::Long; + +sub usage () { + die gettext("usage: ikiwiki-calendar [-f] your.setup [pagespec] [year]"), "\n"; +} + +my $force=0; +GetOptions( + "force" => \$force, +) || usage(); +my $setup=shift || usage(); +my $pagespec=shift || "*"; +my $year=shift || 1900+(localtime(time))[5]; + +%config=IkiWiki::defaultconfig(); +IkiWiki::Setup::load($setup); +IkiWiki::loadplugins(); +IkiWiki::checkconfig(); + +my $archivebase = 'archives'; +$archivebase = $config{archivebase} if defined $config{archivebase}; + +sub writearchive ($$;$) { + my $template=template(shift); + my $year=shift; + my $month=shift; + + my $page=defined $month ? "$year/$month" : $year; + + my $pagefile=newpagefile("$archivebase/$page", $config{default_pageext}); + $template->param(pagespec => $pagespec); + $template->param(year => $year); + $template->param(month => $month) if defined $month; + + if ($force || ! -e "$config{srcdir}/$pagefile") { + writefile($pagefile, $config{srcdir}, $template->output); + IkiWiki::rcs_add($pagefile) if $config{rcs}; + } +} + +IkiWiki::lockwiki(); + +foreach my $y ($year-1, $year, $year+1) { + writearchive("calendaryear.tmpl", $y); + foreach my $m (qw{01 02 03 04 05 06 07 08 09 10 11 12}) { + writearchive("calendarmonth.tmpl", $y, $m); + } +} + +IkiWiki::rcs_commit_staged(gettext("calendar update"), undef, undef) + if $config{rcs}; +IkiWiki::unlockwiki(); + +system("ikiwiki", "-setup", $setup, "-refresh"); diff --git a/templates/calendarmonth.tmpl b/templates/calendarmonth.tmpl new file mode 100644 index 000000000..37ad78c5c --- /dev/null +++ b/templates/calendarmonth.tmpl @@ -0,0 +1,3 @@ +[[!calendar type=month month= year= pages=""]] + +[[!inline pages="creation_month() and creation_year() and " show=0 feeds=no reverse=yes]] diff --git a/templates/calendaryear.tmpl b/templates/calendaryear.tmpl new file mode 100644 index 000000000..714bd6d47 --- /dev/null +++ b/templates/calendaryear.tmpl @@ -0,0 +1 @@ +[[!calendar type=year year= pages=""]] -- cgit v1.2.3 From cf29a980bd5486ca70927c35acc0bdc809d4e11f Mon Sep 17 00:00:00 2001 From: testerinchen Date: Wed, 2 Dec 2009 13:09:59 -0500 Subject: --- doc/examples/softwaresite/bugs/needs_more_bugs.mdwn | 1 + 1 file changed, 1 insertion(+) (limited to 'doc/examples') diff --git a/doc/examples/softwaresite/bugs/needs_more_bugs.mdwn b/doc/examples/softwaresite/bugs/needs_more_bugs.mdwn index a150570a4..6627ac0b9 100644 --- a/doc/examples/softwaresite/bugs/needs_more_bugs.mdwn +++ b/doc/examples/softwaresite/bugs/needs_more_bugs.mdwn @@ -1,3 +1,4 @@ FooBar does not have enough bugs, which suggests that it's not a real Free Software project. Please help create more bugs by adding code to FooBar! :-) +And what now? -- cgit v1.2.3 From 0a5b34b8e12d9e5e3d5e493d8eafa629a65e2a80 Mon Sep 17 00:00:00 2001 From: testerinchen Date: Wed, 2 Dec 2009 13:11:07 -0500 Subject: --- doc/examples/softwaresite/bugs/New_bug.mdwn | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/examples/softwaresite/bugs/New_bug.mdwn (limited to 'doc/examples') diff --git a/doc/examples/softwaresite/bugs/New_bug.mdwn b/doc/examples/softwaresite/bugs/New_bug.mdwn new file mode 100644 index 000000000..85f68d2b6 --- /dev/null +++ b/doc/examples/softwaresite/bugs/New_bug.mdwn @@ -0,0 +1 @@ +This is a new bug report! -- cgit v1.2.3 From 18320696aefad04ce1d2576219a83347516a5772 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 15 Dec 2009 15:05:21 -0500 Subject: declutter --- doc/examples/softwaresite/bugs/New_bug.mdwn | 1 - doc/examples/softwaresite/bugs/needs_more_bugs.mdwn | 1 - 2 files changed, 2 deletions(-) delete mode 100644 doc/examples/softwaresite/bugs/New_bug.mdwn (limited to 'doc/examples') diff --git a/doc/examples/softwaresite/bugs/New_bug.mdwn b/doc/examples/softwaresite/bugs/New_bug.mdwn deleted file mode 100644 index 85f68d2b6..000000000 --- a/doc/examples/softwaresite/bugs/New_bug.mdwn +++ /dev/null @@ -1 +0,0 @@ -This is a new bug report! diff --git a/doc/examples/softwaresite/bugs/needs_more_bugs.mdwn b/doc/examples/softwaresite/bugs/needs_more_bugs.mdwn index 6627ac0b9..a150570a4 100644 --- a/doc/examples/softwaresite/bugs/needs_more_bugs.mdwn +++ b/doc/examples/softwaresite/bugs/needs_more_bugs.mdwn @@ -1,4 +1,3 @@ FooBar does not have enough bugs, which suggests that it's not a real Free Software project. Please help create more bugs by adding code to FooBar! :-) -And what now? -- cgit v1.2.3 From 397fc5b2a3dff0ff3a105573f3b1fa5ea8169dfe Mon Sep 17 00:00:00 2001 From: Jon Dowland Date: Mon, 1 Mar 2010 13:16:54 +0000 Subject: ref new tip from softwaresite page --- doc/examples/softwaresite.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/examples') diff --git a/doc/examples/softwaresite.mdwn b/doc/examples/softwaresite.mdwn index e43a9d116..99f791177 100644 --- a/doc/examples/softwaresite.mdwn +++ b/doc/examples/softwaresite.mdwn @@ -14,3 +14,6 @@ Some additional configuration you might want to do: * Read the [[tips/integrated_issue_tracking_with_ikiwiki]] article for tips about how to use ikiwiki as a BTS. + +* Read [[tips/spam_and_softwaresites]] for information on how to keep spam + and spam-fighting commits out of your main version control history. -- cgit v1.2.3 From 6e7bfbe7bb8ba4b94d0e8c203b2117477b217384 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 28 Mar 2010 19:23:34 -0400 Subject: auto-blog.setup: Set tagbase by default, since most bloggers will want it. Also modified first_post page to use a tag format that will work whether or not tagbase is set. --- auto-blog.setup | 1 + debian/changelog | 1 + doc/examples/blog/posts/first_post.mdwn | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) (limited to 'doc/examples') diff --git a/auto-blog.setup b/auto-blog.setup index 7ff413187..95347167f 100644 --- a/auto-blog.setup +++ b/auto-blog.setup @@ -48,4 +48,5 @@ IkiWiki::Setup::Automator->import( blogspam_pagespec => "postcomment(*)", discussion => 0, locked_pages => "*", + tagbase => "tags", ) diff --git a/debian/changelog b/debian/changelog index 57406c6d3..2d82c4dba 100644 --- a/debian/changelog +++ b/debian/changelog @@ -21,6 +21,7 @@ ikiwiki (3.20100324) UNRELEASED; urgency=low that could lead to bad dependency handling in certian situations. * Add preprocessed 'use lib' line to ikiwiki-transition and ikiwiki-calendar if necessary for unusual install. + * auto-blog.setup: Set tagbase by default, since most bloggers will want it. -- Joey Hess Sat, 13 Mar 2010 14:48:10 -0500 diff --git a/doc/examples/blog/posts/first_post.mdwn b/doc/examples/blog/posts/first_post.mdwn index d49432341..7f814fbb1 100644 --- a/doc/examples/blog/posts/first_post.mdwn +++ b/doc/examples/blog/posts/first_post.mdwn @@ -1,4 +1,4 @@ This is the first post to this example blog. To add new posts, just add files to the posts/ subdirectory, or use the web form. -[[!tag tags/tech]] +[[!tag ./tags/tech]] -- cgit v1.2.3 From b6666f5ac81ef4c8646a6290cf5c885adf0e385f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 28 Mar 2010 19:28:48 -0400 Subject: fix tag Actually, tags can't be made to work with and w/o tagbase, so just make it assume tagbase is set. Better example anyway. (It'll be a broken link on ikiwiki.info though.) --- doc/examples/blog/posts/first_post.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/examples') diff --git a/doc/examples/blog/posts/first_post.mdwn b/doc/examples/blog/posts/first_post.mdwn index 7f814fbb1..f2729fcef 100644 --- a/doc/examples/blog/posts/first_post.mdwn +++ b/doc/examples/blog/posts/first_post.mdwn @@ -1,4 +1,4 @@ This is the first post to this example blog. To add new posts, just add files to the posts/ subdirectory, or use the web form. -[[!tag ./tags/tech]] +[[!tag tech]] -- cgit v1.2.3 From 81ce1cf9daf113c88581407d5e68d8f6ee61d674 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 15 Apr 2010 13:38:24 -0400 Subject: remove example comments_pagespec setting auto-blog.setup configures this automatically now --- doc/examples/blog.mdwn | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'doc/examples') diff --git a/doc/examples/blog.mdwn b/doc/examples/blog.mdwn index f542cad0c..b9b57b944 100644 --- a/doc/examples/blog.mdwn +++ b/doc/examples/blog.mdwn @@ -19,10 +19,8 @@ Some additional configuration you might want to do: * Enable the [[pagestats|plugins/pagestats]] plugin to get a tag cloud to display on the [[index]]. -* Enable the [[comments|plugins/comments]] plugin and configure it to - enable comments to posts to the blog: - - comments_pagespec => 'blog/posts/* and !*/Discussion', +* Enable the [[comments|plugins/comments]] plugin to + enable comments to posts to the blog. * Enable the [[calendar|plugins/calendar]] plugin and run the [[ikiwiki-calendar]] command from cron daily to get an interlinked -- cgit v1.2.3 From fe733e2a424f50227e4a501c3efbf1ce43e07352 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 15 Apr 2010 14:29:14 -0400 Subject: enhance pagestats and rework example blog front page * pagestats: Class parameter can be used to override default class for custom styling. * pagestats: Use style=list to get a list of tags, scaled by use like in a tag cloud. This is useful to put in a sidebar. * Rework example blog front page. --- IkiWiki/Plugin/pagestats.pm | 21 ++++++++++++++++++--- debian/changelog | 5 +++++ doc/examples/blog/archives.mdwn | 7 +++++++ doc/examples/blog/comments.mdwn | 2 +- doc/examples/blog/index.mdwn | 12 ++++++++---- doc/ikiwiki/directive/pagestats.mdwn | 11 ++++++++++- 6 files changed, 49 insertions(+), 9 deletions(-) create mode 100644 doc/examples/blog/archives.mdwn (limited to 'doc/examples') diff --git a/IkiWiki/Plugin/pagestats.pm b/IkiWiki/Plugin/pagestats.pm index 1c0b46830..48715bd3e 100644 --- a/IkiWiki/Plugin/pagestats.pm +++ b/IkiWiki/Plugin/pagestats.pm @@ -75,7 +75,7 @@ sub preprocess (@) { } if ($style eq 'table') { - return "\n". + return "
\n". join("\n", map { "
". htmllink($params{page}, $params{destpage}, $_, noimageinline => 1). @@ -87,16 +87,31 @@ sub preprocess (@) { else { # In case of misspelling, default to a page cloud - my $res = "
\n"; + my $res; + if ($style eq 'list') { + $res = "
    \n"; + } + else { + $res = "
    \n"; + } foreach my $page (sort keys %counts) { next unless $counts{$page} > 0; my $class = $classes[$counts{$page} * scalar(@classes) / ($max + 1)]; + + $res.="
  • " if $style eq 'list'; $res .= "". htmllink($params{page}, $params{destpage}, $page). "\n"; + $res.="
  • " if $style eq 'list'; + + } + if ($style eq 'list') { + $res = "
\n"; + } + else { + $res .= "
\n"; } - $res .= "\n"; return $res; } diff --git a/debian/changelog b/debian/changelog index 7c607b2a5..c2b0c3c23 100644 --- a/debian/changelog +++ b/debian/changelog @@ -31,6 +31,11 @@ ikiwiki (3.20100410) UNRELEASED; urgency=low specify which pages to include on the calendar archive pages. (The pagespec can still also be specified on the ikiwiki-calendar command line.) + * pagestats: Class parameter can be used to override default class for + custom styling. + * pagestats: Use style=list to get a list of tags, scaled by use like + in a tag cloud. This is useful to put in a sidebar. + * Rework example blog front page. -- Joey Hess Sun, 04 Apr 2010 12:17:11 -0400 diff --git a/doc/examples/blog/archives.mdwn b/doc/examples/blog/archives.mdwn new file mode 100644 index 000000000..14686cdfe --- /dev/null +++ b/doc/examples/blog/archives.mdwn @@ -0,0 +1,7 @@ +[[!if test="enabled(calendar)" then=""" +Browse through blog archives by year: +[[!map pages="./archives/* and !./archives/*/* and !*/Discussion"]] +""" +else=""" +Calendar based archives are not enabled. See [[posts]] for a full list of posts. +"""]] diff --git a/doc/examples/blog/comments.mdwn b/doc/examples/blog/comments.mdwn index 4735dea08..0b503ba01 100644 --- a/doc/examples/blog/comments.mdwn +++ b/doc/examples/blog/comments.mdwn @@ -1,3 +1,3 @@ -This page will show all comments made to posts in my [[blog|index]]. +This page will show recent comments made to posts in the [[blog|index]]. [[!inline pages="./posts/*/Discussion or internal(./posts/*/comment_*)"]] diff --git a/doc/examples/blog/index.mdwn b/doc/examples/blog/index.mdwn index 01b714fcd..b273ba1a9 100644 --- a/doc/examples/blog/index.mdwn +++ b/doc/examples/blog/index.mdwn @@ -1,9 +1,13 @@ -[[!pagestats pages="./tags/*" among="./posts/*"]] +[[!template id=note text=""" -Welcome to my blog. +* [[Tags]]: [[!pagestats style="list" pages="./tags/*" among="./posts/*"]] +* [[Recent_Comments|comments]] +* [[Archives]] -Have a look at the most recent posts below, or browse the tag cloud on the -right. Archives of all [[posts]] and all [[comments]] are also available. +[[!if test="enabled(calendar)" then=""" +[[!calendar pages="./posts/* and !*/Discussion"]] + +"""]] [[!inline pages="./posts/* and !*/Discussion" show="10" actions=yes rootpage="posts"]] diff --git a/doc/ikiwiki/directive/pagestats.mdwn b/doc/ikiwiki/directive/pagestats.mdwn index 68f4d2734..d0e0e7be7 100644 --- a/doc/ikiwiki/directive/pagestats.mdwn +++ b/doc/ikiwiki/directive/pagestats.mdwn @@ -4,10 +4,16 @@ This directive can generate stats about how pages link to each other. It can produce either a tag cloud, or a table counting the number of links to each page. -Here's how to use it to create a [[tag]] cloud: +Here's how to use it to create a [[tag]] cloud, with tags sized based +on frequency of use: \[[!pagestats pages="tags/*"]] +Here's how to create a list of tags, sized by use as they would be in a +cloud. + + \[[!pagestats style="list" pages="tags/*"]] + And here's how to create a table of all the pages on the wiki: \[[!pagestats style="table"]] @@ -28,4 +34,7 @@ links: \[[!pagestats style="table" show="10"]] +The optional `class` parameter can be used to control the class +of the generated tag cloud `div` or page stats `table`. + [[!meta robots="noindex, follow"]] -- cgit v1.2.3 From baaa848f6c06b0b3a59677d3551e130c65e5fde7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 15 Apr 2010 15:04:17 -0400 Subject: CSS and templates for sidebar changed to use a class, not an id. Multiple sidebars should be possible; also, I want to add a sidebar template. --- debian/changelog | 3 ++- doc/examples/blog.mdwn | 2 +- doc/examples/blog/index.mdwn | 1 - doc/examples/blog/sidebar.mdwn | 7 ------- doc/style.css | 2 +- templates/page.tmpl | 2 +- 6 files changed, 5 insertions(+), 12 deletions(-) delete mode 100644 doc/examples/blog/sidebar.mdwn (limited to 'doc/examples') diff --git a/debian/changelog b/debian/changelog index c2b0c3c23..03361e6a0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -ikiwiki (3.20100410) UNRELEASED; urgency=low +ikiwiki (3.20100415) UNRELEASED; urgency=low [ Joey Hess ] * bzr: Fix bzr log parsing to work with bzr 2.0. (liw) @@ -36,6 +36,7 @@ ikiwiki (3.20100410) UNRELEASED; urgency=low * pagestats: Use style=list to get a list of tags, scaled by use like in a tag cloud. This is useful to put in a sidebar. * Rework example blog front page. + * CSS and templates for sidebar changed to use a class, not an id. -- Joey Hess Sun, 04 Apr 2010 12:17:11 -0400 diff --git a/doc/examples/blog.mdwn b/doc/examples/blog.mdwn index b9b57b944..33637e57d 100644 --- a/doc/examples/blog.mdwn +++ b/doc/examples/blog.mdwn @@ -14,7 +14,7 @@ Some additional configuration you might want to do: \[[!tag tags/life]] * Enable the [[sidebar|plugins/sidebar]] plugin to get a sidebar listing all - the categories you've tagged posts with. + the categories you've tagged posts with, and other navigation links. * Enable the [[pagestats|plugins/pagestats]] plugin to get a tag cloud to display on the [[index]]. diff --git a/doc/examples/blog/index.mdwn b/doc/examples/blog/index.mdwn index b273ba1a9..da95e7660 100644 --- a/doc/examples/blog/index.mdwn +++ b/doc/examples/blog/index.mdwn @@ -4,7 +4,6 @@ * [[Recent_Comments|comments]] * [[Archives]] -[[!if test="enabled(calendar)" then=""" [[!calendar pages="./posts/* and !*/Discussion"]] """]] diff --git a/doc/examples/blog/sidebar.mdwn b/doc/examples/blog/sidebar.mdwn deleted file mode 100644 index a9fac388e..000000000 --- a/doc/examples/blog/sidebar.mdwn +++ /dev/null @@ -1,7 +0,0 @@ -Example sidebar - -* [[Blog|index]] -* [[Archive|posts]] - -Categories: -[[!map pages="./tags/* and !*/Discussion"]] diff --git a/doc/style.css b/doc/style.css index 317d4c7aa..af0fc230c 100644 --- a/doc/style.css +++ b/doc/style.css @@ -228,7 +228,7 @@ div.recentchanges { .bigPC { font-size: 115%; } .biggestPC { font-size: 130%; } -#sidebar { +.sidebar { line-height: 3ex; width: 20ex; float: right; diff --git a/templates/page.tmpl b/templates/page.tmpl index c24f88823..7e850a56b 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -92,7 +92,7 @@ -