Skip to content

Commit

Permalink
✨ feat: 添加项目列表模板
Browse files Browse the repository at this point in the history
  • Loading branch information
白云苍狗 committed Sep 13, 2022
1 parent 250152f commit f8b31ba
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 0 deletions.
2 changes: 2 additions & 0 deletions package/hexo-theme-async/layout/page.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
<%- partial('./comment') %>
<%} else if (page.type=='about'){%>
<%- partial('./about',{post: page }) %>
<%} else if (page.type=='project'){%>
<%- partial('./project',{post: page }) %>
<%}%>
68 changes: 68 additions & 0 deletions package/hexo-theme-async/layout/project.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<div class="trm-content-start">

<!-- banner -->
<% let banner = page.banner || {}; %>
<%- partial('./_partial/banner', {
...theme.banner.default,
bannerTitle: page.title,
...banner
}) %>
<!-- banner end -->

<div class="container">
<div class="row">
<% if(!page.single_column) { %>
<div class="col-lg-4 hidden-sm">
<!-- main card -->
<%- partial('./_partial/sidebar') %>
<!-- main card end -->
</div>
<% } %>
<div class="<%- !page.single_column ? 'col-lg-8':'col-lg-12' %>">

<!-- content -->
<div class="trm-content" id="trm-content">
<div data-scroll data-scroll-repeat data-scroll-offset="500" id="about-triger"></div>

<div class="row trm-mb-40 trm-scroll-animation" data-scroll data-scroll-offset="40">
<div class="col-lg-12">
<blockquote>
<%- page.title %>
</blockquote>
</div>
</div>

<% if(Array.isArray(theme.projects)){ %>
<% theme.projects.forEach((item,index)=>{ %>
<div class="row">
<div class="col-lg-12">
<h5 class="trm-mb-40 trm-title-with-divider"><%- item.title %><span data-number="<%- index+1 %>"></span></h5>
</div>
<% item.children.forEach((project,index)=>{ %>
<div class="<%- !page.single_column ? 'col-lg-6':'col-lg-4' %>">
<div class="trm-project-card trm-scroll-animation trm-active-el" data-scroll="" data-scroll-offset="40">
<div class="trm-project-content">
<h6 class="trm-mb-20"><%- project.name %></h6>
<div class="trm-mb-20 trm-project-desc"><%- project.desc %></div>
<a target="_parent" href="<%- project.url %>" class="trm-label trm-label-color">Github<i class="fas fa-arrow-right"></i></a>
</div>
</div>
</div>
<%})%>
</div>
<%})%>
<% } %>

<div class="trm-divider trm-mb-40"></div>

<!-- footer -->
<%- partial('./_partial/footer') %>
<!-- footer end -->

</div>
<!-- content end -->

</div>
</div>
</div>
</div>
21 changes: 21 additions & 0 deletions package/hexo-theme-async/source/css/_components/card.less
Original file line number Diff line number Diff line change
Expand Up @@ -918,4 +918,25 @@
.trm-sliders-card {
overflow: hidden
}
}

// project card
.trm-project-card {
background-color: @theme-bg-color;
position : relative;
overflow : hidden;
border-radius : 10px;
margin-bottom : 40px;
box-shadow : @box-shadow;
padding : 40px;
text-align : center;

.trm-project-desc {
height : 3rem;
overflow: hidden;
}

&:hover {
transform: scale(1.05);
}
}

0 comments on commit f8b31ba

Please sign in to comment.