Commit 87fd8766 authored by Guillaume Porte's avatar Guillaume Porte 😶
Browse files

Update html.xqm

parent a5a5b520
Loading
Loading
Loading
Loading
−34
Changes for rxq/html.xqm: 0 added lines, 34 removed lines.
Original line number Diff line number Diff line
@@ -410,40 +410,6 @@ declare function max.html:renderTemplate($htmlDoc as document-node(), $map as ma
};


declare function max.html:getSitemap($project){

  let $baseUri := replace(request:uri(), concat($project, '/sitemap.xml'), '')
  return

   <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    
    {
      (: pages éditoriales :)
      for $entry in doc("../editions/" || $project || "/" || $max.cons:MENU_FILE)//*:entry[@type="main"]
        return 
          <url>
            <loc>{$baseUri}{$project}/{string($entry/*:target)}</loc>
          </url>
    }
    
    {
      (: fragment xml :)
      let $docs := db:list(  max.config:getProjectDBPath($project)  )
      for $doc in $docs
        let $toc := max.toc:getDocumentTOC($project, $doc)
        let $urls := $toc//*:ul[@id="routeEntries"]/*:li/*:a
        for $url in $urls
          let $url := substring($url/@href, 2)
          return
            <url>
              <loc>{$baseUri}{$url}</loc>
            </url>

    }
    </urlset> 

};



(: html head tags :)