Hello,
I have modified xdocs/stylesheets/site.vsl so that <meta> elements in
the XML file are translated into meta tags in the HTML header. This is
useful for example to add keyword meta tags which make it easy for
search engines to categorize the page.
The addition is very simple and consists of the printMeta macro and an
iteration on all meta elements in $root. It's nothing much, possibly
buggy and most definitely not as elegant as it should be. (I know very
little about velocity and even less about anakia.)
I have not applied the patch pending approval. Regards, Ceki
Index: xdocs/stylesheets/site.vsl
===================================================================
RCS file: /home/cvs/jakarta-site2/xdocs/stylesheets/site.vsl,v
retrieving revision 1.23
diff -u -r1.23 site.vsl
--- xdocs/stylesheets/site.vsl 4 Jan 2002 12:38:37 -0000 1.23
+++ xdocs/stylesheets/site.vsl 28 Jan 2002 13:53:52 -0000
@@ -215,6 +215,11 @@
#end
#end
+#macro (printMeta $metaElement)
+<meta #set ($attribs = $metaElement.getAttributes())
+#foreach ($a in $attribs) $a.getName()="$a.getValue()" #end />
+#end
+
#macro (document)
<!-- ====================================================================== -->
<!-- Main Page Section -->
@@ -228,6 +233,12 @@
#metaauthor ( $au.getText() $au.getAttributeValue("email") )
#end
+ #set ($metas = $root.getChildren("meta"))
+
+ ## Parse meta directives such as
+ ## <meta name="keyword" content="jakarta, java"/>
+ #foreach ($meta in $metas) #printMeta($meta) #end
+
<title>$project.getChild("title").getText() -
$root.getChild("properties").getChild("title").getText()</title>
</head>
@@ -269,3 +280,8 @@
</body>
</html>
#end
+
+
+
+
+
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>