]> git.draconx.ca Git - homepage.git/blobdiff - layouts/default.xml
cdecl99-1.3 bash-5 hotfix
[homepage.git] / layouts / default.xml
index b432c54202f5feb1e76d808ff8d7b87bc5ab61c8..2f78b3d8481e3805fddaead2dd771b1da5ff39e1 100644 (file)
@@ -2,7 +2,7 @@
 <!--
   Nick's web site: Intermediate document structure.
 
-  Copyright © 2016-2018 Nick Bowler
+  Copyright © 2016-2022 Nick Bowler
 
   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
     doc_header = doc.xpath("string(//xhtml:h1)", Xmlns)
   end
 %><document>
-  <title><%= @item.fetch(:title, doc_header) %></title>
-<% [@item.fetch(:copyright, [])].flatten.each do |copyright|
-%>  <copyright><%= copyright %></copyright>
-<% end
-  if @item[:license] then
-    lic = find_license(@item[:license])
-%>  <license>
-    <identifier><%= File::basename(lic.identifier.without_ext) %></identifier>
-    <name><%= lic[:title] %></name>
-    <uri><%= item_uri(lic) %></uri>
-    <modification-allowed><%=
-      lic[:"modification-allowed"] == true ? "yes" : "no"
-    %></modification-allowed>
-  </license>
-<% end
-%>  <source>
+  <title><%= @item.fetch(:title, doc_header) %></title><%=
+render '/copyright.xml' %><%
+find_images.each do |item| %>
+  <image>
+    <title><%= item[:attrname] || item[:title] %></title>
+    <uri><%= item_uri(item, rep: :info) %></uri><%=
+render '/copyright.xml', :item => item, :indent => 4
+%>  </image><%
+end %>
+  <source>
+<% if @item.raw_filename %>
     <file><%= item_source(@item) %></file>
-    <revision><%= item.fetch(:gitrev) %></revision>
+<% elsif File.basename(@item.identifier) == "index.lst" %>
+    <dir><%= "content" + File.dirname(@item.identifier) %></dir>
+<% end %>
+    <revision><%= @item.fetch(:gitrev) %></revision>
     <compiletime><%=
       Time.now.gmtime.strftime "%Y-%m-%d %H:%M UTC"
     %></compiletime>
   </source>
-  <html xmlns="<%= Xmlns['xhtml'] %>">
+  <hierarchy><% breadcrumbs_trail().compact.each do |item|
+    next if item == @item || item[:"breadcrumb-ignore"] %>
+    <parent>
+      <name><%=
+        if item == @items["/index.*"] then
+          "Entrance"
+        else
+          item[:title]
+        end
+      %></name>
+      <uri><%= item_uri(item) %></uri>
+    </parent><% end %>
+  </hierarchy>
+<% if @item[:kind] == "article" then
+%>  <article>
+<%= attribute_to_time(@item[:published]).strftime \
+"    <published>%Y-%m-%d</published>\n" if @item[:published]
+%><%= attribute_to_time(@item[:updated]).strftime \
+"    <updated>%Y-%m-%d</updated>\n" if @item[:updated]
+%>  </article>
+<% end
+%>  <html xmlns="<%= Xmlns['xhtml'] %>" id="<%=
+  "page" + @item.identifier.without_ext.gsub(/[^[:alnum:]]/, "_")
+%>">
 <% if !doc_header then
 %>    <h1><%= @item.fetch(:header, @item[:title]) %></h1>
 <% end %><%= doc_str