]> juplo.de Git - maven-thymeleaf-skin/commitdiff
Fixed problems with the page-title
authorKai Moritz <kai@juplo.de>
Sat, 16 Jul 2016 20:02:42 +0000 (22:02 +0200)
committerKai Moritz <kai@juplo.de>
Sat, 16 Jul 2016 20:02:42 +0000 (22:02 +0200)
The <title>-tag of the page is taken from the velocity-variable tile, if
the variable shortTitle is set. For XHTML-templates, this is the case, if
the <title>-tag on the input-xhtml is set. If the variable is not set, the
page-title is constructed from the project-name and the name of the page,
that was found in the menu-data.

A leading head in the content is not generated automatically, because the
pages, that are generated automatically by maven differ to much. Hence, the
leading head in the content must be specified by hand in the content.

src/main/resources/META-INF/maven/site.vm

index a6055e5734f0735380aa631dbc6ee74cb03fc7d7..86006d7135c79208a025e1ad17e1bcfc63ae8c8d 100644 (file)
 #end
 #set ( $siteCrumbs = $decoration.custom.getChild( 'thymeproxy' ).getChild( 'crumbs' ).getValue() )
 
+<!-- name: $pages.get($alignedFileName).name -->
 <!-- title: $title -->
 <!-- short title: $shortTitle -->
 <!-- current page: $alignedFileName -->
       "
     >
   <head>
-    <title>juplo - $title</title>
+    <title>#if($shortTitle and $shortTitle != '')$title#else$project.name &mdash; $pages.get($alignedFileName).name#end</title>
     <meta http-equiv="Content-Type" content="text/html; charset=${outputEncoding}" />
     <link rel="canonical" href="$sitePath$alignedFileName"/>
   </head>
     </p>
     <hr />
     <article class="main" layout:fragment="maincontent">
-      <header><h1>$shortTitle</h1></header>
       $bodyContent
     </article>
     <hr />