提交 12714717 编写于 作者: 智布道's avatar 智布道 👁

🐛 修复freemarker语法问题,去掉过时的语法、增加配置打印功能(需手动开启)

上级 d60e942b
......@@ -55,6 +55,9 @@ logging:
app:
# 是否启用kaptcha验证码
enableKaptcha: false
# 启用后,项目在启动时会打印数据库(Mysql和Redis)链接信息(包含密码)
# 代码请参考
enabledConfigLog: true
# shiro配置项
shiro:
loginUrl: "/passport/login/"
......
......@@ -54,6 +54,9 @@ logging:
app:
# 是否启用kaptcha验证码
enableKaptcha: false
# 启用后,项目在启动时会打印数据库(Mysql和Redis)链接信息(包含密码)
# 代码请参考
enabledConfigLog: false
# shiro配置项
shiro:
loginUrl: "/passport/login/"
......
......@@ -15,7 +15,7 @@
<div class="<#--table-responsive-->">
<div class="btn-group hidden-xs" id="toolbar">
<@shiro.hasPermission name="article:publish">
<a class="btn btn-success" title="发表文章" href="${(config.articleEditor?if_exists == 'md')?string('/article/publishMd', '/article/publish')}"> <i class="fa fa-pencil fa-fw"></i> </a>
<a class="btn btn-success" title="发表文章" href="${(config.articleEditor! == 'md')?string('/article/publishMd', '/article/publish')}"> <i class="fa fa-pencil fa-fw"></i> </a>
</@shiro.hasPermission>
<@shiro.hasPermission name="article:batchDelete">
<button id="btn_delete_ids" type="button" class="btn btn-danger" title="删除选中">
......
......@@ -529,7 +529,7 @@
</div>
<div class="modal-body">
<@zhydTag method="template" key="TM_NGINX_FILE_SERVER">
<#if template?if_exists>
<#if template!>
<textarea class="form-control" rows="15" cols="">${template.refValue}</textarea>
<#else>
<textarea class="form-control" placeholder="暂无可参考的配置" disabled readonly></textarea>
......
......@@ -143,7 +143,7 @@
<div class="x_content" id="statistics-article-list">
<ul class="list-unstyled">
<@articleTag method="hotList" pageSize="10">
<#if hotList?exists && (hotList?size > 0)>
<#if hotList?? && (hotList?size > 0)>
<#list hotList as item>
<li class="title word-prase"><a href="${config.siteUrl}/article/${item.id?c}" title="${item.title}">${item.title}</a></li>
<li class="count"><span title="浏览人次:${item.lookCount?c}">${item.lookCount?c}</span></li>
......@@ -193,7 +193,7 @@
</thead>
<tbody>
<@articleTag method="recentArticles" pageSize="5">
<#if recentArticles?exists && (recentArticles?size > 0)>
<#if recentArticles?? && (recentArticles?size > 0)>
<#list recentArticles as item>
<tr>
<th class="title"><div class="word-prase"><a href="${config.siteUrl}/article/${item.id?c}" title="${item.title}">${item.title}</a></div></th>
......@@ -232,12 +232,12 @@
</thead>
<tbody>
<@zhydTag method="recentComments" pageSize="5">
<#if recentComments?exists && (recentComments?size > 0)>
<#if recentComments?? && (recentComments?size > 0)>
<#list recentComments as item>
<tr>
<th class="title word-prase"><div><a href="${item.url}" target="_blank" rel="external nofollow">${item.nickname?if_exists}</a></div></th>
<td class="content"><div class="word-prase">${item.briefContent?if_exists}</div></td>
<td class="source"><div class="word-prase"><a href="${config.siteUrl}${item.sourceUrl}#comment-${item.id?c}" target="_blank" rel="external nofollow">${item.articleTitle?if_exists}</a></div></td>
<th class="title word-prase"><div><a href="${item.url}" target="_blank" rel="external nofollow">${item.nickname!}</a></div></th>
<td class="content"><div class="word-prase">${item.briefContent!}</div></td>
<td class="source"><div class="word-prase"><a href="${config.siteUrl}${item.sourceUrl}#comment-${item.id?c}" target="_blank" rel="external nofollow">${item.articleTitle!}</a></div></td>
<td>${item.createTime?string('yyyy-MM-dd')}</td>
</tr>
</#list>
......
......@@ -8,7 +8,7 @@
<ul class="nav navbar-nav navbar-right">
<li class="">
<a href="javascript:;" class="user-profile dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<img src="/assets/images/loading.gif" alt=""><#if user?exists>${user.username?if_exists}<#else>管理员</#if>
<img src="/assets/images/loading.gif" alt=""><#if user??>${user.username!}<#else>管理员</#if>
<span class=" fa fa-angle-down"></span>
</a>
<ul class="dropdown-menu dropdown-usermenu pull-right">
......@@ -58,7 +58,7 @@
</li>
</@shiro.hasPermission>
<li>
<a href="${config.siteUrl?if_exists}" target="_blank">
<a href="${config.siteUrl!}" target="_blank">
<i class="fa fa-desktop"> 访问前台</i>
</a>
</li>
......@@ -109,7 +109,7 @@
</div>
<div class="modal-body">
<form action="" class="form-horizontal form-label-left" role="form" id="updPassForm">
<input type="hidden" name="id" value="<#if user?exists>${user.id?c}</#if>">
<input type="hidden" name="id" value="<#if user??>${user.id?c}</#if>">
<div class="item form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-3" for="password">旧密码 <span
class="required">*</span></label>
......
......@@ -10,21 +10,21 @@
<#list menus as item>
<#if item.nodes?? && item.nodes?size gt 0>
<li>
<a><i class="${item.icon?if_exists}"></i> ${item.name?if_exists}<span class="fa fa-chevron-down"></span></a>
<a><i class="${item.icon!}"></i> ${item.name!}<span class="fa fa-chevron-down"></span></a>
<ul class="nav child_menu">
<#list item.nodes as node>
<#if node.permission?if_exists>
<@shiro.hasPermission name="${node.permission?if_exists}">
<li><a href="${node.url?if_exists}" ${(item.external?exists && item.external)?string('target="_blank"','')}><i class="${node.icon?if_exists}"></i>${node.name?if_exists}</a></li>
<#if node.permission!>
<@shiro.hasPermission name="${node.permission!}">
<li><a href="${node.url!}" ${(item.external?? && item.external)?string('target="_blank"','')}><i class="${node.icon!}"></i>${node.name!}</a></li>
</@shiro.hasPermission>
<#else>
<li><a href="${node.url?if_exists}" ${(item.external?exists && item.external)?string('target="_blank"','')}><i class="${node.icon?if_exists}"></i>${node.name?if_exists}</a></li>
<li><a href="${node.url!}" ${(item.external?? && item.external)?string('target="_blank"','')}><i class="${node.icon!}"></i>${node.name!}</a></li>
</#if>
</#list>
</ul>
</li>
<#else>
<li><a href="${item.url?if_exists}" ${(item.external?exists && item.external)?string('target="_blank"','')}><i class="${item.icon?if_exists}"></i>${item.name?if_exists}</a></li>
<li><a href="${item.url!}" ${(item.external?? && item.external)?string('target="_blank"','')}><i class="${item.icon!}"></i>${item.name!}</a></li>
</#if>
</#list>
</#if>
......
......@@ -25,9 +25,9 @@
<section class="login_content">
<form action="/passport/signin" method="POST" id="login-form">
<h1>登录管理系统</h1>
<#if message?exists>
<#if message??>
<div class="alert alert-danger" role="alert">
${message?if_exists}
${message!}
</div>
</#if>
<div>
......@@ -36,7 +36,7 @@
<div>
<input type="password" class="form-control" placeholder="请输入密码" name="password" required=""/>
</div>
<#if enableKaptcha?exists && enableKaptcha>
<#if enableKaptcha?? && enableKaptcha>
<div class="form-group col-xs-6" style="padding-left: 0px;">
<img alt="点击获取验证码" id="img-kaptcha" src="/getKaptcha" style="cursor:pointer;height: 34px;width: 180px;">
</div>
......
package com.zyd.blog.framework.runner;
import com.zyd.blog.framework.property.RedisProperties;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.context.ContextLoaderListener;
import javax.servlet.ServletContextEvent;
/**
* 程序启动后通过ApplicationRunner处理一些事务
......@@ -17,13 +26,50 @@ import org.springframework.stereotype.Component;
*/
@Slf4j
@Component
public class BlogApplicationRunner implements ApplicationRunner {
public class BlogApplicationRunner extends ContextLoaderListener implements ApplicationRunner {
@Value("${server.port}")
private int port;
@Value("${spring.profiles.active}")
private String profile;
@Value("${app.enabledConfigLog}")
private Boolean enabledConfigLog;
@Autowired
private DataSourceProperties dataSourceProperties;
@Autowired
private RedisProperties redisProperties;
@Autowired
private ConfigurableApplicationContext configurableApplicationContext;
@Override
public void run(ApplicationArguments applicationArguments) {
log.info("博客部署完成,博客访问地址:http://localhost:" + port);
}
@Override
public void contextInitialized(ServletContextEvent event) {
if (null != enabledConfigLog && enabledConfigLog) {
log.info("博客关键配置信息:");
String[] activeProfiles = configurableApplicationContext.getEnvironment().getActiveProfiles();
if (ObjectUtils.isEmpty(activeProfiles)) {
String[] defaultProfiles = configurableApplicationContext.getEnvironment().getDefaultProfiles();
log.info("No active profile set, falling back to default profiles: " + StringUtils.arrayToCommaDelimitedString(defaultProfiles));
} else {
log.info("The following profiles are active: " + StringUtils.arrayToCommaDelimitedString(activeProfiles));
}
log.info("Data Source:");
log.info(" - url:{}", dataSourceProperties.getUrl());
log.info(" - username:{}", dataSourceProperties.getUsername());
log.info(" - password:{}", dataSourceProperties.getPassword());
log.info("Redis:");
log.info(" - database:{}", redisProperties.getDatabase());
log.info(" - host:{}", redisProperties.getHost());
log.info(" - port:{}", redisProperties.getPort());
log.info(" - password:{}", redisProperties.getPassword());
}
}
}
......@@ -283,15 +283,4 @@ public class RenderController {
return ResultUtil.view("updateLog");
}
/**
* 测试websocket
*
* @return
*/
@GetMapping("/testWebsocket")
@BussinessLog(value = "进入测试websocket页", platform = PlatformEnum.WEB)
public ModelAndView testWebsocket() {
return new ModelAndView("testWebsocket");
}
}
......@@ -64,6 +64,9 @@ braum:
app:
# 是否启用kaptcha验证码
enableKaptcha: false
# 启用后,项目在启动时会打印数据库(Mysql和Redis)链接信息(包含密码)
# 代码请参考
enabledConfigLog: true
me:
zhyd:
......
......@@ -6,6 +6,7 @@ server:
spring:
profiles:
include: [center-test]
active:
# 指定默认MimeMessage的编码,默认为: UTF-8
mail:
default-encoding: UTF-8
......@@ -64,6 +65,9 @@ braum:
app:
# 是否启用kaptcha验证码
enableKaptcha: false
# 启用后,项目在启动时会打印数据库(Mysql和Redis)链接信息(包含密码)
# 代码请参考
enabledConfigLog: false
me:
zhyd:
......
<#include "include/macros.ftl">
<@compress single_line=true>
<@header title="关于 | ${config.siteName}" keywords="${config.siteName},关于博客" description="一个程序员的个人博客,关于我的个人原创博客 - ${config.siteName}" canonical="/about"></@header>
<@header title="关于 | ${config.siteName}" description="关于${config.siteName}" canonical="/about"></@header>
<div class="container custome-container">
<nav class="breadcrumb">
......
<#include "include/macros.ftl">
<@compress single_line=true>
<@header title="归档目录 | ${config.siteName}" keywords="归档目录" description="归档目录" canonical="/archives"></@header>
<@header title="归档目录 | ${config.siteName}" description="归档目录" canonical="/archives"></@header>
<div class="container custome-container">
<nav class="breadcrumb">
......
<#include "include/macros.ftl">
<@header title="${article.title} | ${config.siteName}" keywords="${article.keywords?if_exists},${config.siteName}" description="${article.description?if_exists}" canonical="/article/${article.id}" hasEditor=true></@header>
<#if article.coverImage?exists>
<img src="${article.coverImage?if_exists}" onerror="this.src='${config.staticWebSite}/img/default_article_cover.jpg'" style="display: none;" id="cover-img">
<@header title="${article.title} | ${config.siteName}" keywords="${article.keywords!},${config.siteName}" description="${article.description!}"
canonical="/article/${article.id}" hasEditor=true></@header>
<#if article.coverImage??>
<img src="${article.coverImage!}" onerror="this.src='${config.staticWebSite}/img/default_article_cover.jpg'" style="display: none;" id="cover-img">
</#if>
<div class="container custome-container">
<nav class="breadcrumb">
......@@ -134,12 +135,12 @@
<h5 class="custom-title"><i class="fa fa-fire fa-fw icon"></i><strong>热门推荐</strong><small></small></h5>
<ul class="list-unstyled">
<@articleTag method="hotList" pageSize="10">
<#if hotList?exists && (hotList?size > 0)>
<#if hotList?? && (hotList?size > 0)>
<#list hotList as item>
<li class="line-li">
<div class="line-container">
<div class="line-left">
<#if item.coverImage?exists>
<#if item.coverImage??>
<img class="lazy-img" data-original="${item.coverImage}" width="50" height="50" rel="external nofollow"/>
<#else>
<img class="lazy-img" data-original="${config.staticWebSite}/img/favicon.ico" width="50" height="50" rel="external nofollow"/>
......
<#include "include/macros.ftl">
<@compress single_line=true>
<@header title="免责声明 | ${config.siteName}" keywords="免责声明" description="免责声明" canonical="/disclaimer"></@header>
<@header title="免责声明 | ${config.siteName}" keywords="" description="免责声明" canonical="/disclaimer"></@header>
<div class="container custome-container">
<nav class="breadcrumb">
......
<#include "include/macros.ftl">
<@compress single_line=true>
<@header title="留言板 | ${config.siteName}"
keywords="${config.siteName},留言板,原创博客留言,个人原创网站,个人技术博客"
description="我的留言板,欢迎给我的个人原创博客留言 - ${config.siteName}"
canonical="/guestbook" hasEditor=true>
<@header title="留言板 | ${config.siteName}" canonical="/guestbook" hasEditor=true>
</@header>
<div class="container custome-container">
......@@ -24,7 +21,7 @@
</div>
</div>
</div>
<#if config.comment?if_exists && config.comment == 1>
<#if config.comment! && config.comment == 1>
<div class="col-sm-12 blog-main">
<div class="blog-body expansion">
<div id="comment-box" data-id="-1"></div>
......
......@@ -46,9 +46,9 @@
<#-- 分页组件 -->
<#macro pageBar>
<#if page?exists && (page.pages > 1)>
<#if page?? && (page.pages > 1)>
<nav class="pagination"
data-url="${config.siteUrl}/${url?if_exists}"
data-url="${config.siteUrl}/${url!}"
data-search="${(model.keywords == null || model.keywords == '')?string('false', 'true')}"
data-total-page="${page.pages?c}"
data-current-page="${page.pageNum?c}"
......@@ -78,7 +78,7 @@
<#-- 页面顶部菜单下方提示栏 -->
<#macro prompt>
<!--[if lt IE 9]><div class="alert alert-danger topframe" role="alert">Oh My God!你的浏览器实在<strong>太太太太太太旧了</strong>,赶紧升级浏览器 <a target="_blank" class="alert-link" href="http://browsehappy.com">立即升级</a></div><![endif]-->
<#if config.maintenance?if_exists && config.maintenance == 1>
<#if config.maintenance! && config.maintenance == 1>
<div class="alert alert-warning fade-in" role="alert">
<a href="#" class="close" data-dismiss="alert">&times;</a>
系统预计将在<strong>${config.maintenanceDate}</strong>左右进行更新维护,届时网站将无法使用,更新大约持续${config.maintenanceTime!(30)}分钟,敬请悉知。
......@@ -88,15 +88,15 @@
<#-- 赞赏 -->
<#macro praise>
<#if config.wxPraiseCode?if_exists || config.zfbPraiseCode?if_exists>
<#if config.wxPraiseCode! || config.zfbPraiseCode!>
<h5 class="custom-title"><i class="fa fa-dollar fa-fw"></i><strong>鼓励一下</strong><small></small></h5>
<div class="col-sm-12 col-md-12" style="float: initial;">
<#if config.zfbPraiseCode?if_exists>
<#if config.zfbPraiseCode!>
<a href="${config.zfbPraiseCode}" class="showImage" title="支付宝收钱码" rel="external nofollow">
<img src="${config.zfbPraiseCode}" alt="支付宝收钱码" class="img-rounded" style="width: 250px;height: auto;">
</a>
</#if>
<#if config.wxPraiseCode?if_exists>
<#if config.wxPraiseCode!>
<a href="${config.wxPraiseCode}" class="showImage" title="微信收钱码" rel="external nofollow">
<img src="${config.wxPraiseCode}" alt="微信收钱码" class="img-rounded" style="width: 250px;height: auto;">
</a>
......
<#include "include/macros.ftl">
<@compress single_line=true>
<@header title="${config.siteName?if_exists} | 一个程序员的个人博客"
keywords="${config.homeKeywords?if_exists}"
description="${config.homeDesc?if_exists}"
canonical="/${url?if_exists}">
<@header title="${config.siteName!} | 一个程序员的个人博客"
keywords="${config.homeKeywords!}"
description="${config.homeDesc!}"
canonical="/${url!}">
</@header>
<div class="container custome-container">
......@@ -29,7 +29,7 @@
<div class="row">
<div class="col-sm-8 blog-main">
<@articleTag method="recommendedList" pageSize="8">
<#if recommendedList?exists && (recommendedList?size > 0)>
<#if recommendedList?? && (recommendedList?size > 0)>
<div class="blog-body expansion" style="padding: 0;">
<div id="myCarousel" class="carousel slide" style="height:300px;">
<ol class="carousel-indicators">
......@@ -59,15 +59,15 @@
</div>
</#if>
</@articleTag>
<#if page.list?exists && (page.list?size > 0)>
<#if page.list?? && (page.list?size > 0)>
<#list page.list as item>
<article class="fade-in">
<figure class="thumbnail">
<a href="${config.siteUrl}/article/${item.id?c}">
<#if item.coverImage?exists && (item.coverImage?length > 7)>
<img width="150" height="150" data-original="${item.coverImage}" class="img-responsive lazy-img" alt="${item.title?if_exists}">
<#if item.coverImage?? && (item.coverImage?length > 7)>
<img width="150" height="150" data-original="${item.coverImage}" class="img-responsive lazy-img" alt="${item.title!}">
<#else>
<img width="150" height="150" data-original="${config.staticWebSite}/img/user/11.jpg" class="img-responsive lazy-img" alt="${item.title?if_exists}">
<img width="150" height="150" data-original="${config.staticWebSite}/img/user/11.jpg" class="img-responsive lazy-img" alt="${item.title!}">
</#if>
</a>
<span class="cat"><a href="${config.siteUrl}/type/${item.typeId?c}">${item.type.name}</a></span>
......@@ -79,7 +79,7 @@
</header>
<div class="entry-content">
<div class="archive-content">
${item.description?if_exists}
${item.description!}
</div>
<span class="title-l"></span>
<span class="entry-meta">
......
......@@ -116,15 +116,15 @@
<li><a href="${config.siteUrl}/disclaimer" title="免责声明" data-toggle="tooltip" data-placement="bottom"><i class="fa fa-file-o fa-fw"></i>免责声明</a></li>
</ul>
</p>
<p>托管于<a href="https://promotion.aliyun.com/ntms/act/ambassador/sharetouser.html?userCode=wylo59db" target="_blank" title="阿里云-为了无法计算的价值" data-toggle="tooltip" data-placement="bottom" rel="external nofollow">阿里云</a> & <a href="https://portal.qiniu.com/signup?code=3l8yx2v0f21ci" target="_blank" title="七牛云-国内领先的企业级云服务商" data-toggle="tooltip" data-placement="bottom" rel="external nofollow">七牛云</a><#if config.recordNumber?if_exists> · <a href="http://www.miitbeian.gov.cn/publish/query/indexFirst.action" target="_blank" title="查看备案信息" data-toggle="tooltip" data-placement="bottom" rel="external nofollow">${config.recordNumber}</a></#if></p>
<p><#if config.copyright?if_exists>${config.copyright} |</#if> Powered by <a href="https://gitee.com/yadong.zhang/DBlog" title="OneBlog是一款简洁美观、自适应的Java博客系统..." data-toggle="tooltip" data-placement="right" target="_blank"><i>OneBlog</i></a> </p>
<#if url?exists && (url == "index")>
<p>托管于<a href="https://promotion.aliyun.com/ntms/act/ambassador/sharetouser.html?userCode=wylo59db" target="_blank" title="阿里云-为了无法计算的价值" data-toggle="tooltip" data-placement="bottom" rel="external nofollow">阿里云</a> & <a href="https://portal.qiniu.com/signup?code=3l8yx2v0f21ci" target="_blank" title="七牛云-国内领先的企业级云服务商" data-toggle="tooltip" data-placement="bottom" rel="external nofollow">七牛云</a><#if config.recordNumber!> · <a href="http://www.miitbeian.gov.cn/publish/query/indexFirst.action" target="_blank" title="查看备案信息" data-toggle="tooltip" data-placement="bottom" rel="external nofollow">${config.recordNumber}</a></#if></p>
<p><#if config.copyright!>${config.copyright} |</#if> Powered by <a href="https://gitee.com/yadong.zhang/DBlog" title="OneBlog是一款简洁美观、自适应的Java博客系统..." data-toggle="tooltip" data-placement="right" target="_blank"><i>OneBlog</i></a> </p>
<#if url?? && (url == "index")>
<div class="inline external-links">
<a>友情链接:</a>
<#if indexLinkList?exists && (indexLinkList?size > 0)>
<#if indexLinkList?? && (indexLinkList?size > 0)>
<#list indexLinkList as item>
<a href="${item.url}" target="_blank" title="${item.description?if_exists}" data-toggle="tooltip" data-placement="right">
${item.name?if_exists}
<a href="${item.url}" target="_blank" title="${item.description!}" data-toggle="tooltip" data-placement="right">
${item.name!}
</a>
</#list>
<a href="${config.siteUrl}/links" title="更多链接" data-toggle="tooltip" data-placement="right"><i class="fa fa-plus"></i>更多链接</a>
......
......@@ -11,10 +11,10 @@
<li><a href="${config.siteUrl}/about" class="menu_a" title="关于博客" data-toggle="tooltip" data-placement="bottom">关于本站</a></li>
<li><a href="${config.siteUrl}/links" class="menu_a" title="友情链接" data-toggle="tooltip" data-placement="bottom">友情链接</a></li>
</ul>
<#if user?exists>
<#if user??>
<ul class="list-unstyled list-inline nav navbar-nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle menu_a" data-toggle="dropdown" aria-expanded="false"><i class="fa fa-user fa-fw"></i>${user.username?if_exists} <span class="caret"></span></a>
<a href="#" class="dropdown-toggle menu_a" data-toggle="dropdown" aria-expanded="false"><i class="fa fa-user fa-fw"></i>${user.username!} <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="/oauth/logout"><i class="fa fa-sign-out"></i>退出</a></li>
</ul>
......@@ -161,19 +161,19 @@
<@zhydTag method="types">
<#if types?? && types?size gt 0>
<#list types as item>
<#if item.nodes?exists && item.nodes?size gt 0>
<#if item.nodes?? && item.nodes?size gt 0>
<li class="dropdown">
<a href="#" class="dropdown-toggle menu_a" data-toggle="dropdown" aria-expanded="false">
<i class="${item.icon?if_exists}"></i>${item.name?if_exists} <span class="caret"></span>
<i class="${item.icon!}"></i>${item.name!} <span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<#list item.nodes as node>
<li><a href="/type/${node.id?c}" title="点击查看《${node.name?if_exists}》的文章">${node.name?if_exists}</a></li>
<li><a href="/type/${node.id?c}" title="点击查看《${node.name!}》的文章">${node.name!}</a></li>
</#list>
</ul>
</li>
<#else>
<li><a href="/type/${item.id?c}" class="menu_a"><i class="${item.icon?if_exists}"></i>${item.name?if_exists}</a></li>
<li><a href="/type/${item.id?c}" class="menu_a"><i class="${item.icon!}"></i>${item.name!}</a></li>
</#if>
</#list>
</#if>
......
<div class="col-sm-3 blog-sidebar">
<#if articleDetail?exists>
<#if articleDetail??>
<div class="sidebar-module">
<h5 class="custom-title"><i class="fa fa-hand-peace-o fa-fw icon"></i><strong>说给你听</strong><small></small></h5>
<div class="div-quote">
......@@ -16,7 +16,7 @@
<div class="about-main">
<div class="about-img"><a href="${config.wxCode}" class="showImage" title="微信公众号"><img src="${config.wxCode}" alt="微信公众号"></a></div>
<div class="about-name">${config.siteName}</div>
<div class="about-the">${config.siteDesc?if_exists}</div>
<div class="about-the">${config.siteDesc!}</div>
</div>
<div class="clear"></div>
<!-- 方案一:图标展示 -->
......@@ -56,10 +56,10 @@
<div class="sidebar-module">
<h5 class="custom-title"><i class="fa fa-tags fa-fw icon"></i><strong>标签云</strong><small></small></h5>
<@zhydTag method="tagsList" pageSize="10">
<#if tagsList?exists && (tagsList?size > 0)>
<#if tagsList?? && (tagsList?size > 0)>
<#list tagsList as item>
<a style="font-size: <@zhydTag method="random" max="15" min="10">${random}</@zhydTag>px;margin: 5px;" href="${config.siteUrl}/tag/${item.id?c}" title="${item.name?if_exists}" data-toggle="tooltip" data-placement="bottom">
${item.name?if_exists}
<a style="font-size: <@zhydTag method="random" max="15" min="10">${random}</@zhydTag>px;margin: 5px;" href="${config.siteUrl}/tag/${item.id?c}" title="${item.name!}" data-toggle="tooltip" data-placement="bottom">
${item.name!}
</a>
</#list>
</#if>
......@@ -72,9 +72,9 @@
<ul class="list-unstyled list-inline comments">
<#list recentComments as item>
<li>
<a href="${item.sourceUrl}#comment-${item.id?c}" title="${item.briefContent?if_exists}" rel="external nofollow" data-toggle="tooltip" data-placement="bottom">
<img alt="${item.nickname?if_exists}" src="${item.avatar?if_exists}" class="avatar auto-shake" height="64" width="64" onerror="this.src='${config.staticWebSite}/img/user.png'" />
<span class="comment-author">${item.nickname?if_exists}</span> ${item.briefContent?if_exists}
<a href="${item.sourceUrl}#comment-${item.id?c}" title="${item.briefContent!}" rel="external nofollow" data-toggle="tooltip" data-placement="bottom">
<img alt="${item.nickname!}" src="${item.avatar!}" class="avatar auto-shake" height="64" width="64" onerror="this.src='${config.staticWebSite}/img/user.png'" />
<span class="comment-author">${item.nickname!}</span> ${item.briefContent!}
</a>
</li>
</#list>
......@@ -92,7 +92,7 @@
<div role="tabpanel" class="tab-pane active" id="profile">
<ol class="list-unstyled">
<@articleTag method="recentArticles" pageSize="10">
<#if recentArticles?exists && (recentArticles?size > 0)>
<#if recentArticles?? && (recentArticles?size > 0)>
<#list recentArticles as item>
<li>
<a href="${config.siteUrl}/article/${item.id?c}" title="${item.title}" data-toggle="tooltip" data-placement="bottom">
......@@ -111,7 +111,7 @@
<div role="tabpanel" class="tab-pane" id="home">
<ol class="list-unstyled">
<@articleTag method="recommendedList" pageSize="10">
<#if recommendedList?exists && (recommendedList?size > 0)>
<#if recommendedList?? && (recommendedList?size > 0)>
<#list recommendedList as item>
<li>
<a href="${config.siteUrl}/article/${item.id?c}" title="${item.title}" data-toggle="tooltip" data-placement="bottom">
......@@ -130,7 +130,7 @@
<div role="tabpanel" class="tab-pane" id="messages">
<ol class="list-unstyled">
<@articleTag method="randomList" pageSize="10">
<#if randomList?exists && (randomList?size > 0)>
<#if randomList?? && (randomList?size > 0)>
<#list randomList as item>
<li>
<a href="${config.siteUrl}/article/${item.id?c}" title="${item.title}" data-toggle="tooltip" data-placement="bottom">
......
<#include "include/macros.ftl">
<@compress single_line=true>
<@header title="友情链接 | ${config.siteName}"
keywords="${config.siteName},友情链接交换"
description="${config.siteName},一个程序员的个人原创博客,友情链接交换"
description="${config.siteName},友情链接交换"
canonical="/links">
</@header>
......
<#include "include/macros.ftl">
<@compress single_line=true>
<@header title="站长推荐 | ${config.siteName}"
keywords="站长推荐"
description="站长推荐"
canonical="/recommended">
</@header>
......@@ -13,7 +12,7 @@
</nav>
<div class="row">
<div class="col-sm-8">
<#if list?exists && (list?size > 0)>
<#if list?? && (list?size > 0)>
<article class="fade-in recommended-articles">
<ul class="list-unstyled">
<#list list as item>
......
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="baidu-site-verification" content="d4kcdwiGHw" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="${config.authorName} <${config.authorEmail}>">
<title>${config.siteName} | 一个程序员的个人博客</title>
<link rel="canonical" href="${config.siteUrl}" />
<#include "layout/quote.ftl">
</head>
<body>
<#include "layout/header.ftl"/>
<div class="container custome-container">
<div class="row">
<div class="col">
<form>
<div class="form-group">
<label for="comment">聊天框 </label> <textarea class="form-control" rows="5" id="text"></textarea>
</div>
<div class="form-group">
<button onclick="$.websocket.send($('#text').val())" type="button" class="btn btn-primary">发送</button>
<button onclick="$.websocket.close()" type="button" class="btn btn-danger">关闭</button>
</div>
<div>
<ul class="list-group" id="message"></ul>
</div>
</form>
</div>
</div>
</div>
<#include "layout/footer.ftl"/>
<script>
//将消息显示在网页上
function setMessageInnerHTML(innerHTML) {
$("#message").append("<li class=\"list-group-item\">" + innerHTML + "</li>");
}
$.websocket.open({
host: "ws://localhost:8443/websocket",
reconnect: true,
callback: setMessageInnerHTML
});
</script>
</body>
</html>
<#include "include/macros.ftl">
<@compress single_line=true>
<@header title="网站更新记录 | 一个程序员的个人博客"
keywords=""
<@header title="网站更新记录 | ${config.siteName!}"
description="网站更新维护日志"
canonical="/updateLog">
</@header>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册