mirror of https://github.com/halo-dev/halo
Update anatole theme.
parent
feeecc30b2
commit
297bde97d2
|
@ -9,6 +9,7 @@ import run.halo.app.model.freemarker.method.RecentCommentsMethod;
|
|||
import run.halo.app.model.freemarker.method.RecentPostsMethod;
|
||||
import run.halo.app.model.freemarker.tag.*;
|
||||
import run.halo.app.service.OptionService;
|
||||
import run.halo.app.service.UserService;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
|
@ -28,6 +29,9 @@ public class FreeMarkerAutoConfiguration {
|
|||
@Autowired
|
||||
private OptionService optionsService;
|
||||
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
|
||||
@Autowired
|
||||
private PostTagDirective postTagDirective;
|
||||
|
||||
|
@ -59,6 +63,7 @@ public class FreeMarkerAutoConfiguration {
|
|||
public void setSharedVariable() {
|
||||
try {
|
||||
configuration.setSharedVariable("options", optionsService.listOptions());
|
||||
configuration.setSharedVariable("user",userService.getCurrentUser().orElse(null));
|
||||
//Freemarker custom tags
|
||||
configuration.setSharedVariable("categoryTag", categoryTagDirective);
|
||||
configuration.setSharedVariable("commentTag", commentTagDirective);
|
||||
|
|
|
@ -6,23 +6,23 @@
|
|||
<div class="autopagerize_page_element">
|
||||
<div class="content">
|
||||
<#include "module/post_entry.ftl">
|
||||
<#if posts.pages gt 1>
|
||||
<#if posts.totalPages gt 1>
|
||||
<div class="pagination">
|
||||
<ul class="clearfix">
|
||||
<#if posts.hasPrevious()>
|
||||
<#if posts.page == 1>
|
||||
<#if posts.number == 1>
|
||||
<li class="pre pagbuttons">
|
||||
<a class="btn" role="navigation" href="${options.blog_url!}/categories/${category.slugName!}">上一页</a>
|
||||
<a class="btn" role="navigation" href="${options.blog_url!}/">上一页</a>
|
||||
</li>
|
||||
<#else >
|
||||
<li class="pre pagbuttons">
|
||||
<a class="btn" role="navigation" href="${options.blog_url!}/categories/${category.slugName!}/page/${posts.page}">上一页</a>
|
||||
<a class="btn" role="navigation" href="${options.blog_url!}/page/${posts.number}">上一页</a>
|
||||
</li>
|
||||
</#if>
|
||||
</#if>
|
||||
<#if posts.hasNext()>
|
||||
<li class="next pagbuttons">
|
||||
<a class="btn" role="navigation" href="${options.blog_url!}/categories/${category.slugName!}/page/${posts.page+2}">下一页</a>
|
||||
<a class="btn" role="navigation" href="${options.blog_url!}/page/${posts.number+2}">下一页</a>
|
||||
</li>
|
||||
</#if>
|
||||
</ul>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="stylesheet" href="anatole/source/plugins/gallery/css/main.css" />
|
||||
<noscript><link rel="stylesheet" href="anatole/source/plugins/gallery/css/noscript.css" /></noscript>
|
||||
<noscript><link rel="stylesheet" href="/source/plugins/gallery/css/noscript.css" /></noscript>
|
||||
</head>
|
||||
<body class="is-loading-0 is-loading-1 is-loading-2">
|
||||
<div id="main">
|
||||
|
|
|
@ -6,24 +6,24 @@
|
|||
<div class="autopagerize_page_element">
|
||||
<div class="content">
|
||||
<#include "module/post_entry.ftl">
|
||||
<#if posts.pages gt 1>
|
||||
<#if posts.totalPages gt 1>
|
||||
<div class="pagination">
|
||||
<ul class="clearfix">
|
||||
<#if posts.hasPrevious()>
|
||||
<#if posts.page == 1>
|
||||
<#if posts.number == 1>
|
||||
<li class="pre pagbuttons">
|
||||
<a class="btn" role="navigation" href="${options.blog_url!}/">上一页</a>
|
||||
</li>
|
||||
<#else >
|
||||
<li class="pre pagbuttons">
|
||||
<a class="btn" role="navigation" href="${options.blog_url!}/page/${posts.page}">上一页</a>
|
||||
<a class="btn" role="navigation" href="${options.blog_url!}/page/${posts.number}">上一页</a>
|
||||
</li>
|
||||
</#if>
|
||||
</#if>
|
||||
<#if posts.hasNext()>
|
||||
<li class="next pagbuttons">
|
||||
<a class="btn" role="navigation" href="${options.blog_url!}/page/${posts.page+2}">下一页</a>
|
||||
</li>
|
||||
<li class="next pagbuttons">
|
||||
<a class="btn" role="navigation" href="${options.blog_url!}/page/${posts.number+2}">下一页</a>
|
||||
</li>
|
||||
</#if>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<div class="page-top animated fadeInDown">
|
||||
<div class="nav">
|
||||
<@commonTag method="menus">
|
||||
<@menuTag method="list">
|
||||
<#list menus?sort_by('sort') as menu>
|
||||
<li>
|
||||
<a href="${menu.url}" target="${menu.target!}">${menu.name} </a>
|
||||
</li>
|
||||
</#list>
|
||||
</@commonTag>
|
||||
</@menuTag>
|
||||
</div>
|
||||
<div class="information">
|
||||
<div class="back_btn">
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<#if (options.anatole_style_hitokoto!'false')=="true">
|
||||
<p id="yiyan">获取中...</p>
|
||||
<#else >
|
||||
<p>${user.userDesc!'A other Halo theme'}</p>
|
||||
<p>${user.description!'A other Halo theme'}</p>
|
||||
</#if>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -6,24 +6,24 @@
|
|||
<div class="autopagerize_page_element">
|
||||
<div class="content">
|
||||
<#include "module/post_entry.ftl">
|
||||
<#if posts.pages gt 1>
|
||||
<#if posts.totalPages gt 1>
|
||||
<div class="pagination">
|
||||
<ul class="clearfix">
|
||||
<#if posts.hasPrevious()>
|
||||
<#if posts.number == 1>
|
||||
<li class="pre pagbuttons">
|
||||
<a class="btn" role="navigation" href="${options.blog_url!}/tags/${tag.slugName}">上一页</a>
|
||||
<a class="btn" role="navigation" href="${options.blog_url!}/">上一页</a>
|
||||
</li>
|
||||
<#else >
|
||||
<li class="pre pagbuttons">
|
||||
<a class="btn" role="navigation" href="${options.blog_url!}/tags/${tag.slugName}/page/${posts.page}">上一页</a>
|
||||
<a class="btn" role="navigation" href="${options.blog_url!}/page/${posts.number}">上一页</a>
|
||||
</li>
|
||||
</#if>
|
||||
</#if>
|
||||
<#if posts.hasNext()>
|
||||
<li class="next pagbuttons">
|
||||
<a class="btn" role="navigation" href="${options.blog_url!}/tags/${tag.slugName}/page/${posts.page+2}">下一页</a>
|
||||
</li>
|
||||
<li class="next pagbuttons">
|
||||
<a class="btn" role="navigation" href="${options.blog_url!}/page/${posts.number+2}">下一页</a>
|
||||
</li>
|
||||
</#if>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue