Update template.ejs

This commit is contained in:
bihlink 2022-07-05 22:07:03 +02:00 committed by GitHub
parent 92bbb40875
commit abf0d3f4aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 73 additions and 0 deletions

View File

@ -23,6 +23,77 @@
<% } %>
</head>
<body>
<% if (opts.theme && opts.theme.toLowerCase() == 'modern-light'){ %>
<div class="container-fluid mt-2">
<% if (opts.header !== false){ %>
<div class="card position-relative">
<img src="<%= meta.headerImage?`background-image:url(${meta.headerImage})`:'' %>" class="card-img-top headerimg">
<span class="position-absolute top-0 end-0 px-1 bg-danger m-2 follow"><a href="<%= meta.link %>" target="_top">Follow</a></span>
<div class="card-body">
<a class="header-left" target="_top" href="<%= meta.link %>">
<img class="avatar rounded-circle shadow" src="<%= meta.avatar %>"></img>
</a>
<h4 class="card-title" style="margin-left:120px;"><%= meta.title %></h4>
<p class="card-text"><%- meta.description %></p>
</div>
</div>
<% } %>
<% var filtered = items.filter(function(item){return !((item.isBoost && !opts.boosts) || (item.isReply && !opts.replies)) })%>
<% filtered.forEach(function(item){ %>
<div class="card">
<% if (item.isBoost) { %>
<div class="item-title card-header">Shared by Links</div>
<% } %>
<div class="author mb-2 card-header">
<a target="_top" href="<%- item.author.uri %>">
<img class="avatar-item rounded-circle shadow" src="<%- item.author.avatar %>"/>
</a>
<div class="author-info">
<a target="_top" class="author-displayname" href="<%- item.author.uri %>"> <%= item.author.displayName %> </a>
<div class="author-fullname"> <%= item.author.fullName %> <a class="date position-absolute top-0 end-0" href="<%= item.permalink %>"><%= item.stringDate %></a></div>
</div>
</div>
<div class="card-body">
<% if (item.hasCw){ %>
<% var cwId = (item.cw+item.atomHref).replace(/\W+/g,'') %>
<span class="cw"><%- item.cw %></span>
<input type="checkbox" class="showmore" id="<%- cwId %>">
<label class="button" for="<%- cwId %>">Show</label>
<% } %>
<p class="card-text"><%- item.content %></p>
<% if (item.enclosures.length > 0){ %>
<div class="enclosures">
<% for (var i = 0; i < item.enclosures.length; i ++){ %>
<% var e = item.enclosures[i] %>
<% if (e.type.indexOf('audio') > -1) {%>
<audio class="enclosure" controls loop src="<%= e.url %>"/>
<% }else if (e.type.indexOf('video') > -1){ %>
<video class="enclosure" controls loop src="<%= e.url %>"/>
<% } else { %>
<a target="_top" class="enclosure" href="<%= e.url %>" >
<% if (e.type.indexOf('image') > -1){ %>
<img src="<%= e.url %>" alt="<%= e.name %>" title="<%= e.name %>"/>
<% } else { %>
<%= e.url %>
<% } %>
</a>
<% } %>
<% } %>
</div>
<% } %>
</div>
<% }); %>
</div>
</div><!-- container -->
<% } else { %>
<!-- Old theme -->
<% if (opts.header !== false){ %>
<div class="meta">
@ -137,6 +208,8 @@
});
</script>
<% } %>
<!-- End Old theme -->
<% } %>
</body>