better embeds
This commit is contained in:
parent
729a7b8c56
commit
6ef218055e
3 changed files with 28 additions and 5 deletions
|
@ -10,9 +10,19 @@
|
|||
<div>
|
||||
<% for (let contentN of content) { %>
|
||||
<% if (contentN[0] == 'file') { %>
|
||||
<img class='art' src='<%= new URL(contentN[1], 'https://tbg.dervland.net/') %>'>
|
||||
<a class='link' href='<%= contentN[1] %>'>
|
||||
<% if (['gif','png','jpg'].indexOf(contentN[2]) != -1) { %>
|
||||
<img class='art' src='<%= contentN[1] %>'>
|
||||
<% } else if (['txt','json'].indexOf(contentN[2]) != -1) { %>
|
||||
<%= contentN[1] %>
|
||||
<% } else if (['mp4','mp3','webm','wav'].indexOf(contentN[2]) != -1) { %>
|
||||
<video class='art' controls>
|
||||
<source src='<%= contentN[1] %>'>
|
||||
</video>
|
||||
<% } %>
|
||||
</a>
|
||||
<% } else if (contentN[0] == 'link') { %>
|
||||
<a class='link' href='<%= contentN[1] %>.'><%= contentN[1] %></a>
|
||||
<a class='link' href='<%= contentN[1] %>'><%= contentN[1] %></a>
|
||||
<% } else if (contentN[0].replaceAll(' ','').length > 0) { %>
|
||||
<span class='commentbox'><%= contentN[0] %></span>
|
||||
<% } } %>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue