X-Git-Url: https://git.draconx.ca/gitweb/homepage.git/blobdiff_plain/1dc021529f88ca4f1ebfed76ffe6378272a23032..de605446b3ed408672aecd74462a25de41c1367c:/layouts/default.xml diff --git a/layouts/default.xml b/layouts/default.xml index 901b0c3..74c454a 100644 --- a/layouts/default.xml +++ b/layouts/default.xml @@ -17,17 +17,55 @@ You should have received a copy of the GNU General Public License along with this program. If not, see --> - - <%= @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 +%> <%= item_source(@item) %> <%= item.fetch(:gitrev) %> <%= Time.now.gmtime.strftime "%Y-%m-%d %H:%M UTC" %> - -

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

- <%= yield() %> - + <% breadcrumbs_trail().compact.each do |i| + if i == @item then next end %> + + <%= + if i == @items["/index.*"] then + "Entrance" + else + i[:title] + end + %> + <%= item_uri(i) %> + <% end %> + + +<% if !doc_header then +%>

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

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