hscc

Soure code of <https://hugo.soucy.cc>.
git clone git://soucy.cc/hscc.git
Log | Files | Refs

commit 3189688a95e2a6c636d11b06d8f7ff513e83b6b1
parent 3620b7c67d35457982505001bb498f61cf56dff4
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Mon, 12 Apr 2021 11:57:34 -0400

Adapt templates with list according to the satelito modifications

Diffstat:
Mtemplates/default-index.html | 11++++++-----
Mtemplates/feed.xml.html | 26++++++++++++++------------
Mtemplates/publications.html | 47++++++++++++++++++++++++-----------------------
3 files changed, 44 insertions(+), 40 deletions(-)

diff --git a/templates/default-index.html b/templates/default-index.html @@ -2,13 +2,14 @@ <div class="e-content"> <%- content %> </div> - <% if children then %> + <% if list then %> <ol> - <% table.sort(children, function(a , b) return tonumber(a.time_created) > tonumber(b.time_created) end) %> - <% for i, child in ipairs(children) do %> + <% table.sort(list, function(a , b) return tonumber(site[a].time_created) > tonumber(site[b].time_created) end) %> + + <% for i, child in ipairs(list) do %> <li> - <a href="<%= child.rellink -%>"><%= child.title -%></a> &mdash; - <time class="dt-published" datetime="<%= child.date -%>T<%= child.datetime -%>"><%= child.date -%></time> + <a href="<%= site[child].rellink -%>"><%= site[child].title -%></a> &mdash; + <time class="dt-published" datetime="<%= site[child].date -%>T<%= site[child].datetime -%>"><%= site[child].date -%></time> </li> <% end %> </ol> diff --git a/templates/feed.xml.html b/templates/feed.xml.html @@ -15,17 +15,19 @@ <uri><%- author.uri -%></uri> </author> - <% table.sort(children, function(a , b) return tonumber(a.time_created) > tonumber(b.time_created) end) %> - <% for i, child in ipairs(children) do %> - <entry> - <title><%- child.title -%></title> - <id><%- child.id -%></id> - <link href="<%= child.permalink -%>" hreflang="<%= child.language -%>" rel="alternate" type="text/html" /> - <published><%= child.date -%>T<%= child.datetime -%>Z</published> - <updated><%- os.date('%Y-%m-%dT%H:%M:%S', child.time_modification) -%>Z</updated> - <content type="html"> - <%= child.content -%> - </content> - </entry> + <% if list then %> + <% table.sort(list, function(a , b) return tonumber(site[a].time_created) > tonumber(site[b].time_created) end) %> + <% for i, child in ipairs(list) do %> + <entry> + <title><%- site[child].title -%></title> + <id><%- site[child].id -%></id> + <link href="<%= site[child].permalink -%>" hreflang="<%= site[child].language -%>" rel="alternate" type="text/html" /> + <published><%= site[child].date -%>T<%= site[child].datetime -%>Z</published> + <updated><%- os.date('%Y-%m-%dT%H:%M:%S', site[child].time_modification) -%>Z</updated> + <content type="html"> + <%= site[child].content -%> + </content> + </entry> + <% end %> <% end %> </feed> diff --git a/templates/publications.html b/templates/publications.html @@ -1,12 +1,13 @@ <article class="h-feed hfeed"> <%- content %> - <% if children then %> + <% if list then %> <ol class="hfeed__entries"> - <% table.sort(children, function(a , b) return tonumber(a.time_created) > tonumber(b.time_created) end) %> - <% for i, child in ipairs(children) do %> - <li class="h-entry hentry<% if child.posttype == 'note' then %> as-note<% end %>"> - <% if child.posttype == 'bookmark' then %> + <% table.sort(list, function(a , b) return tonumber(site[a].time_created) > tonumber(site[b].time_created) end) %> + + <% for i, child in ipairs(list) do %> + <li class="h-entry hentry<% if site[child].posttype == 'note' then %> as-note<% end %>"> + <% if site[child].posttype == 'bookmark' then %> <small class="hentry__posttype"> <svg class="ico" height="24" width="24" role="image"><use href="#ico_bookmark"></use></svg> Marque-page @@ -14,49 +15,49 @@ <h2 class="p-name"> <a class="u-bookmark-of h-cite" - href="<%= child.url %>" + href="<%= site[child].url %>" rel="external"> - <%- child.title -%> + <%- site[child].title -%> </a> </h2> - <% elseif child.posttype == 'note' then %> + <% elseif site[child].posttype == 'note' then %> <small class="hentry__posttype"> <svg class="ico" height="24" width="24" role="image"><use href="#ico_note"></use></svg> Note </small> <h2 class="visuallyhidden"> - <%= child.title -%> + <%= site[child].title -%> </h2> - <% elseif child.posttype == 'reply' then %> + <% elseif site[child].posttype == 'reply' then %> <small class="hentry__posttype"> <svg class="ico" height="24" width="24" role="image"><use href="#ico_corner_down_left"></use></svg> - <span>En réponse à </span><cite><a href="<%- url -%>" class="u-in-reply-to" rel="external"><%- child.url -%></a></cite>. + <span>En réponse à </span><cite><a href="<%- url -%>" class="u-in-reply-to" rel="external"><%- site[child].url -%></a></cite>. </small> - <% elseif child.posttype == 'article' then %> + <% elseif site[child].posttype == 'article' then %> <small class="hentry__posttype"> <svg class="ico" height="24" width="24" role="image"><use href="#ico_article"></use></svg> Texte </small> - <h2 class="p-name"><%= child.title -%></h2> + <h2 class="p-name"><%= site[child].title -%></h2> - <% if child.summary then %> - <p class="p-content"><%- child.summary -%></p> + <% if site[child].summary then %> + <p class="p-content"><%- site[child].summary -%></p> <% end %> <% else %> <h2 class="visuallyhidden"> - <%= child.title -%> + <%= site[child].title -%> </h2> <% end %> - <% if not child.summary then %> - <div class="e-content<% if child.posttype == 'note' then %> p-name<% end %>"><%- child.content -%></div> + <% if not site[child].summary then %> + <div class="e-content<% if site[child].posttype == 'note' then %> p-name<% end %>"><%- site[child].content -%></div> <% end %> <footer class="hentry__footer"> - <% if child.keywords and child.posttype == 'bookmark' then %> + <% if site[child].keywords and site[child].posttype == 'bookmark' then %> <ul class="hentry__categories"> - <% for i, keyword in ipairs(child.keywords) do %> + <% for i, keyword in ipairs(site[child].keywords) do %> <li> <em class="p-category"><%- keyword -%></em> </li> @@ -64,9 +65,9 @@ </ul> <% end %> <div> - Publié le <a class="u-url" href="<%= child.rellink -%>"> - <time class="dt-published" datetime="<%= child.date -%>T<%= child.datetime -%>"><%= child.date -%></time></a>. - <span class="visuallyhidden">Par <em class="p-author author h-card"><%= child.author.name -%></em>.</span> + Publié le <a class="u-url" href="<%= site[child].rellink -%>"> + <time class="dt-published" datetime="<%= site[child].date -%>T<%= site[child].datetime -%>"><%= site[child].date -%></time></a>. + <span class="visuallyhidden">Par <em class="p-author author h-card"><%= site[child].author.name -%></em>.</span> </div> </footer> </li>