]> git.draconx.ca Git - homepage.git/blobdiff - layouts/copyright.xml
Solar Eclipse in Ottawa on 2021-06-10.
[homepage.git] / layouts / copyright.xml
diff --git a/layouts/copyright.xml b/layouts/copyright.xml
new file mode 100644 (file)
index 0000000..a3153bb
--- /dev/null
@@ -0,0 +1,29 @@
+<%
+s = ' ' * (@indent || 2)
+copyyears = {}
+copyauthors = {}
+[@item.fetch(:copyright, [])].flatten.each do |copyright| %>
+<%=s%><copyright><%= copyright %></copyright><%
+x = expand_copyright(copyright)
+x[:years].each do |y| copyyears[y] = 1 end
+copyauthors[x[:name]] = 1
+end
+copyyears.keys.sort.each do |y| %>
+<%=s%><copyright-year><%= y %></copyright-year><%
+end
+copyauthors.keys.sort.each do |i| %>
+<%=s%><copyright-holder><%= i %></copyright-holder><%
+end
+  if @item[:license] then
+    licref = @item[:license].split
+    lic = find_license(licref[0]) %>
+<%=s%><license>
+<%=s%>  <identifier><%= File::basename(lic.identifier.without_ext) %></identifier>
+<%=s%>  <shortname><%= license_shortname(lic) %></shortname>
+<%=s%>  <name><%= [lic[:title], licref[1..-1]].compact.join(" ").strip %></name>
+<%=s%>  <uri><%= item_uri(lic) %></uri>
+<%=s%>  <modification-allowed><%=
+      lic[:"modification-allowed"] == true ? "yes" : "no"
+    %></modification-allowed>
+<%=s%></license><%
+end %>