Translations of this page?:

Blogging with DokuWiki

:!: This page is a WORK IN PROGRESS! If you feel you can add to it please improve it where ever you see fit! :!:

Although blogging isn't the main purpose of DokuWiki, there are quite a large number of plugins available, which can turn DokuWiki into a full fledged blogging platform.

This page describes the steps necessary to get you started with blogging in DokuWiki. It also provides useful tips and hints about possible caveats.

Required Plugins

First of all you have to install a set of plugins. The basic blog setup consists of the blog, include and the pagelist plugin which represent the minimal install of the blog suite.

In addition to these there are the discussion, linkback, bloglinks, feedmod, avatar, and the tag to complete your blog setup.

Most of these plugins depend on each other. To help ease the setup process there's now the Blogsuite Bundle Hub. There you can decide about your desired blog setup and download one single archive which can be installed and updated via the pluginmanager.

Setup

Single-User

In this scenario we have only one single user who wants to use the blog plugin to create manage one blog. The configuration of the blog plugin lets you specify a namespace where all the blog entries will be stored. By default this is set to :blog which should be OK for most users.

To create the blog you have to decide which wiki page you'd like to use for the blog first and create it. If you want the blog to be the start page of the wiki this would be :start. After that you just have to add the blog plugin syntax to the page and save it.

{{blog>?5}}

The above will display the five latest entries in our blog. Since this is a single-user setup there's no need to specify a namespace in the plugin syntax, instead the default setting will be used. You should see a form now to add new blog entries. But before you add your first entry there's one configuration option left which needs to be set, nameley the dateprefix setting. It can be used to add the date the page was created to the page name of the new page. A good setting here is %Y:%m%d_. What happens here is that when you enter “my new blog” into the new entry form and press enter, the following page will created blog:2008:0512_my_new_blog. You see this comes quite in handy to keep your blog namespace organized.

In order to only allow read access to your blog to prevent people from editing your entries it also makes sense to add some ACL rules (the example assumes that you use the :start page for the blog listing).

start    @ALL 1
start    yourusername 16
blog:*   @ALL 1
blog:*   yourusername 16

Multi-User

In this scenario we want to allow different users to have their own blog. For that, each user needs his own blogging namespace and blog listing page where only he is allowed to create and edit pages. For this example we have three users named joey, walter and susi. Each user gets his own namespace below the :blog namespace and his own listing page. Therefore we have to setup the following ACL rules (example for the user joey):

blog:joey    @ALL 1
blog:joey:*  @ALL 1
blog:joey    joey 16
blog:joey:*  joey 16

Now you have to create the page :blog:joey and insert the following blog plugin syntax to setup the blog.

{{blog>blog:joey?5}}

Repeat that for all remaining users. After that they can start blogging by creating new entries with the new entry form.

Feed Setup

One of the most important things in a blog is its RSS feed. DokuWiki automatically creates all kind of feeds for you. But for a blog you may want to setup a specially tuned one.

Note: Since the new DokuWiki supports full HTML feeds it's no longer recommended to use the feed plugin to create the blog feed (it's still useful for discussion feeds and the like though).

Determine your feed URL

You will need some parameters to build your blog article feed. Most important is the ns parameter to limit the feed to your blog articles only. Remember not to use the blog frontpage for the feed because it will result in all your blog entries being included in one single feed item!

Here is a most basic example URL:

http://www.example.com/feed.php?ns=blog&num=10

You should also make sure it links to the most current version of your article. You can either set the default options to do so or pass it a long to the feed.php:

http://www.example.com/feed.php?ns=blog&num=10&linkto=current

You will most probably also enable DokuWikis full html feed:

http://www.example.com/feed.php?ns=blog&num=10&linkto=current&content=html

Nice feed URLs with .htaccess

If you have URL rewriting via .htaccess enabled you should also consider to add some custom rewrite rules to have nice feed URLs. The rewrite rule for the above example would look like this (just add it below the rule for the _export/ links):

RewriteRule ^_feed/(.*) feed.php?ns=$1&num=10&linkto=current&content=html [QSA,L]

Now you can access you blog feed with http://yourdomain.org/_feed/blog.

Autodiscovery

Browser can discover RSS feeds by certain HTML metadata. By default DokuWiki will provide this metadata for its standard feeds on its own. For a blogging page you might want to disable those feeds and only output your blog feed. This is done by editing your template's main.php. Here is an example head section:

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title><?php tpl_pagetitle()?> [<?php echo strip_tags($conf['title'])?>]</title>
 
  <?php tpl_metaheaders(false)?>
  <link rel="alternate" type="application/rss+xml" title="Blog" href="/feed.php?ns=blog&amp;linkto=page" />
</head>

Notice the parameter false being passed to the tpl_metaheaders function. This will suppress all default RSS autodiscovery tags.

Usage

Using Drafts

There are two different ways of dealing with unfinished blog entries in DokuWiki. You could for example setup a dedicated draft namespace where you store them, and at the time you finish them just create the blog entry and copy/paste the article. However, the blog plugin also supports drafts. To mark a blog entry as draft simply put ~~DRAFT~~ into the entry and save it. It will not show up in the blog listing unless you remove ~~DRAFT~~ from the page again. If you want to use this feature it's recommend to also install the feedmod plugin as it also removes drafts from the blog feed. Note: Pages marked as draft with blog plugin still show up in search results!

Managing Comments

The discussion plugin provides an administration interface available in DokuWikis admin menu which allows you to close/open discussions and show/hide/delete comments.

Managing Linkbacks

The linkback plugin also provides an administration interface which allows you to delete linkbacks or enable/disable them for single pages.

Managing Tags

The latest tag plugin provides an administration interface which lets you rebuild the tag index.

Customization

FIXME

Displaying only the first section on the front page

Sometimes you don't want to show a full article on the front page because it is too long. To cut it off at a given line, just insert an empty H1 header. To make that work you also have to activate the firstseconly configuration option of the include plugin.

This is going to be a long post

====== ======

Here comes all the long post

Tuning the feed

DokuWikis default feed is not 100% suitable for blogging, like it will display the page name as title of the feed item instead of the first headline. To change that you can use the feedmod plugin. It will set the first headline of the blog entry as feed item title and also adds a footer which links to the discussion section, and displays the tags of the post. Furthermore you can add links to social bookmarking services by editing a footer template (for more information please refer to the feedmod plugin page).

Another simple way to add additional features to your feed is to use the Feedburner service. Register at their site, point them to your feed (See Determine your feed URL) and put the Feedburner feed into the autodiscovery tag. This will also move some server load from your site to the Feedburner services.

Dealing with SPAM

Comment SPAM is quite a problem these days. Luckily DokuWiki provides a number of anti spam plugins. Support for the captcha plugin is integrated into the discussion plugin. All you have to do is install it and set it up to your likings.

Caveats

Treat your filesystem carefully

FIXME

Tips

Fixing wrong timestamps

FIXME

Discussion

 
tips/blogging.txt · Last modified: 2008/10/14 17:43 by 129.119.90.69
 

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported

Imprint Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
WikiForumIRCBugsTranslate