diff options
author | Doge <[email protected]> | 2021-05-09 17:48:44 +0800 |
---|---|---|
committer | Doge <[email protected]> | 2021-05-09 17:48:44 +0800 |
commit | e17c8354fcc5fdb3e7d66363e0acc79650577af3 (patch) | |
tree | a153c9a381e99f4382b3837b3826f6d960597684 /layout/post.ejs | |
parent | 33c134891460fcc379dc5d835299a95c4aad0710 (diff) | |
download | chromate-e17c8354fcc5fdb3e7d66363e0acc79650577af3.tar.gz chromate-e17c8354fcc5fdb3e7d66363e0acc79650577af3.tar.bz2 chromate-e17c8354fcc5fdb3e7d66363e0acc79650577af3.zip |
Code enhancement
Diffstat (limited to 'layout/post.ejs')
-rw-r--r-- | layout/post.ejs | 114 |
1 files changed, 54 insertions, 60 deletions
diff --git a/layout/post.ejs b/layout/post.ejs index 6b8ba67..9c04e82 100644 --- a/layout/post.ejs +++ b/layout/post.ejs @@ -1,67 +1,61 @@ -<section class="hero"> - <div class="hero-body"> - <div class="container"> - <div class="columns"> - <div class="column is-8 is-offset-2"> - <div class="card"> - <% if (page.thumbnail) { %> - <div class="card-iamge"> - <figure class="image is-16by9"> - <% if (theme.lazyload === true) { %> - <img class="lazy" data-src="<%= page.thumbnail %>" /> - <% } else { %> - <img src="<%= page.thumbnail %>" /> - <% } %> - </figure> - </div> +<div class="columns"> + <div class="column is-8 is-offset-2"> + <div class="card post-card"> + <% if (page.thumbnail) { %> + <div class="card-iamge"> + <figure class="image is-16by9"> + <% if (theme.lazyload === true) { %> + <img class="lazy" data-src="<%= page.thumbnail %>" /> + <% } else { %> + <img src="<%= page.thumbnail %>" /> <% } %> - <div class="card-content"> - <section class="section"> - <h2 class="title has-text-centered"> - <%= page.title %> - </h2> - <% if (page.podcast) { %> - <div class="post-podcast-player"></div> - <script> - window.addEventListener("load", () => { - const player = new Shikwasa({ - container: () => document.querySelector('.post-podcast-player'), - audio: { - title: "<%= page.title %>", - artist: "<%= page.podcast.author %>", - cover: "<%= page.podcast.cover %>", - src: "<%= page.podcast.media %>" - }, - fixed: { - type: "auto", - position: "bottom" - }, - themeColor: "red" - }); - }, false); - </script> - <% } %> - <section class="content post-content is-size-6"> - <%- page.content %> - </section> - <div class="level"> - <div class="level-left"> - <div class="level-item"> - <% if (page.tags) { %> - <div class="tags"> - <% (page.tags).forEach(function(item) { %> - <span class="tag"># <%= item.name %></span> - <% }); %> - </div> - <% } %> - </div> + </figure> + </div> + <% } %> + <div class="card-content"> + <section class="section"> + <h2 class="title has-text-centered"> + <%= page.title %> + </h2> + <% if (page.podcast) { %> + <div class="post-podcast-player"></div> + <script> + window.addEventListener("load", () => { + const player = new Shikwasa({ + container: () => document.querySelector('.post-podcast-player'), + audio: { + title: "<%= page.title %>", + artist: "<%= page.podcast.author %>", + cover: "<%= page.podcast.cover %>", + src: "<%= page.podcast.media %>" + }, + fixed: { + type: "auto", + position: "bottom" + }, + themeColor: "red" + }); + }, false); + </script> + <% } %> + <section class="content post-content is-size-6"> + <%- page.content %> + </section> + <div class="level"> + <div class="level-left"> + <div class="level-item"> + <% if (page.tags) { %> + <div class="tags"> + <% (page.tags).forEach(function(item) { %> + <span class="tag"># <%= item.name %></span> + <% }); %> </div> - </div> - </section> + <% } %> + </div> </div> </div> - </div> + </section> </div> </div> </div> -</section>
\ No newline at end of file +</div>
\ No newline at end of file |