提交 edefe092 编写于 作者: RYAN0UP's avatar RYAN0UP

👽 0.0.2

上级 2d650d74
#!/bin/bash #!/bin/bash
APP_NAME=halo-0.0.1.jar APP_NAME=halo-0.0.2.jar
usage() { usage() {
echo "用法: sh halo.sh [start(启动)|stop(停止)|restart(重启)|status(状态)]" echo "用法: sh halo.sh [start(启动)|stop(停止)|restart(重启)|status(状态)]"
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>cc.ryanc</groupId> <groupId>cc.ryanc</groupId>
<artifactId>halo</artifactId> <artifactId>halo</artifactId>
<version>0.0.1</version> <version>0.0.2</version>
<name>halo</name> <name>halo</name>
<description> <description>
......
...@@ -147,14 +147,33 @@ public interface PostRepository extends JpaRepository<Post,Long>{ ...@@ -147,14 +147,33 @@ public interface PostRepository extends JpaRepository<Post,Long>{
@Query(value = "select * from halo_post where post_status=0 and post_type='post' and year(post_date)=:year and month(post_date)=:month order by post_date desc",countQuery = "select count(*) from halo_post where post_status=0 and year(post_date)=:year and month(post_date)=:month",nativeQuery = true) @Query(value = "select * from halo_post where post_status=0 and post_type='post' and year(post_date)=:year and month(post_date)=:month order by post_date desc",countQuery = "select count(*) from halo_post where post_status=0 and year(post_date)=:year and month(post_date)=:month",nativeQuery = true)
Page<Post> findPostByYearAndMonth(@Param("year") String year,@Param("month") String month,Pageable pageable); Page<Post> findPostByYearAndMonth(@Param("year") String year,@Param("month") String month,Pageable pageable);
List<Post> findPostByCategories(Category category); /**
* 根据分类目录查询文章
*
* @param category category
* @param pageable pageable
* @return Page<Post></>
*/
Page<Post> findPostByCategories(Category category,Pageable pageable);
/** /**
* 根据标签查询文章 * 根据标签查询文章
* *
* @param tag tag * @param tag tag
* @param pageable pageable * @param pageable pageable
* @return page * @return Page<Post></>
*/ */
Page<Post> findPostsByTags(Tag tag,Pageable pageable); Page<Post> findPostsByTags(Tag tag,Pageable pageable);
/**
* 模糊查询文章
*
* @param postType 文章类型,post or page
* @param postStatus 0,1,2
* @param keyword 关键词
* @param pageable 分页信息
* @return Page<Post></>
*/
@Query(value = "select * from halo_post where post_status = 0 and post_type='post' and post_title like '%=:keyword%' or post_content like '%=:keyword%'",nativeQuery = true)
Page<Post> findPostByPostTitleLikeOrPostContentLikeAndPostTypeAndPostStatus(String keyword,Pageable pageable);
} }
package cc.ryanc.halo.service; package cc.ryanc.halo.service;
import cc.ryanc.halo.model.domain.Category;
import cc.ryanc.halo.model.domain.Post; import cc.ryanc.halo.model.domain.Post;
import cc.ryanc.halo.model.domain.Tag; import cc.ryanc.halo.model.domain.Tag;
import cc.ryanc.halo.model.dto.Archive; import cc.ryanc.halo.model.dto.Archive;
...@@ -175,6 +176,15 @@ public interface PostService { ...@@ -175,6 +176,15 @@ public interface PostService {
*/ */
List<Post> findPostByYear(String year); List<Post> findPostByYear(String year);
/**
* 根据分类目录查询文章
*
* @param category category
* @param pageable pageable
* @return Page<Post></>
*/
Page<Post> findPostByCategories(Category category,Pageable pageable);
/** /**
* 根据标签查询文章 * 根据标签查询文章
* *
...@@ -184,6 +194,15 @@ public interface PostService { ...@@ -184,6 +194,15 @@ public interface PostService {
*/ */
Page<Post> findPostsByTags(Tag tag, Pageable pageable); Page<Post> findPostsByTags(Tag tag, Pageable pageable);
/**
* 搜索文章
*
* @param keyword 关键词
* @param pageable 分页信息
* @return Page<Post></>
*/
Page<Post> searchByKeywords(String keyword,Pageable pageable);
/** /**
* 生成rss * 生成rss
* *
......
package cc.ryanc.halo.service.impl; package cc.ryanc.halo.service.impl;
import cc.ryanc.halo.model.domain.Category;
import cc.ryanc.halo.model.domain.Post; import cc.ryanc.halo.model.domain.Post;
import cc.ryanc.halo.model.domain.Tag; import cc.ryanc.halo.model.domain.Tag;
import cc.ryanc.halo.model.dto.Archive; import cc.ryanc.halo.model.dto.Archive;
...@@ -277,6 +278,18 @@ public class PostServiceImpl implements PostService { ...@@ -277,6 +278,18 @@ public class PostServiceImpl implements PostService {
return postRepository.findPostByYearAndMonth(year, month, null); return postRepository.findPostByYearAndMonth(year, month, null);
} }
/**
* 根据分类目录查询文章
*
* @param category category
* @param pageable pageable
* @return Page<Post></>
*/
@Override
public Page<Post> findPostByCategories(Category category, Pageable pageable) {
return postRepository.findPostByCategories(category,pageable);
}
/** /**
* 根据标签查询文章 * 根据标签查询文章
* *
...@@ -289,6 +302,18 @@ public class PostServiceImpl implements PostService { ...@@ -289,6 +302,18 @@ public class PostServiceImpl implements PostService {
return postRepository.findPostsByTags(tag, pageable); return postRepository.findPostsByTags(tag, pageable);
} }
/**
* 搜索文章
*
* @param keyword 关键词
* @param pageable 分页信息
* @return List<Post></>
*/
@Override
public Page<Post> searchByKeywords(String keyword,Pageable pageable) {
return postRepository.findPostByPostTitleLikeOrPostContentLikeAndPostTypeAndPostStatus(keyword,pageable);
}
/** /**
* 生成rss * 生成rss
* *
......
...@@ -164,7 +164,7 @@ public class PageController { ...@@ -164,7 +164,7 @@ public class PageController {
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
return "redirect:/admin/page/gallery"; return "redirect:/admin/page/galleries";
} }
/** /**
......
package cc.ryanc.halo.web.controller.front; package cc.ryanc.halo.web.controller.front;
import cc.ryanc.halo.model.domain.Category;
import cc.ryanc.halo.model.domain.Post; import cc.ryanc.halo.model.domain.Post;
import cc.ryanc.halo.model.dto.HaloConst;
import cc.ryanc.halo.service.CategoryService;
import cc.ryanc.halo.service.PostService;
import cc.ryanc.halo.web.controller.core.BaseController;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -16,7 +27,19 @@ import java.util.List; ...@@ -16,7 +27,19 @@ import java.util.List;
*/ */
@Controller @Controller
@RequestMapping(value = "categories") @RequestMapping(value = "categories")
public class CategoriesController { public class CategoriesController extends BaseController {
@Autowired
private CategoryService categoryService;
@Autowired
private PostService postService;
public String categories(Model model){
List<Category> categories = categoryService.findAllCategories();
model.addAttribute("categories",categories);
return this.render("categories");
}
/** /**
* 根据分类路径查询文章 * 根据分类路径查询文章
...@@ -28,7 +51,30 @@ public class CategoriesController { ...@@ -28,7 +51,30 @@ public class CategoriesController {
@GetMapping(value = "{cateUrl}") @GetMapping(value = "{cateUrl}")
public String categories(Model model, public String categories(Model model,
@PathVariable("cateUrl") String cateUrl) { @PathVariable("cateUrl") String cateUrl) {
List<Post> posts; return this.categories(model,cateUrl,1);
return null; }
/**
* 根据分类目录查询所有文章 分页
*
* @param model model
* @param cateUrl 分类目录路径
* @param page 页码
* @return string
*/
public String categories(Model model,
@PathVariable("cateUrl") String cateUrl,
@PathVariable("page") Integer page){
Category category = categoryService.findByCateUrl(cateUrl);
Sort sort = new Sort(Sort.Direction.DESC,"postDate");
Integer size = 10;
if(!StringUtils.isBlank(HaloConst.OPTIONS.get("index_posts"))){
size = Integer.parseInt(HaloConst.OPTIONS.get("index_posts"));
}
Pageable pageable = new PageRequest(page-1,size,sort);
Page<Post> posts = postService.findPostByCategories(category,pageable);
model.addAttribute("posts",posts);
model.addAttribute("category",category);
return this.render("category");
} }
} }
...@@ -94,4 +94,18 @@ public class IndexController extends BaseController { ...@@ -94,4 +94,18 @@ public class IndexController extends BaseController {
List<Post> posts = postService.findPostByStatus(0, HaloConst.POST_TYPE_POST, pageable).getContent(); List<Post> posts = postService.findPostByStatus(0, HaloConst.POST_TYPE_POST, pageable).getContent();
return posts; return posts;
} }
/**
* 搜索文章
*
* @param keyword keyword
* @param model model
* @return 模板路径/themes/{theme}/index
*/
@GetMapping(value = "search")
public String search(@PathParam("keyword") String keyword,Model model){
Page<Post> posts = postService.searchByKeywords(keyword,null);
model.addAttribute("posts",posts);
return this.render("index");
}
} }
...@@ -84,6 +84,6 @@ public class TagsController extends BaseController { ...@@ -84,6 +84,6 @@ public class TagsController extends BaseController {
Page<Post> posts = postService.findPostsByTags(tag, pageable); Page<Post> posts = postService.findPostsByTags(tag, pageable);
model.addAttribute("posts", posts); model.addAttribute("posts", posts);
model.addAttribute("tag", tag); model.addAttribute("tag", tag);
return this.render("tags"); return this.render("tag");
} }
} }
...@@ -28,7 +28,7 @@ spring: ...@@ -28,7 +28,7 @@ spring:
jpa: jpa:
hibernate: hibernate:
ddl-auto: update ddl-auto: update
show-sql: false show-sql: true
freemarker: freemarker:
allow-request-override: false allow-request-override: false
cache: false cache: false
......
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
</#list> </#list>
<#else> <#else>
<tr> <tr>
<td colspan="3" style="text-align: center;">暂无页面</td> <td colspan="5" style="text-align: center;">暂无页面</td>
</tr> </tr>
</#if> </#if>
</tbody> </tbody>
......
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
<div class="form-group"> <div class="form-group">
<label for="galleryThumbnailUrl" class="col-sm-2 control-label">缩略图地址:</label> <label for="galleryThumbnailUrl" class="col-sm-2 control-label">缩略图地址:</label>
<div class="col-sm-4"> <div class="col-sm-4">
<input type="url" class="form-control" id="galleryThumbnailUrl" name="galleryThumbnailUrl"> <input type="text" class="form-control" id="galleryThumbnailUrl" name="galleryThumbnailUrl">
</div> </div>
</div> </div>
</div> </div>
......
...@@ -35,25 +35,31 @@ ...@@ -35,25 +35,31 @@
<div class="form-group"> <div class="form-group">
<label for="galleryDesc" class="col-sm-2 control-label">图片描述:</label> <label for="galleryDesc" class="col-sm-2 control-label">图片描述:</label>
<div class="col-sm-10"> <div class="col-sm-10">
<input type="text" class="form-control" id="galleryDesc" name="galleryDesc" value="${gallery.galleryDesc}" > <input type="text" class="form-control" id="galleryDesc" name="galleryDesc" value="${gallery.galleryDesc?if_exists}" >
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="galleryDate" class="col-sm-2 control-label">图片日期:</label> <label for="galleryDate" class="col-sm-2 control-label">图片日期:</label>
<div class="col-sm-10"> <div class="col-sm-10">
<input type="date" class="form-control" id="galleryDate" name="galleryDate" value="${gallery.galleryDate}"> <input type="date" class="form-control" id="galleryDate" name="galleryDate" value="${gallery.galleryDate?if_exists}">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="galleryLocation" class="col-sm-2 control-label">拍摄地点:</label> <label for="galleryLocation" class="col-sm-2 control-label">拍摄地点:</label>
<div class="col-sm-10"> <div class="col-sm-10">
<input type="text" class="form-control" id="galleryLocation" name="galleryLocation" value="${gallery.galleryLocation}" > <input type="text" class="form-control" id="galleryLocation" name="galleryLocation" value="${gallery.galleryLocation?if_exists}" >
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="galleryUrl" class="col-sm-2 control-label">图片地址:</label> <label for="galleryUrl" class="col-sm-2 control-label">图片地址:</label>
<div class="col-sm-10"> <div class="col-sm-10">
<input type="text" class="form-control" id="galleryUrl" name="galleryUrl" value="${gallery.galleryUrl}" disabled> <input type="text" class="form-control" id="galleryUrl" name="galleryUrl" value="${gallery.galleryUrl}">
</div>
</div>
<div class="form-group">
<label for="galleryUrl" class="col-sm-2 control-label">缩略图地址:</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="galleryThumbnailUrl" name="galleryThumbnailUrl" value="${gallery.galleryThumbnailUrl}">
</div> </div>
</div> </div>
</div> </div>
...@@ -115,6 +121,7 @@ ...@@ -115,6 +121,7 @@
} }
function btn_save() { function btn_save() {
$('#galleryForm').submit(); $('#galleryForm').submit();
parent.location.reload();
} }
</script> </script>
</html> </html>
\ No newline at end of file
...@@ -4,36 +4,10 @@ ...@@ -4,36 +4,10 @@
<i class="material-icons mdl-color-text--white" role="presentation">search</i> <i class="material-icons mdl-color-text--white" role="presentation">search</i>
</label> </label>
<form autocomplete="off" id="search-form" method="get" action="//google.com/search" accept-charset="UTF-8" class="mdl-textfield__expandable-holder" target="_blank"> <form autocomplete="off" id="search-form" method="get" action="/search" accept-charset="UTF-8" class="mdl-textfield__expandable-holder">
<input class="mdl-textfield__input search-input" type="search" name="q" id="search" placeholder=""> <input class="mdl-textfield__input search-input" type="search" name="keyword" id="search" placeholder="">
<label id="search-form-label" class="mdl-textfield__label" for="search"></label> <label id="search-form-label" class="mdl-textfield__label" for="search"></label>
<input type="hidden" name="sitesearch" value=""> <input type="hidden" name="sitesearch" value="">
</form> </form>
</div> </div>
<!--
<% if( theme.search.use === 'swiftype' ) { %>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--expandable" method="post" action="">
<label id="search-label" class="mdl-button mdl-js-ripple-effect mdl-js-button mdl-button--fab mdl-color--accent mdl-shadow--4dp" for="search">
<i class="material-icons mdl-color-text--white" role="presentation">search</i>
</label>
<form autocomplete="off" id="search-form" class="mdl-textfield__expandable-holder" action="">
<input class="mdl-textfield__input search-input st-default-search-input" type="text" name="q" id="search">
<label id="search-form-label" class="mdl-textfield__label" for="search"></label>
</form>
</div>
<% } %>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--expandable" method="post" action="">
<label id="search-label" class="mdl-button mdl-js-ripple-effect mdl-js-button mdl-button--fab mdl-color--accent mdl-shadow--4dp" for="search">
<i class="material-icons mdl-color-text--white" role="presentation">search</i>
</label>
<form autocomplete="off" id="search-form" class="mdl-textfield__expandable-holder">
<input type="text" id="search" class="form-control mdl-textfield__input search-input" name="q" results="0" placeholder=""/>
<label id="search-form-label" class="mdl-textfield__label" for="search"></label>
</form>
</div>
<div id="local-search-result"></div>
-->
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
<@commonTag method="categories"> <@commonTag method="categories">
<#list categories as cate> <#list categories as cate>
<li> <li>
<a class="sidebar_archives-link" href="/categories/${cate.cateUrl}/">${cate.cateName}<span class="sidebar_archives-count">4</span></a> <a class="sidebar_archives-link" href="/categories/${cate.cateUrl}/">${cate.cateName}<span class="sidebar_archives-count">${cate.posts?size}</span></a>
</li> </li>
</#list> </#list>
</@commonTag> </@commonTag>
......
<!-- 畅言公共 js 代码 start -->
<script id="cy_cmt_num" src="https://changyan.sohu.com/upload/plugins/plugins.list.count.js?clientId=<%=theme.comment.changyan_appid%>">
</script>
<!-- 畅言公共 js 代码 end -->
\ No newline at end of file
<!-- 使用 changyan -->
<div id="changyan-comment">
<%- partial('_widget/comment/' + theme.comment.use + '/main') %>
</div>
<style>
#changyan-comment{
background-color: #eee;
padding: 2pc;
}
</style>
\ No newline at end of file
<!--PC和WAP自适应版-->
<div id="SOHUCS" sid="<% if(theme.comment.changyan_thread_key_type == "id"){ %><%= page.id %><% } else { %><%= page.path %><% } %>" ></div>
<script type="text/javascript">
(function(){
var appid = '<%= theme.comment.changyan_appid %>';
var conf = '<%= theme.comment.changyan_conf %>';
var width = window.innerWidth || document.documentElement.clientWidth;
if (width < 960) {
window.document.write('<script id="changyan_mobile_js" charset="utf-8" type="text/javascript" src="https://changyan.sohu.com/upload/mobile/wap-js/changyan_mobile.js?client_id=' + appid + '&conf=' + conf + '"><\/script>'); } else { var loadJs=function(d,a){var c=document.getElementsByTagName("head")[0]||document.head||document.documentElement;var b=document.createElement("script");b.setAttribute("type","text/javascript");b.setAttribute("charset","UTF-8");b.setAttribute("src",d);if(typeof a==="function"){if(window.attachEvent){b.onreadystatechange=function(){var e=b.readyState;if(e==="loaded"||e==="complete"){b.onreadystatechange=null;a()}}}else{b.onload=a}}c.appendChild(b)};loadJs("https://changyan.sohu.com/upload/changyan.js",function(){window.changyan.api.config({appid:appid,conf:conf})}); } })(); </script>
<!-- 使用 DISQUS js 代码 -->
<script id="dsq-count-scr" src="//<%= theme.comment.shortname %>.disqus.com/count.js" async></script>
\ No newline at end of file
<!-- 使用 DISQUS -->
<div id="disqus-comment">
<%- partial('_widget/comment/' + theme.comment.use + '/main') %>
</div>
<style>
#disqus-comment{
background-color: #eee;
padding: 2pc;
}
</style>
\ No newline at end of file
<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_config = function () {
this.page.url = '<%= page.permalink %>'; // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = '<%= page.permalink %>'; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
</script>
<script type="text/ls-javascript" id="disqus-thread-script">
queue.offer(function() {
(function() { // DON'T EDIT BELOW THIS LINE
var d = document;
var s = d.createElement('script');
s.src = '//<%= theme.comment.shortname %>.disqus.com/embed.js';
s.setAttribute('data-timestamp', + new Date());
(d.head || d.body).appendChild(s);
})();
});
</script>
<!-- 使用 DISQUS_CLICK -->
<div id="disqus-comment">
<%- partial('_widget/comment/' + theme.comment.use + '/main') %>
</div>
<style>
#disqus-comment{
background-color: #eee;
padding: 2pc;
}
</style>
\ No newline at end of file
<div id="disqus_thread"></div>
<!-- add animation -->
<style>
.disqus_click_btn {
line-height: 30px;
margin: 0;
min-width: 50px;
padding: 0 14px;
display: inline-block;
font-family: "Roboto", "Helvetica", "Arial", sans-serif;
font-size: 14px;
font-weight: 400;
text-transform: uppercase;
letter-spacing: 0;
overflow: hidden;
will-change: box-shadow;
transition: box-shadow .2s cubic-bezier(.4, 0, 1, 1), background-color .2s cubic-bezier(.4, 0, .2, 1), color .2s cubic-bezier(.4, 0, .2, 1);
outline: 0;
cursor: pointer;
text-decoration: none;
text-align: center;
vertical-align: middle;
border: 0;
background: rgba(158, 158, 158, .2);
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12);
color: #fff;
background-color: <%= theme.uiux.button_color %>;
text-shadow: 0;
display: none
}
</style>
<div class="btn_click_load">
<button class="disqus_click_btn"><%= __('post.comments_load_button') %></button>
</div>
<script type="text/javascript">
var disqus_config = function () {
this.page.url = '<%= page.permalink %>'; // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = '<%= page.permalink %>'; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
</script>
<script type="text/ls-javascript" id="disqus-lazy-load-script">
$.ajax({
url: 'https://disqus.com/next/config.json',
timeout: 4000,
type: 'GET',
success: (function() {
var d = document;
var s = d.createElement('script');
s.src = '//<%= theme.comment.shortname %>.disqus.com/embed.js';
s.setAttribute('data-timestamp', + new Date());
(d.head || d.body).appendChild(s);
$('.disqus_click_btn').css('display','none');
})(),
error: function() {
$('.disqus_click_btn').css('display','block');
}
});
$('.btn_click_load').click(function() { //click to load comments
(function() { // DON'T EDIT BELOW THIS LINE
var d = document;
var s = d.createElement('script');
s.src = '//<%= theme.comment.shortname %>.disqus.com/embed.js';
s.setAttribute('data-timestamp', + new Date());
(d.head || d.body).appendChild(s);
})();
$('.disqus_click_btn').css('display','none');
});
</script>
<!-- 使用 Gitalk -->
<div id="gitalk-comment">
<%- partial('_widget/comment/' + theme.comment.use + '/main') %>
</div>
<style>
#gitalk-comment {
background-color: #eee;
padding: 2pc;
}
</style>
\ No newline at end of file
<!-- Gitalk 评论框 -->
<div id="gitalk-container"></div>
<link rel="stylesheet" href="https://unpkg.com/gitalk/dist/gitalk.css">
<script src="https://unpkg.com/gitalk/dist/gitalk.min.js"></script>
<script>
var gitalk = new Gitalk({
clientID: '<%= theme.comment.gitalk_client_id %>',
clientSecret: '<%= theme.comment.gitalk_client_secret %>',
repo: '<%= theme.comment.gitalk_repo %>',
owner: '<%= theme.comment.gitalk_owner %>',
admin: ['<%= theme.comment.gitalk_owner %>'],
// facebook-like distraction free mode
distractionFreeMode: false
})
gitalk.render('gitalk-container')
</script>
\ No newline at end of file
<!-- 使用 gitcoment -->
<div id="gitment-comment">
<%- partial('_widget/comment/' + theme.comment.use + '/main') %>
</div>
<style>
#gitment-comment{
background-color: #eee;
padding: 2pc;
}
</style>
<link rel="stylesheet" href="https://imsun.github.io/gitment/style/default.css">
<script src="https://imsun.github.io/gitment/dist/gitment.browser.js"></script>
<script>
var gitment = new Gitment({
//id: '页面 ID', // 可选。默认为 location.href
owner: '<%= theme.comment.gitment_owner %>',
repo: '<%= theme.comment.gitment_repo %>',
oauth: {
client_id: '<%= theme.comment.gitment_client_id %>',
client_secret: '<%= theme.comment.gitment_client_secret %>',
},
})
gitment.render('container')
</script>
\ No newline at end of file
<!-- Gitment 评论框 -->
<div id="container"></div>
\ No newline at end of file
<!-- 使用 来必力 -->
<div id="livere-comment">
<%- partial('_widget/comment/' + theme.comment.use + '/main') %>
</div>
<style>
#livere-comment{
background-color: #eee;
padding: 2pc;
}
</style>
\ No newline at end of file
<div id="lv-container" data-id="city" data-uid="<%= theme.comment.livere_data_uid %>">
<script type="text/ls-javascript" id="livere-comment-js">
(function(d, s) {
var j, e = d.getElementsByTagName(s)[0];
if (typeof LivereTower === 'function') { return; }
j = d.createElement(s);
j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
j.async = true;
e.parentNode.insertBefore(j, e);
})(document, 'script');
</script>
</div>
\ No newline at end of file
<div id="comment" style='padding:10px;' class="vcomment"></div>
<%- partial('_widget/comment/' + theme.comment.use + '/main') %>
\ No newline at end of file
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src="//unpkg.com/valine/dist/Valine.min.js"></script>
<script>
var GUEST_INFO = ['nick','mail','link'];
var guest_info = '<%= theme.comment.valine_guest_info %>'.split(',').filter(function(item){
return GUEST_INFO.indexOf(item) > -1
});
var notify = '<%= theme.comment.valine_notify %>' == true;
var verify = '<%= theme.comment.valine_verify %>' == true;
new Valine({
el: '.vcomment',
notify: notify,
verify: verify,
appId: "<%= theme.comment.valine_leancloud_appId %>",
appKey: "<%= theme.comment.valine_leancloud_appKey %>",
placeholder: "<%= theme.comment.valine_placeholder %>",
pageSize:'<%= theme.comment.valine_pageSize %>',
avatar:'<%= theme.comment.valine_avatar %>',
lang:'<%= theme.comment.valine_lang %>'
});
</script>
\ No newline at end of file
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
} }
.md-links-item a:hover{ .md-links-item a:hover {
cursor: pointer; cursor: pointer;
} }
...@@ -78,10 +78,11 @@ ...@@ -78,10 +78,11 @@
line-height: 50px; line-height: 50px;
} }
#scheme-Paradox .mdl-mini-footer{ #scheme-Paradox .mdl-mini-footer {
clear: left; clear: left;
} }
#bottom{
#bottom {
position: relative; position: relative;
} }
</style> </style>
...@@ -91,7 +92,7 @@ ...@@ -91,7 +92,7 @@
<li class="md-links-item"> <li class="md-links-item">
<a href="${link.linkUrl}" title="${link.linkName}" target="_blank"> <a href="${link.linkUrl}" title="${link.linkName}" target="_blank">
<img src="${link.linkPic}" alt="${link.linkName}" height="72px"/> <img src="${link.linkPic}" alt="${link.linkName}" height="72px"/>
<span class="md-links-title">${link.linkName}</span><br /> <span class="md-links-title">${link.linkName}</span><br/>
<span>${link.linkDesc?if_exists}</span> <span>${link.linkDesc?if_exists}</span>
</a> </a>
</li> </li>
...@@ -108,4 +109,5 @@ ...@@ -108,4 +109,5 @@
$(document).ready(function() { $(document).ready(function() {
adjustFooter(); adjustFooter();
}); });
</script> </script>
<script type="text/ls-javascript" id="search-local-js-script"> <script type="text/ls-javascript" id="search-local-js-script">
var searchFunc=function(c,a,b){$.ajax({url:c,dataType:"xml",success:function(e){var d=$("entry",e).map(function(){return{title:$("title",this).text(),content:$("content",this).text(),url:$("url",this).text()}}).get();var g=document.getElementById(a);var f=document.getElementById(b);g.addEventListener("input",function(){var i='<ul class="search-result-list">';var h=this.value.trim().toLowerCase().split(/[\s\-]+/);f.innerHTML="";if(this.value.trim().length<=0){return}d.forEach(function(o){var n=true;var s=[];var t=o.title.trim().toLowerCase();var m=o.content.trim().replace(/<[^>]+>/g,"").toLowerCase();var j=o.url;var u=-1;var q=-1;var p=-1;if(t!==""&&m!==""){h.forEach(function(w,x){u=t.indexOf(w);q=m.indexOf(w);if(u<0&&q<0){n=false}else{if(q<0){q=0}if(x===0){p=q}}})}if(n){i+='<li><a href="'+j+'" class="search-result-title" target="_blank">'+t;var r=o.content.trim().replace(/<[^>]+>/g,"");if(p>=0){var k=p-6;var l=p+6;if(k<0){k=0}if(k===0){l=10}if(l>r.length){l=r.length}var v=r.substr(k,l);h.forEach(function(w){var x=new RegExp(w,"gi");v=v.replace(x,'<em class="search-keyword">'+w+"</em>")});i+='<p class="search-result">'+v+"...</p></a>"}}});f.innerHTML=i})}})}; var searchFunc=function(c,a,b){$.ajax({url:c,dataType:"xml",success:function(e){var d=$("entry",e).map(function(){return{title:$("title",this).text(),content:$("content",this).text(),url:$("url",this).text()}}).get();var g=document.getElementById(a);var f=document.getElementById(b);g.addEventListener("input",function(){var i='<ul class="search-result-list">';var h=this.value.trim().toLowerCase().split(/[\s\-]+/);f.innerHTML="";if(this.value.trim().length<=0){return}d.forEach(function(o){var n=true;var s=[];var t=o.title.trim().toLowerCase();var m=o.content.trim().replace(/<[^>]+>/g,"").toLowerCase();var j=o.url;var u=-1;var q=-1;var p=-1;if(t!==""&&m!==""){h.forEach(function(w,x){u=t.indexOf(w);q=m.indexOf(w);if(u<0&&q<0){n=false}else{if(q<0){q=0}if(x===0){p=q}}})}if(n){i+='<li><a href="'+j+'" class="search-result-title" target="_blank">'+t;var r=o.content.trim().replace(/<[^>]+>/g,"");if(p>=0){var k=p-6;var l=p+6;if(k<0){k=0}if(k===0){l=10}if(l>r.length){l=r.length}var v=r.substr(k,l);h.forEach(function(w){var x=new RegExp(w,"gi");v=v.replace(x,'<em class="search-keyword">'+w+"</em>")});i+='<p class="search-result">'+v+"...</p></a>"}}});f.innerHTML=i})}})};
</script> </script>
\ No newline at end of file
...@@ -2,11 +2,6 @@ ...@@ -2,11 +2,6 @@
<@layout title="归档 | ${options.blog_title?default('Material')}" keywords="${options.seo_keywords?default('Material')}" description="${options.seo_desc?default('Material')}"> <@layout title="归档 | ${options.blog_title?default('Material')}" keywords="${options.seo_keywords?default('Material')}" description="${options.seo_desc?default('Material')}">
<!-- Index Module --> <!-- Index Module -->
<div class="material-index mdl-grid"> <div class="material-index mdl-grid">
<#if options.theme_material_scheme?if_exists == "Paradox" && posts.number==0 && !isArchives??>
<!-- Paradox Header -->
<#include "_partial/daily_pic.ftl">
<#include "_partial/blog_info.ftl">
</#if>
<div class="locate-thumbnail-symbol"></div> <div class="locate-thumbnail-symbol"></div>
<!-- Pin on top --> <!-- Pin on top -->
......
<#include "module/macro.ftl">
<@layout title="分类目录:${category.cateName} | ${options.blog_title?default('Material')}" keywords="${options.seo_keywords?default('Material')}}" description="${options.seo_desc?default('Material')}}">
<!-- Index Module -->
<div class="material-index mdl-grid">
<div class="locate-thumbnail-symbol"></div>
<!-- Pin on top -->
<!-- Normal Post -->
<#if options.theme_material_scheme?default('Paradox') == "Paradox">
<!-- Paradox Thumbnail -->
<#include "_partial/Paradox-post_entry.ftl">
<#else>
<!-- Isolation Thumbnail -->
<#include "_partial/Isolation-post_entry.ftl">
</#if>
<#include "_partial/index-nav.ftl">
<@nav url="/"></@nav>
<#if options.theme_material_scheme?default('Paradox') == "Paradox">
<#include "_partial/Paradox-post_entry-thumbnail.ftl">
</#if>
</div>
</@layout>
\ No newline at end of file
<#include "module/macro.ftl">
<@layout title="标签:${tag.tagName} | ${options.blog_title?default('Material')}" keywords="${options.seo_keywords?default('Material')}}" description="${options.seo_desc?default('Material')}}">
<!-- Index Module -->
<div class="material-index mdl-grid">
<div class="locate-thumbnail-symbol"></div>
<!-- Pin on top -->
<!-- Normal Post -->
<#if options.theme_material_scheme?default('Paradox') == "Paradox">
<!-- Paradox Thumbnail -->
<#include "_partial/Paradox-post_entry.ftl">
<#else>
<!-- Isolation Thumbnail -->
<#include "_partial/Isolation-post_entry.ftl">
</#if>
<#include "_partial/index-nav.ftl">
<@nav url="/"></@nav>
<#if options.theme_material_scheme?default('Paradox') == "Paradox">
<#include "_partial/Paradox-post_entry-thumbnail.ftl">
</#if>
</div>
</@layout>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册