Map TiddlyWeb URLs to your own custom URLs
Project description
tiddlywebplugins.urls
Map a custom URL to a default TiddlyWeb URL
Uses selector syntax for the custom URL (http://lukearno.com/projects/selector/)
Also lets you map a custom URL to any other URL, for use as a URL shortener
Usage:
to bring up a tiddlywiki at /wiki/foo, create a tiddler like follows:
title: /wiki/{bag_name:segment}
text: /bags/{{ bag_name }}/tiddlers.wiki
alternately:
title: /wiki/{bag_name:segment}
text: /recipes/edit_wiki/tiddlers.wiki
recipe (edit_wiki in this case): desc: policy: {“read”: [], “create”: [], “manage”: [], “write”: [], “owner”: null, “delete”: []}
/bags/system/tiddlers /bags/{{ bag_name }}/tiddlers
where bag_name can be any variable name.
Note that this does not support PUTs, so if the second example is used, you may be unable to PUT to the the recipe (unless you provide a default for bag_name).
To create a short link to google.com, you might do:
title: /google
text: http://www.google.com
If you want to redirect to an internal URL, you can also add the tag “redirect”:
title: /wiki/{user:segment}
tags: redirect
text: /recipes/{{ user }}/tiddlers.wiki
Please note: all urls are stored in a bag called “urls” by default. The name of this bag can be changed by adding “urls_bag” to tiddlywebconfig.py, but all tiddlers in the bag must be “url tiddlers” of the above format. If this bag doesn’t exists already, it will be created automatically.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file tiddlywebplugins.urls-0.2.tar.gz
.
File metadata
- Download URL: tiddlywebplugins.urls-0.2.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28c66d8f82c487ad1bd9dc29bcaed08b7f883b130ff8f43631214accffcc8867 |
|
MD5 | 993c717b951b23b0a631b485177bc966 |
|
BLAKE2b-256 | 3df30558020a7abfee24547e6fe81a0fb4f4fe3013a817bdda71b96b19b1d847 |