|
1 | | -<div class="<%= theme.home.sidebar.enable === true && theme.home.sidebar.position === 'right' ? 'ml-10 max-[768px]:ml-0' : '' %> <%= theme.home.sidebar.enable === true && theme.home.sidebar.position === 'left' ? 'mr-10 max-[768px]:mr-0' : '' %>"> |
| 1 | +<% if (theme.home.sidebar.enable === true && theme.home.sidebar.position === 'left') { %> |
| 2 | + <%- partial('pages/home/sidebar') %> |
| 3 | +<% } %> |
| 4 | + |
| 5 | +<div id="main-content" class="relative box-border h-full w-9/10 max-w-content transition-[max-width,width] duration-200 ease-in-out sm:w-6/7 md:w-4/5 <%= theme.home.sidebar.enable === true && theme.home.sidebar.position === 'right' ? 'md:ml-10' : '' %> <%= theme.home.sidebar.enable === true && theme.home.sidebar.position === 'left' ? 'md:mr-10' : '' %>"> |
2 | 6 | <ul> |
3 | 7 | <% page.posts.forEach(post => { %> |
4 | | - <!-- using ring to avoid border wrapping around post thumbnail --> |
5 | | - <li data-home-card class="relative flex box-border flex-col mb-10 overflow-hidden rounded-2xl ring-inset ring ring-rd-gray-alpha-400 bg-rd-background-100 max-[768px]:mb-8 max-[640px]:mb-6 group"> |
6 | | - <% if (post.sticky) { %> |
7 | | - <div data-sticky-label class="absolute top-3 right-3 z-10 cursor-default rounded-full border border-rd-gray-alpha-400 bg-rd-background-100/15 px-2.5 py-0.5 text-xs text-rd-gray-900 hover:text-rd-gray-1000"> |
8 | | - <i class="fa-regular fa-thumbtack mr-[3px] text-[0.65rem]" aria-hidden="true"></i><%- __('sticky') %> |
9 | | - </div> |
10 | | - <% } %> |
11 | | -
|
12 | | - <% |
13 | | - let articleThumbnail = ""; |
14 | | - if (post.cover || post.banner || (post.thumbnail && post.thumbnail !== false)) { |
15 | | - if (post.thumbnail && post.thumbnail !== null) { |
16 | | - articleThumbnail = post.thumbnail; |
17 | | - } else if (post.cover && post.cover.includes("/")) { |
18 | | - articleThumbnail = post.cover; |
19 | | - } else if (post.banner && post.banner.includes("/")) { |
20 | | - articleThumbnail = post.banner; |
21 | | - } else if (config.marked.postAsset === true) { |
22 | | - articleThumbnail = [post.path, post.cover || post.banner].join("/"); |
23 | | - } |
24 | | - } |
25 | | - %> |
26 | | -
|
27 | | - <% if (post.thumbnail !== false && (post.thumbnail || post.cover || post.banner)) { %> |
28 | | - <div class="relative h-[150px] w-full overflow-hidden -mb-1"> |
29 | | - <a href="<%- url_for(post.path) %>"> |
30 | | - <img src="<%- url_for(articleThumbnail) %>" alt="<%= post.title %>" class="absolute top-1/2 h-full w-full -translate-y-1/2 object-cover transition-all dark:brightness-75 group-hover:scale-102 duration-500" /> |
31 | | - </a> |
32 | | - </div> |
33 | | - <% } %> |
34 | | - <div class="flex flex-col gap-4 p-6"> |
35 | | - <h3 class="relative m-0 font-[family-name:var(--font-article-title)] text-[1.4rem] leading-normal font-semibold text-rd-gray-1000 max-[768px]:text-[1.3rem] max-[640px]:text-[1.2rem]"> |
36 | | - <a href="<%- url_for(post.path) %>"><%= post.title %></a> |
37 | | - </h3> |
38 | | -
|
39 | | - <div class="markdown-body text-justify text-rd-gray-1000 [overflow-wrap:break-word]"> |
40 | | - <% if (post.excerpt && post.excerpt == "false") { %> |
41 | | - <% } else if (post.excerpt && post.excerpt !== "false") { %> |
42 | | - <%- render(post.excerpt, "markdown") %> |
43 | | - <% } else { %> |
44 | | - <% const excerptLength = theme.home.excerpt_length || 200; %> |
45 | | - <%- truncate(strip_html(post.content), {length: excerptLength}) %> |
46 | | - <% } %> |
47 | | - </div> |
48 | | -
|
49 | | - <%- partial('pages/home/post-card', {post}) %> |
50 | | - </div> |
51 | | - </li> |
| 8 | + <%- partial('pages/home/post-card', {post}) %> |
52 | 9 | <% }) %> |
53 | 10 | </ul> |
54 | 11 |
|
55 | 12 | <div class="px-7 py-5"> |
56 | 13 | <%- partial('components/paginator') %> |
57 | 14 | </div> |
58 | 15 | </div> |
| 16 | + |
| 17 | +<% if (theme.home.sidebar.enable === true && theme.home.sidebar.position === 'right') { %> |
| 18 | + <%- partial('pages/home/sidebar') %> |
| 19 | +<% } %> |
0 commit comments