Enclose in <ul> to make it more consistent with other links.
Use the word "Homepage" as the link and only note the hostname
(think slashdot).
Also fix the handling of the legacy Url field
use CGI;
use POSIX;
use File::Basename;
+use URI;
use URI::Escape;
use HTML::Entities;
use Template;
$page_content{make_search_url} = sub { return &Packages::CGI::make_search_url(@_) };
$page_content{make_url} = sub { return &Packages::CGI::make_url(@_) };
+ $page_content{extract_host} = sub { my $uri = URI->new($_[0]);
+ my $host = $uri->host;
+ $host .= ':'.$uri->port if $uri->port != $uri->default_port;
+ return $host;
+ };
# needed to work around the limitations of the the FILTER syntax
$page_content{html_encode} = sub { return HTML::Entities::encode_entities(@_,'<>&"') };
$page_content{uri_escape} = sub { return URI::Escape::uri_escape(@_) };
[%- END -%]
[% url = page.get_newest('url');
- url = page.get_newest('homepage');
+ SET url = page.get_newest('homepage') IF page.get_newest('homepage');
IF url %]
<h3>External Resources:</h3>
-<p>Homepage: <a href="[% url | uri %]">[% url | html %]</a></p>
+<ul>
+<li><a href="[% url | uri %]">Homepage</a> [[% extract_host(url) %]]</li>
+</ul>
[% END %]
[% FOREACH sim IN similar %]