X-Git-Url: http://git.draconx.ca/gitweb/homepage.git/blobdiff_plain/1dc021529f88ca4f1ebfed76ffe6378272a23032..79dfd09162d1c4e201eccec188057c0e9ded2260:/layouts/default.xml diff --git a/layouts/default.xml b/layouts/default.xml index 901b0c3..949290a 100644 --- a/layouts/default.xml +++ b/layouts/default.xml @@ -2,7 +2,7 @@ - - <%= @item[:title] %> - +<% + doc_str = yield() + doc = Nokogiri::XML(sprintf("%s", + Xmlns['xhtml'], doc_str)) + + doc_header = nil + if !doc.xpath("//xhtml:h1", Xmlns).empty? then + doc_header = doc.xpath("string(//xhtml:h1)", Xmlns) + end +%> + <%= @item.fetch(:title, doc_header) %> +<% [@item.fetch(:copyright, [])].flatten.each do |copyright| +%> <%= copyright %> +<% end + if @item[:license] then + licref = @item[:license].split + lic = find_license(licref[0]) +%> + <%= File::basename(lic.identifier.without_ext) %> + <%= [lic[:title], licref[1..-1]].compact.join(" ").strip %> + <%= item_uri(lic) %> + <%= + lic[:"modification-allowed"] == true ? "yes" : "no" + %> + +<% end +%> +<% if @item.raw_filename %> <%= item_source(@item) %> - <%= item.fetch(:gitrev) %> +<% elsif File.basename(@item.identifier) == "index.lst" %> + <%= "content" + File.dirname(@item.identifier) %> +<% end %> + <%= @item.fetch(:gitrev) %> <%= Time.now.gmtime.strftime "%Y-%m-%d %H:%M UTC" %> - -

<%= @item.fetch(:header, @item[:title]) %>

- <%= yield() %> - + <% breadcrumbs_trail().compact.each do |item| + next if item == @item || item[:"breadcrumb-ignore"] %> + + <%= + if item == @items["/index.*"] then + "Entrance" + else + item[:title] + end + %> + <%= item_uri(item) %> + <% end %> + +<% if @item[:kind] == "article" then +%>
+<%= attribute_to_time(@item[:published]).strftime \ +" %Y-%m-%d\n" if @item[:published] +%>
+<% end +%> +<% if !doc_header then +%>

<%= @item.fetch(:header, @item[:title]) %>

+<% end %><%= doc_str +%>