From 638cef639d97ff9065e8a05f1a7923c0d51d6de4 Mon Sep 17 00:00:00 2001 From: simonraven Date: Sun, 29 Mar 2009 01:28:16 -0400 Subject: minor formatting tweaks --- doc/tips/github.mdwn | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'doc/tips') diff --git a/doc/tips/github.mdwn b/doc/tips/github.mdwn index 974d572f1..0a76166ee 100644 --- a/doc/tips/github.mdwn +++ b/doc/tips/github.mdwn @@ -26,16 +26,16 @@ for more space, or you can migrate your site elsewhere. ## local setup * On your laptop, create two empty git repositories to correspond to the - github repositories: - YOU=# your github username here - mkdir ~/$YOU.github.com - cd ~/$YOU.github.com - git init - git remote add origin git@github.com:$YOU/$YOU.github.com.git - mkdir ~/$YOU - cd ~/$YOU - git init - git remote add origin git@github.com:$YOU/$YOU.git + github repositories:
+ `YOU = your github username here`
+ `mkdir ~/$YOU.github.com`
+ `cd ~/$YOU.github.com`
+ `git init`
+ `git remote add origin git@github.com:$YOU/$YOU.github.com.git`
+ `mkdir ~/$YOU`
+ `cd ~/$YOU`
+ `git init`
+ `git remote add origin git@github.com:$YOU/$YOU.git`
* Add some wiki pages, such as an `index.mdwn`, to `~/$YOU`, and check them in and commit them to git. You need something to push to github. Run `git push origin master` to push the source pages to github. -- cgit v1.2.3 From d9364685baf6f35af44a658ab93206afa8397c6d Mon Sep 17 00:00:00 2001 From: simonraven Date: Sun, 29 Mar 2009 01:33:40 -0400 Subject: bit more tweakiness --- doc/tips/github.mdwn | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) (limited to 'doc/tips') diff --git a/doc/tips/github.mdwn b/doc/tips/github.mdwn index 0a76166ee..c3fdab734 100644 --- a/doc/tips/github.mdwn +++ b/doc/tips/github.mdwn @@ -11,22 +11,19 @@ two copies of the website in git (source and the compiled site), and all historical versions too. So it could happen. If it does, you can pay github for more space, or you can migrate your site elsewhere. -## github setup +## Github Setup -* Go to [github](http://github.com/) and sign up for an account, if you - haven't already. -* Be sure to add your laptop's ssh key to it so you can push - to github. -* Create a repository on githib named `$YOU.github.com`, substituting your - username. This repository will be used to publish your compiled website. +* Go to [github](http://github.com/) and sign up for an account, if you haven't already. +* Be sure to add your laptop's ssh key to it so you can push to github. +* Create a repository on github named `$YOU.github.com`, substituting your + *username*. This repository will be used to publish your compiled website. * Create a repository on github named `$YOU` (or anything else you like). This repository will be used to publish the source of your website. This is actually optional. -## local setup +## Local Setup -* On your laptop, create two empty git repositories to correspond to the - github repositories:
+* On your laptop, create two empty git repositories to correspond to the github repositories:
`YOU = your github username here`
`mkdir ~/$YOU.github.com`
`cd ~/$YOU.github.com`
@@ -40,22 +37,22 @@ for more space, or you can migrate your site elsewhere. in and commit them to git. You need something to push to github. Run `git push origin master` to push the source pages to github. -## publishing to github +## Publishing to Github -* Now build your wiki with a command such as: - ikiwiki ~/$YOU ~/$YOU.github.com --refresh +* Now build your wiki with a command such as:
+ `ikiwiki ~/$YOU ~/$YOU.github.com --refresh` * Each time you build the wiki you will need to commit the changes - to git, and push the compiled pages to github: - cd ~/YOU.github.com - git add . - git commit -a -m update - git push origin master + to git, and push the compiled pages to github:
+ `cd ~/YOU.github.com`
+ `git add .`
+ `git commit -a -m update`
+ `git push origin master`
Your wiki will show up at `http://$YOU.github.com/` within ten minutes after the first push, and changes you push to it from then on -should show up immediatly. +should show up immediately. -## enhancements +## Enhancements You can follow the instructions in [[laptop_wiki_with_git]] to set up an editable version of your wiki on your laptop. Then you can use the web -- cgit v1.2.3 From 2eb990b3f5496d271adb5b42ad393dc810700ba5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 10 Apr 2009 17:47:39 -0400 Subject: new tip --- doc/tips/add_twit_dent_box_to_blog.mdwn | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 doc/tips/add_twit_dent_box_to_blog.mdwn (limited to 'doc/tips') diff --git a/doc/tips/add_twit_dent_box_to_blog.mdwn b/doc/tips/add_twit_dent_box_to_blog.mdwn new file mode 100644 index 000000000..b7988532b --- /dev/null +++ b/doc/tips/add_twit_dent_box_to_blog.mdwn @@ -0,0 +1,17 @@ +If you use twitter or identi.ca, here's how to make a box +on the side of your blog that holds your recent status updates +from there, like I have on [my blog](http://kitenet.net/~joey/blog/) +--[[Joey]] + +* Enable the [[plugins/aggregate]] plugin, and set up a cron + job for it. +* At the top of your blog's page, add something like the following. + You'll want to change the urls of course. + + \[[!template id=note text=""" + \[[!aggregate expirecount=5 name="identi.ca posts" + feedurl="http://identi.ca/api/statuses/user_timeline/joeyh.atom" + url="http://identi.ca/joeyh"]] + \[[!inline pages="internal(identi.ca_posts/*)" archive=yes show=5 + quick=yes template=titlepage]] + """]] -- cgit v1.2.3 From 23b1d9d7b0351fbb46910eb17fc54ba35bc988e5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 10 Apr 2009 17:50:19 -0400 Subject: turn off quick quick makes the permalinks not be followed --- doc/tips/add_twit_dent_box_to_blog.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/tips') diff --git a/doc/tips/add_twit_dent_box_to_blog.mdwn b/doc/tips/add_twit_dent_box_to_blog.mdwn index b7988532b..1765d595a 100644 --- a/doc/tips/add_twit_dent_box_to_blog.mdwn +++ b/doc/tips/add_twit_dent_box_to_blog.mdwn @@ -13,5 +13,5 @@ from there, like I have on [my blog](http://kitenet.net/~joey/blog/) feedurl="http://identi.ca/api/statuses/user_timeline/joeyh.atom" url="http://identi.ca/joeyh"]] \[[!inline pages="internal(identi.ca_posts/*)" archive=yes show=5 - quick=yes template=titlepage]] + feeds=yes template=titlepage]] """]] -- cgit v1.2.3 From fbbb286046e2d5ba1e96598918c257987798b131 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 10 Apr 2009 17:54:50 -0400 Subject: update --- doc/tips/add_twit_dent_box_to_blog.mdwn | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'doc/tips') diff --git a/doc/tips/add_twit_dent_box_to_blog.mdwn b/doc/tips/add_twit_dent_box_to_blog.mdwn index 1765d595a..11245dfb1 100644 --- a/doc/tips/add_twit_dent_box_to_blog.mdwn +++ b/doc/tips/add_twit_dent_box_to_blog.mdwn @@ -9,9 +9,10 @@ from there, like I have on [my blog](http://kitenet.net/~joey/blog/) You'll want to change the urls of course. \[[!template id=note text=""" - \[[!aggregate expirecount=5 name="identi.ca posts" - feedurl="http://identi.ca/api/statuses/user_timeline/joeyh.atom" - url="http://identi.ca/joeyh"]] - \[[!inline pages="internal(identi.ca_posts/*)" archive=yes show=5 - feeds=yes template=titlepage]] + \[[!aggregate expirecount=5 name="dents" url="http://identi.ca/joeyh" + feedurl="http://identi.ca/api/statuses/user_timeline/joeyh.atom"]] + \[[!inline pages="internal(dents/*)" archive=yes show=5 feeds=no]] """]] + +For a cleaner look without the post dates, add `template=titlepage` +to the `inline` directive. -- cgit v1.2.3 From 808cba50d2c907d70578a0f1b66a2cadfacaecd8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 10 Apr 2009 17:55:33 -0400 Subject: formatting --- doc/tips/add_twit_dent_box_to_blog.mdwn | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'doc/tips') diff --git a/doc/tips/add_twit_dent_box_to_blog.mdwn b/doc/tips/add_twit_dent_box_to_blog.mdwn index 11245dfb1..387e2c236 100644 --- a/doc/tips/add_twit_dent_box_to_blog.mdwn +++ b/doc/tips/add_twit_dent_box_to_blog.mdwn @@ -8,10 +8,10 @@ from there, like I have on [my blog](http://kitenet.net/~joey/blog/) * At the top of your blog's page, add something like the following. You'll want to change the urls of course. - \[[!template id=note text=""" - \[[!aggregate expirecount=5 name="dents" url="http://identi.ca/joeyh" - feedurl="http://identi.ca/api/statuses/user_timeline/joeyh.atom"]] - \[[!inline pages="internal(dents/*)" archive=yes show=5 feeds=no]] + \[[!template id=note text=""" + \[[!aggregate expirecount=5 name="dents" url="http://identi.ca/joeyh" + feedurl="http://identi.ca/api/statuses/user_timeline/joeyh.atom"]] + \[[!inline pages="internal(dents/*)" archive=yes show=5 feeds=no]] """]] For a cleaner look without the post dates, add `template=titlepage` -- cgit v1.2.3 From 6ff199c80c47b3b87afb7c7b97a94b92eaf80482 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 10 Apr 2009 18:02:52 -0400 Subject: note --- doc/tips/add_twit_dent_box_to_blog.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/tips') diff --git a/doc/tips/add_twit_dent_box_to_blog.mdwn b/doc/tips/add_twit_dent_box_to_blog.mdwn index 387e2c236..ee5ead64b 100644 --- a/doc/tips/add_twit_dent_box_to_blog.mdwn +++ b/doc/tips/add_twit_dent_box_to_blog.mdwn @@ -16,3 +16,5 @@ from there, like I have on [my blog](http://kitenet.net/~joey/blog/) For a cleaner look without the post dates, add `template=titlepage` to the `inline` directive. + +Note: Works best with ikiwiki 3.10 or better. -- cgit v1.2.3 From e0d1e84b8db54338512ee1ca4b20817d4e338362 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 10 Apr 2009 21:44:25 -0400 Subject: better name --- doc/tips/add_chatterbox_to_blog.mdwn | 20 ++++++++++++++++++++ doc/tips/add_twit_dent_box_to_blog.mdwn | 20 -------------------- 2 files changed, 20 insertions(+), 20 deletions(-) create mode 100644 doc/tips/add_chatterbox_to_blog.mdwn delete mode 100644 doc/tips/add_twit_dent_box_to_blog.mdwn (limited to 'doc/tips') diff --git a/doc/tips/add_chatterbox_to_blog.mdwn b/doc/tips/add_chatterbox_to_blog.mdwn new file mode 100644 index 000000000..ee5ead64b --- /dev/null +++ b/doc/tips/add_chatterbox_to_blog.mdwn @@ -0,0 +1,20 @@ +If you use twitter or identi.ca, here's how to make a box +on the side of your blog that holds your recent status updates +from there, like I have on [my blog](http://kitenet.net/~joey/blog/) +--[[Joey]] + +* Enable the [[plugins/aggregate]] plugin, and set up a cron + job for it. +* At the top of your blog's page, add something like the following. + You'll want to change the urls of course. + + \[[!template id=note text=""" + \[[!aggregate expirecount=5 name="dents" url="http://identi.ca/joeyh" + feedurl="http://identi.ca/api/statuses/user_timeline/joeyh.atom"]] + \[[!inline pages="internal(dents/*)" archive=yes show=5 feeds=no]] + """]] + +For a cleaner look without the post dates, add `template=titlepage` +to the `inline` directive. + +Note: Works best with ikiwiki 3.10 or better. diff --git a/doc/tips/add_twit_dent_box_to_blog.mdwn b/doc/tips/add_twit_dent_box_to_blog.mdwn deleted file mode 100644 index ee5ead64b..000000000 --- a/doc/tips/add_twit_dent_box_to_blog.mdwn +++ /dev/null @@ -1,20 +0,0 @@ -If you use twitter or identi.ca, here's how to make a box -on the side of your blog that holds your recent status updates -from there, like I have on [my blog](http://kitenet.net/~joey/blog/) ---[[Joey]] - -* Enable the [[plugins/aggregate]] plugin, and set up a cron - job for it. -* At the top of your blog's page, add something like the following. - You'll want to change the urls of course. - - \[[!template id=note text=""" - \[[!aggregate expirecount=5 name="dents" url="http://identi.ca/joeyh" - feedurl="http://identi.ca/api/statuses/user_timeline/joeyh.atom"]] - \[[!inline pages="internal(dents/*)" archive=yes show=5 feeds=no]] - """]] - -For a cleaner look without the post dates, add `template=titlepage` -to the `inline` directive. - -Note: Works best with ikiwiki 3.10 or better. -- cgit v1.2.3 From b6eccfd3d38c95773bdfc8fdf1ecbc32094f353e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 11 Apr 2009 12:40:15 -0400 Subject: Add a microblog template that is useful for inlining microblogging posts. --- debian/changelog | 1 + doc/ikiwiki/directive/inline.mdwn | 3 ++- doc/style.css | 6 ++++-- doc/tips/add_chatterbox_to_blog.mdwn | 6 ++---- doc/wikitemplates.mdwn | 1 + templates/microblog.tmpl | 22 ++++++++++++++++++++++ 6 files changed, 32 insertions(+), 7 deletions(-) create mode 100644 templates/microblog.tmpl (limited to 'doc/tips') diff --git a/debian/changelog b/debian/changelog index b7779600e..51b5121fb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,7 @@ ikiwiki (3.10) UNRELEASED; urgency=low * Add missing permalink support to archivepage and titlepage templates. * debian/control: Wrap fields. * inline: Add author info to archive display. + * Add a microblog template that is useful for inlining microblogging posts. -- Joey Hess Sat, 04 Apr 2009 17:47:36 -0400 diff --git a/doc/ikiwiki/directive/inline.mdwn b/doc/ikiwiki/directive/inline.mdwn index f69d55de3..8afd65a05 100644 --- a/doc/ikiwiki/directive/inline.mdwn +++ b/doc/ikiwiki/directive/inline.mdwn @@ -79,7 +79,8 @@ Here are some less often needed parameters: page. By default the `inlinepage` template is used, while the `archivepage` template is used for archives. Set this parameter to use some other, custom template, such as the `titlepage` template that - only shows post titles. Note that you should still set `archive=yes` if + only shows post titles or the `microblog` template, optimised for + microblogging. Note that you should still set `archive=yes` if your custom template does not include the page content. * `raw` - Rather than the default behavior of creating a blog, if raw is set to "yes", the page will be included raw, without additional diff --git a/doc/style.css b/doc/style.css index 98a28f347..74d968ddf 100644 --- a/doc/style.css +++ b/doc/style.css @@ -373,11 +373,13 @@ span.color { padding: 2px; } -.comment-header { +.comment-header, +.microblog-header { font-style: italic; margin-top: .3em; } -.comment .author { +.comment .author, +.microblog .author { font-weight: bold; } .comment-subject { diff --git a/doc/tips/add_chatterbox_to_blog.mdwn b/doc/tips/add_chatterbox_to_blog.mdwn index ee5ead64b..3497da9ff 100644 --- a/doc/tips/add_chatterbox_to_blog.mdwn +++ b/doc/tips/add_chatterbox_to_blog.mdwn @@ -11,10 +11,8 @@ from there, like I have on [my blog](http://kitenet.net/~joey/blog/) \[[!template id=note text=""" \[[!aggregate expirecount=5 name="dents" url="http://identi.ca/joeyh" feedurl="http://identi.ca/api/statuses/user_timeline/joeyh.atom"]] - \[[!inline pages="internal(dents/*)" archive=yes show=5 feeds=no]] + \[[!inline pages="internal(dents/*)" template=microblog + show=5 feeds=no]] """]] -For a cleaner look without the post dates, add `template=titlepage` -to the `inline` directive. - Note: Works best with ikiwiki 3.10 or better. diff --git a/doc/wikitemplates.mdwn b/doc/wikitemplates.mdwn index fc5893677..f365cd5aa 100644 --- a/doc/wikitemplates.mdwn +++ b/doc/wikitemplates.mdwn @@ -21,6 +21,7 @@ located in /usr/share/ikiwiki/templates by default. * `inlinepage.tmpl` - Used for adding a page inline in a blog page. * `archivepage.tmpl` - Used for listing a page in a blog archive page. +* `microblog.tmpl` - Used for showing a microblogging post inline. * `blogpost.tmpl` - Used for a form to add a post to a blog (and a rss/atom links) * `feedlink.tmpl` - Used to add rss/atom links if blogpost.tmpl is not used. * `aggregatepost.tmpl` - Used by the [[plugins/aggregate]] plugin to create diff --git a/templates/microblog.tmpl b/templates/microblog.tmpl new file mode 100644 index 000000000..2e84441cc --- /dev/null +++ b/templates/microblog.tmpl @@ -0,0 +1,22 @@ +
+ +
+ +
+ +
+ + + + + + + + + + + +— + +
+
-- cgit v1.2.3 From 8ed4d3ab1500aa3893adc385e68b5633b76150ce Mon Sep 17 00:00:00 2001 From: simonraven Date: Sun, 12 Apr 2009 06:07:59 -0400 Subject: --- .../Importing_posts_from_Wordpress/discussion.mdwn | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'doc/tips') diff --git a/doc/tips/Importing_posts_from_Wordpress/discussion.mdwn b/doc/tips/Importing_posts_from_Wordpress/discussion.mdwn index 3b328649e..d70e8e077 100644 --- a/doc/tips/Importing_posts_from_Wordpress/discussion.mdwn +++ b/doc/tips/Importing_posts_from_Wordpress/discussion.mdwn @@ -2,3 +2,22 @@ When I attempt to use this script, I get the following error: warning: Not updating refs/heads/master (new tip 26b1787fca04f2f9772b6854843fe99fe06e6088 does not contain fc0ad65d14d88fd27a6cee74c7cef3176f6900ec). I have git 1.5.6.5, any ideas? Thanks!! + +----- + +I also get this error, here's the output (it seems to stem from an error in the python script): + +
+Traceback (most recent call last):
+  File "../ikiwiki-wordpress-import.py", line 74, in 
+    main(*sys.argv[1:])
+  File "../ikiwiki-wordpress-import.py", line 54, in main
+    data = content.encode('ascii', 'html_replace')
+  File "../ikiwiki-wordpress-import.py", line 30, in 
+    % htmlentitydefs.codepoint2name[ord(c)] for c in x.object[x.start:x.end]]), x.end))
+KeyError: 146
+warning: Not updating refs/heads/master (new tip 6dca6ac939e12966bd64ce8a822ef14fe60622b2 does not contain 60b798dbf92ec5ae92f18acac3075c4304aca120)
+git-fast-import statistics:
+
+ +etc. -- cgit v1.2.3 From ca9563fda4ee0dbefab3572fc97e4aa056390168 Mon Sep 17 00:00:00 2001 From: simonraven Date: Sun, 12 Apr 2009 06:10:18 -0400 Subject: --- doc/tips/Importing_posts_from_Wordpress/discussion.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/tips') diff --git a/doc/tips/Importing_posts_from_Wordpress/discussion.mdwn b/doc/tips/Importing_posts_from_Wordpress/discussion.mdwn index d70e8e077..b61e7b24d 100644 --- a/doc/tips/Importing_posts_from_Wordpress/discussion.mdwn +++ b/doc/tips/Importing_posts_from_Wordpress/discussion.mdwn @@ -5,6 +5,8 @@ Thanks!! ----- +### KeyError: 146 + I also get this error, here's the output (it seems to stem from an error in the python script):
-- 
cgit v1.2.3


