aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2012-03-03 12:16:00 -0400
committerJoey Hess <joey@kitenet.net>2012-03-03 12:16:00 -0400
commit77344163edef5e20f652c82c634e3aeac61d970a (patch)
treeaba7e8fc6ce46561875dd0da85fe49822d06193c
parent8125cfa45b38b653266d03e6106a918f64a7d225 (diff)
downloadikiwiki-77344163edef5e20f652c82c634e3aeac61d970a.tar
ikiwiki-77344163edef5e20f652c82c634e3aeac61d970a.tar.gz
add osm.png
Add an underlay for the osm plugin. Update links to right path to icon. Note that the osm plugin has a pervasive bug in how it links to icons; it assumes the site is at /. I did not attempt to fix that; it should be using urlto() to make a correct relative link.
-rw-r--r--IkiWiki/Plugin/osm.pm7
-rw-r--r--underlays/osm/ikiwiki/images/osm.pngbin0 -> 2982 bytes
2 files changed, 4 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/osm.pm b/IkiWiki/Plugin/osm.pm
index e47e83b07..0fd7ca400 100644
--- a/IkiWiki/Plugin/osm.pm
+++ b/IkiWiki/Plugin/osm.pm
@@ -10,6 +10,7 @@ use IkiWiki 3.0;
sub import {
add_underlay("javascript");
+ add_underlay("osm");
hook(type => "getsetup", id => "osm", call => \&getsetup);
hook(type => "format", id => "osm", call => \&format);
hook(type => "preprocess", id => "osm", call => \&preprocess);
@@ -34,7 +35,7 @@ sub getsetup () {
},
osm_default_icon => {
type => "string",
- example => "img/osm.png",
+ example => "/ikiwiki/images/osm.png",
description => "the icon shon on links and on the main map",
safe => 0,
rebuild => 1,
@@ -137,7 +138,7 @@ sub process_waypoint {
my $name = scrub($params{'name'} || $p, $page, $dest); # sanitized here
my $desc = scrub($params{'desc'} || '', $page, $dest); # sanitized here
my $zoom = scrub($params{'zoom'} // $config{'osm_default_zoom'} // 15, $page, $dest); # sanitized below
- my $icon = $config{'osm__default_icon'} || "img/osm.png"; # sanitized: we trust $config
+ my $icon = $config{'osm__default_icon'} || "/ikiwiki/images/osm.png"; # sanitized: we trust $config
my $map = scrub($params{'map'} || 'map', $page, $dest); # sanitized here
my $alt = $config{'osm_alt'} ? "alt=\"$config{'osm_alt'}\"" : ''; # sanitized: we trust $config
if ($zoom !~ /^\d\d?$/ || $zoom < 2 || $zoom > 18) {
@@ -169,7 +170,7 @@ sub process_waypoint {
}
}
}
- $icon = "/img/unknown.png" unless $icon;
+ $icon = "/ikiwiki/images/osm.png" unless $icon;
$tag = '' unless $tag;
if ($page eq $dest) {
if (!defined($config{'osm_format'}) || !$config{'osm_format'}) {
diff --git a/underlays/osm/ikiwiki/images/osm.png b/underlays/osm/ikiwiki/images/osm.png
new file mode 100644
index 000000000..487bf003c
--- /dev/null
+++ b/underlays/osm/ikiwiki/images/osm.png
Binary files differ