From f75b138447e828393a53db3bc4ee2960fdf93fa9 Mon Sep 17 00:00:00 2001
From: simonraven 
Date: Sun, 12 Apr 2009 06:16:11 -0400
Subject:

---
 doc/tips/Importing_posts_from_Wordpress/discussion.mdwn | 6 ++++++
 1 file changed, 6 insertions(+)

(limited to 'doc/tips')

diff --git a/doc/tips/Importing_posts_from_Wordpress/discussion.mdwn b/doc/tips/Importing_posts_from_Wordpress/discussion.mdwn
index b61e7b24d..ee977570f 100644
--- a/doc/tips/Importing_posts_from_Wordpress/discussion.mdwn
+++ b/doc/tips/Importing_posts_from_Wordpress/discussion.mdwn
@@ -23,3 +23,9 @@ git-fast-import statistics:
 
etc. + + +> Well, if this really is a script error, it's not really the script, but the wordpress XML dump, referring to a +> possible malformed or invalid unicode character in the dump file. This is what I can gather from other scripts. +> I'll be checking my dump file shortly. +> -- cgit v1.2.3 From a8b017e25f48776e23439b066f3d3dd9e1f12e24 Mon Sep 17 00:00:00 2001 From: simonraven Date: Sun, 12 Apr 2009 06:40:46 -0400 Subject: --- doc/tips/Importing_posts_from_Wordpress/discussion.mdwn | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'doc/tips') diff --git a/doc/tips/Importing_posts_from_Wordpress/discussion.mdwn b/doc/tips/Importing_posts_from_Wordpress/discussion.mdwn index ee977570f..8d009c01a 100644 --- a/doc/tips/Importing_posts_from_Wordpress/discussion.mdwn +++ b/doc/tips/Importing_posts_from_Wordpress/discussion.mdwn @@ -28,4 +28,7 @@ etc. > Well, if this really is a script error, it's not really the script, but the wordpress XML dump, referring to a > possible malformed or invalid unicode character in the dump file. This is what I can gather from other scripts. > I'll be checking my dump file shortly. -> + +>> Yup, it is the dump file with odd escape characters such as "fancy quotes" and crap like that. +>> translate them and you're golden. + -- cgit v1.2.3 From f67c714c5011684884e7fc8485278ab282aea8a3 Mon Sep 17 00:00:00 2001 From: simonraven Date: Sun, 12 Apr 2009 06:55:24 -0400 Subject: --- doc/tips/Importing_posts_from_Wordpress/discussion.mdwn | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'doc/tips') diff --git a/doc/tips/Importing_posts_from_Wordpress/discussion.mdwn b/doc/tips/Importing_posts_from_Wordpress/discussion.mdwn index 8d009c01a..9befe3f22 100644 --- a/doc/tips/Importing_posts_from_Wordpress/discussion.mdwn +++ b/doc/tips/Importing_posts_from_Wordpress/discussion.mdwn @@ -29,6 +29,5 @@ etc. > possible malformed or invalid unicode character in the dump file. This is what I can gather from other scripts. > I'll be checking my dump file shortly. ->> Yup, it is the dump file with odd escape characters such as "fancy quotes" and crap like that. ->> translate them and you're golden. +>> This is only part of the problem... I'm not exactly sure what's going on, and it's get late/early for me.... -- cgit v1.2.3 From 0feb3eda8259eb47bcd1df7e5e1a8f8d78aedd45 Mon Sep 17 00:00:00 2001 From: simonraven Date: Sun, 12 Apr 2009 20:16:10 -0400 Subject: --- doc/tips/Importing_posts_from_Wordpress/discussion.mdwn | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'doc/tips') diff --git a/doc/tips/Importing_posts_from_Wordpress/discussion.mdwn b/doc/tips/Importing_posts_from_Wordpress/discussion.mdwn index 9befe3f22..91f9a7d49 100644 --- a/doc/tips/Importing_posts_from_Wordpress/discussion.mdwn +++ b/doc/tips/Importing_posts_from_Wordpress/discussion.mdwn @@ -31,3 +31,11 @@ etc. >> This is only part of the problem... I'm not exactly sure what's going on, and it's get late/early for me.... +>>> I used --force for fast-import, but then everything seems deleted, so you end up doing a reset, checkout, add, *then* commit. +>>> Seems really odd. I edited the script however, maybe this is why... this is my changes: + + -print "data %d" % len(data) + +print "data %d merge refs/heads/%s" % (len(data), branch) + +>>> That control character is a ^q^0 in emacs, see git fast-import --help for more info. +>>> I'll be trying an import *without* that change, to see what happens. -- cgit v1.2.3 From c6981e20254fed5d22decb64d0be6760833cf4a2 Mon Sep 17 00:00:00 2001 From: simonraven Date: Sun, 12 Apr 2009 20:20:38 -0400 Subject: --- doc/tips/Importing_posts_from_Wordpress/discussion.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/tips') diff --git a/doc/tips/Importing_posts_from_Wordpress/discussion.mdwn b/doc/tips/Importing_posts_from_Wordpress/discussion.mdwn index 91f9a7d49..e39bfe5f0 100644 --- a/doc/tips/Importing_posts_from_Wordpress/discussion.mdwn +++ b/doc/tips/Importing_posts_from_Wordpress/discussion.mdwn @@ -39,3 +39,6 @@ etc. >>> That control character is a ^q^0 in emacs, see git fast-import --help for more info. >>> I'll be trying an import *without* that change, to see what happens. + +>>>> (5 minutes later) +>>>> Removing it makes it behave sanely. heh. Learned something new :). So ignore the comment just above, except for the --force part. You have to do that because fast-import assumes a clean uninitialized space. -- cgit v1.2.3 From 91031f7818a01bd468231420b5b40d6b50c916a0 Mon Sep 17 00:00:00 2001 From: simonraven Date: Mon, 13 Apr 2009 02:35:21 -0400 Subject: --- doc/tips/Importing_posts_from_Wordpress/discussion.mdwn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/tips') diff --git a/doc/tips/Importing_posts_from_Wordpress/discussion.mdwn b/doc/tips/Importing_posts_from_Wordpress/discussion.mdwn index e39bfe5f0..55e04d9cb 100644 --- a/doc/tips/Importing_posts_from_Wordpress/discussion.mdwn +++ b/doc/tips/Importing_posts_from_Wordpress/discussion.mdwn @@ -40,5 +40,5 @@ etc. >>> That control character is a ^q^0 in emacs, see git fast-import --help for more info. >>> I'll be trying an import *without* that change, to see what happens. ->>>> (5 minutes later) ->>>> Removing it makes it behave sanely. heh. Learned something new :). So ignore the comment just above, except for the --force part. You have to do that because fast-import assumes a clean uninitialized space. +>>>> I still have to do the above to preserve the changes done by this script... (removed previous note). + -- cgit v1.2.3 From 27d86954901011565105b160fb93cb64519d3d56 Mon Sep 17 00:00:00 2001 From: simonraven Date: Mon, 13 Apr 2009 14:55:27 -0400 Subject: --- .../ikiwiki-wordpress-import.mdwn | 111 +++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 doc/tips/importing_posts_from_wordpress/ikiwiki-wordpress-import.mdwn (limited to 'doc/tips') diff --git a/doc/tips/importing_posts_from_wordpress/ikiwiki-wordpress-import.mdwn b/doc/tips/importing_posts_from_wordpress/ikiwiki-wordpress-import.mdwn new file mode 100644 index 000000000..e2eb1320b --- /dev/null +++ b/doc/tips/importing_posts_from_wordpress/ikiwiki-wordpress-import.mdwn @@ -0,0 +1,111 @@ +I modified the script a bit so categories and tags would actually show up in the output file. + + +
+#!/usr/bin/env python
+
+"""
+    Purpose:
+    Wordpress-to-Ikiwiki import tool
+
+    Copyright:
+    Copyright (C) 2007  Chris Lamb 
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see .
+
+    Usage: run --help as an argument with this script.
+
+    Notes:
+    I added some extra bits to include the [[!tag foo]] stuff in the post,
+    as it wasn't before, at all. I'll diff the versions out so you can see
+    the mess I made :).
+
+"""
+
+import os, sys
+import time
+import re
+
+from BeautifulSoup import BeautifulSoup
+
+import codecs, htmlentitydefs
+
+codecs.register_error('html_replace', lambda x: (''.join([u'&%s;' \
+    % htmlentitydefs.codepoint2name[ord(c)] for c in x.object[x.start:x.end]]), x.end))
+
+def main(name, email, subdir, branch='master'):
+    soup = BeautifulSoup(sys.stdin.read())
+
+    # Regular expression to match stub in URL.
+    stub_pattern = re.compile(r'.*\/(.+)\/$')
+
+    for x in soup.findAll('item'):
+        # Ignore draft posts
+        if x.find('wp:status').string != 'publish': continue
+
+        match = stub_pattern.match(x.guid.string)
+        if match:
+            stub = match.groups()[0]
+        else:
+            # Fall back to our own stubs
+            stub = re.sub(r'[^a-zA-Z0-9_]', '-', x.title.string).lower()
+
+        commit_msg = """Importing WordPress post "%s" [%s]""" % (x.title.string, x.guid.string)
+        timestamp = time.mktime(time.strptime(x.find('wp:post_date_gmt').string, "%Y-%m-%d %H:%M:%S"))
+
+        content = '[[!meta title="%s"]]\n\n' % (x.title.string.replace('"', r'\"'))
+        content += x.find('content:encoded').string.replace('\r\n', '\n')
+
+        # categories = x.findAll('category')
+        # categories = x.findAll({'category':True}, attrs={'domain':re.compile(('category|tag'))})
+        # categories = x.findAll({'category':True}, domain=["category", "tag"])
+        # categories = x.findAll({'category':True}, nicename=True)
+        """
+        We do it differently here because we have duplicates otherwise.
+        Take a look:
+        
+	
+
+        If we do the what original did, we end up with all tags and cats doubled.
+        Therefore we only pick out nicename="foo". Our 'True' below is our 'foo'.
+        I'd much rather have the value of 'nicename', and tried, but my
+        python skillz are extremely limited....
+        """
+        categories = x.findAll('category', nicename=True)
+        if categories:
+            content += "\n"
+            for cat in categories:
+                # remove 'tags/' because we have a 'tagbase' set.
+                # your choice: 'tag', or 'taglink'
+                # content += "\n[[!tag %s]]" % (cat.string.replace(' ', '-'))
+                content += "\n[[!taglink %s]]" % (cat.string.replace(' ', '-'))
+                # print >>sys.stderr, cat.string.replace(' ', '-')
+
+        # moved this thing down
+        data = content.encode('ascii', 'html_replace')
+        print "commit refs/heads/%s" % branch
+        print "committer %s <%s> %d +0000" % (name, email, timestamp)
+        print "data %d" % len(commit_msg)
+        print commit_msg
+        print "M 644 inline %s" % os.path.join(subdir, "%s.mdwn" % stub)
+        print "data %d" % len(data)
+        print data
+
+if __name__ == "__main__":
+    if len(sys.argv) not in (4, 5):
+        print >>sys.stderr, "%s: usage: %s name email subdir [branch] < wordpress-export.xml | git-fast-import " % (sys.argv[0], sys.argv[0])
+    else:
+        main(*sys.argv[1:])
+
+
-- cgit v1.2.3 From b35951026d085b95bf04282ce8d6c738980cfdb4 Mon Sep 17 00:00:00 2001 From: simonraven Date: Mon, 13 Apr 2009 14:59:49 -0400 Subject: --- doc/tips/Importing_posts_from_Wordpress.mdwn | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'doc/tips') diff --git a/doc/tips/Importing_posts_from_Wordpress.mdwn b/doc/tips/Importing_posts_from_Wordpress.mdwn index 87ef12079..59330caa4 100644 --- a/doc/tips/Importing_posts_from_Wordpress.mdwn +++ b/doc/tips/Importing_posts_from_Wordpress.mdwn @@ -2,4 +2,12 @@ Use case: You want to move away from Wordpress to Ikiwiki as your blogging/websi [This](http://git.chris-lamb.co.uk/?p=ikiwiki-wordpress-import.git) is a simple tool that generates [git-fast-import](http://www.kernel.org/pub/software/scm/git/docs/git-fast-import.html)-compatible data from a WordPress export XML file. It retains creation time of each post, so you can use Ikiwiki's --getctime to get the preserve creation times on checkout. -WordPress categories are mapped onto Ikiwiki tags. The ability to import comments is planned. \ No newline at end of file +WordPress categories are mapped onto Ikiwiki tags. The ability to import comments is planned. + +----- + +I include a modified version of this script. This version includes the ability to write \[[!tag foo]] directives, which the original intended, but didn't actually do. + +-- [[users/simonraven]] + +[[ikiwiki-wordpress-import]] -- cgit v1.2.3 From 79fd3c9733ae8169de9d41056b673d10f6832dcb Mon Sep 17 00:00:00 2001 From: simonraven Date: Mon, 13 Apr 2009 15:03:38 -0400 Subject: --- doc/tips/importing_posts_from_wordpress/ikiwiki-wordpress-import.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/tips') diff --git a/doc/tips/importing_posts_from_wordpress/ikiwiki-wordpress-import.mdwn b/doc/tips/importing_posts_from_wordpress/ikiwiki-wordpress-import.mdwn index e2eb1320b..5d7a266ec 100644 --- a/doc/tips/importing_posts_from_wordpress/ikiwiki-wordpress-import.mdwn +++ b/doc/tips/importing_posts_from_wordpress/ikiwiki-wordpress-import.mdwn @@ -1,3 +1,5 @@ +[[!meta title="ikiwiki-wordpress-import"]] + I modified the script a bit so categories and tags would actually show up in the output file. -- cgit v1.2.3 From 4f53b59df759d6efb8dcbbf943185599b9455aab Mon Sep 17 00:00:00 2001 From: "http://furicle.pip.verisignlabs.com/" Date: Thu, 16 Apr 2009 17:11:54 -0400 Subject: typo - but it bugged me... --- doc/tips/embedding_content.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/tips') diff --git a/doc/tips/embedding_content.mdwn b/doc/tips/embedding_content.mdwn index 142acd16e..bfe458a84 100644 --- a/doc/tips/embedding_content.mdwn +++ b/doc/tips/embedding_content.mdwn @@ -15,7 +15,7 @@ you'd better trust that site. And if ikiwiki lets you enter such html, it needs to trust you.) The [[plugins/htmlscrubber]] offers a different way around this problem. -You can configure it to skip scrubbing certian pages, so that content from +You can configure it to skip scrubbing certain pages, so that content from elsewhere can be embedded on those pages. Then use [[plugins/lockedit]] to limit who can edit those unscrubbed pages. -- cgit v1.2.3 From b2e4201349ed1f8c19e0bb51e392aaa213071889 Mon Sep 17 00:00:00 2001 From: simonraven Date: Sun, 19 Apr 2009 13:28:57 -0400 Subject: --- doc/tips/add_chatterbox_to_blog/discussion.mdwn | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 doc/tips/add_chatterbox_to_blog/discussion.mdwn (limited to 'doc/tips') diff --git a/doc/tips/add_chatterbox_to_blog/discussion.mdwn b/doc/tips/add_chatterbox_to_blog/discussion.mdwn new file mode 100644 index 000000000..531b919ec --- /dev/null +++ b/doc/tips/add_chatterbox_to_blog/discussion.mdwn @@ -0,0 +1,16 @@ +The example you gave looks a bit odd. + +This is what I did from your example (still trying to learn the more complex things ;). + +
+\[[!template id=note text="""
+\[[!aggregate expirecount=5 name=kijkaqawej url=http://identi.ca/kjikaqawej
+feedurl=http://identi.ca/api/statuses/user_timeline/kjikaqawej.atom]]
+\[[!inline pages="internal(kijkaqawej/*)" template=microblog show=5 feeds=no]] """]]
+
+ +mine, live, here: + +I expected something like: sidebar, with a number, and displaying them in the sidebar, but they don't display (similar to what you have on your blog). + +On the [[/ikwiki/pagespec]] page, it says "internal" pages aren't "first-class" wiki pages, so it's best not to directly display them, so how do you manage to display them? I'd like to display their name, and what they link to in the sidebar, or otherwise in the main body. -- cgit v1.2.3 From 48e369366e597edc1791cbd8cde92920cbe00eb7 Mon Sep 17 00:00:00 2001 From: simonraven Date: Sun, 19 Apr 2009 13:29:53 -0400 Subject: typo --- doc/tips/add_chatterbox_to_blog/discussion.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/tips') diff --git a/doc/tips/add_chatterbox_to_blog/discussion.mdwn b/doc/tips/add_chatterbox_to_blog/discussion.mdwn index 531b919ec..b448cf3b8 100644 --- a/doc/tips/add_chatterbox_to_blog/discussion.mdwn +++ b/doc/tips/add_chatterbox_to_blog/discussion.mdwn @@ -13,4 +13,4 @@ mine, live, here: I expected something like: sidebar, with a number, and displaying them in the sidebar, but they don't display (similar to what you have on your blog). -On the [[/ikwiki/pagespec]] page, it says "internal" pages aren't "first-class" wiki pages, so it's best not to directly display them, so how do you manage to display them? I'd like to display their name, and what they link to in the sidebar, or otherwise in the main body. +On the [[/ikiwiki/pagespec]] page, it says "internal" pages aren't "first-class" wiki pages, so it's best not to directly display them, so how do you manage to display them? I'd like to display their name, and what they link to in the sidebar, or otherwise in the main body. -- cgit v1.2.3 From 4e935d300ed0bda37a44e1da85aff797f0aeda8f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 19 Apr 2009 15:19:43 -0400 Subject: clarification, response --- doc/tips/add_chatterbox_to_blog.mdwn | 7 +++++-- doc/tips/add_chatterbox_to_blog/discussion.mdwn | 6 ++++++ 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'doc/tips') diff --git a/doc/tips/add_chatterbox_to_blog.mdwn b/doc/tips/add_chatterbox_to_blog.mdwn index 3497da9ff..aa35b9331 100644 --- a/doc/tips/add_chatterbox_to_blog.mdwn +++ b/doc/tips/add_chatterbox_to_blog.mdwn @@ -6,12 +6,15 @@ from there, like I have on [my blog](http://kitenet.net/~joey/blog/) * Enable the [[plugins/aggregate]] plugin, and set up a cron job for it. * At the top of your blog's page, add something like the following. - You'll want to change the urls of course. + You'll want to change the urls of course. Be sure to also change + the inline directive's [[PageSpec]] to link to the location the + feed is aggregated to, which will be a subpage of the page + you put this on (blog in this example): \[[!template id=note text=""" \[[!aggregate expirecount=5 name="dents" url="http://identi.ca/joeyh" feedurl="http://identi.ca/api/statuses/user_timeline/joeyh.atom"]] - \[[!inline pages="internal(dents/*)" template=microblog + \[[!inline pages="internal(./blog/dents/*)" template=microblog show=5 feeds=no]] """]] diff --git a/doc/tips/add_chatterbox_to_blog/discussion.mdwn b/doc/tips/add_chatterbox_to_blog/discussion.mdwn index b448cf3b8..57e4b76ad 100644 --- a/doc/tips/add_chatterbox_to_blog/discussion.mdwn +++ b/doc/tips/add_chatterbox_to_blog/discussion.mdwn @@ -14,3 +14,9 @@ mine, live, here: I expected something like: sidebar, with a number, and displaying them in the sidebar, but they don't display (similar to what you have on your blog). On the [[/ikiwiki/pagespec]] page, it says "internal" pages aren't "first-class" wiki pages, so it's best not to directly display them, so how do you manage to display them? I'd like to display their name, and what they link to in the sidebar, or otherwise in the main body. + +> That's what the inline does, displays the internal pages. +> +> You need to fix your pagespec to refer to where the pages are aggregated +> to, under the page that contains the aggregate directive. In your example, +> it should be `internal(./blog/meta/microblog-feed/kijkaqawej/*)` --[[Joey]] -- cgit v1.2.3 From 2cc3f5d057c5882e08d16746985c49a7dd1a4c01 Mon Sep 17 00:00:00 2001 From: simonraven Date: Mon, 20 Apr 2009 05:04:53 -0400 Subject: --- doc/tips/add_chatterbox_to_blog/discussion.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/tips') diff --git a/doc/tips/add_chatterbox_to_blog/discussion.mdwn b/doc/tips/add_chatterbox_to_blog/discussion.mdwn index 57e4b76ad..bf7c9b1c3 100644 --- a/doc/tips/add_chatterbox_to_blog/discussion.mdwn +++ b/doc/tips/add_chatterbox_to_blog/discussion.mdwn @@ -20,3 +20,6 @@ On the [[/ikiwiki/pagespec]] page, it says "internal" pages aren't "first-class" > You need to fix your pagespec to refer to where the pages are aggregated > to, under the page that contains the aggregate directive. In your example, > it should be `internal(./blog/meta/microblog-feed/kijkaqawej/*)` --[[Joey]] + +>> Oooh, I see, it's referring to an absolute path (relative to the site), right? +>> Thanks :). -- cgit v1.2.3