Skip to content

Commit

Permalink
🎨 处理头像/logo/banner为空的情况
Browse files Browse the repository at this point in the history
  • Loading branch information
qinhua committed Nov 14, 2021
1 parent fff7676 commit 37575ff
Show file tree
Hide file tree
Showing 57 changed files with 425 additions and 349 deletions.
24 changes: 0 additions & 24 deletions .github/ISSUE_TEMPLATE/----.md

This file was deleted.

38 changes: 0 additions & 38 deletions .github/ISSUE_TEMPLATE/--.md

This file was deleted.

45 changes: 45 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
name: 缺陷清单
about: 帮助我们解决存在的问题
title: ""
labels: bug
assignees: ""
---

**描述缺陷**

请简洁而清晰的描述一下这个缺陷。

**如何复现**

复现步骤如下:

1. 打开 "xxx"
2. 点击 "xxx"
3. 滚动到 "xxx"
4. 发生错误

**期望结果**

简洁而清晰的描述一下你最终期望的结果。

**截图**

如有需要,可以附上一些截图。

**PC 端 (请提供以下信息):**

- 操作系统:[e.g. iOS]
- 浏览器:[e.g. chrome, safari]
- 版本:[e.g. 22]

**移动端 (请提供以下信息):**

- 设备型号:[e.g. iPhone6]
- 操作系统:[e.g. iOS8.1]
- 浏览器:[e.g. stock browser, safari]
- 版本:[e.g. 22]

**额外信息**

可以添加一些额外的对我们处理这个问题有帮助的信息。
26 changes: 15 additions & 11 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
---
name: Feature request
about: Suggest an idea for this project
name: 功能建议
about: 为项目提供一些功能上的建议
title: ''
labels: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**你的建议是否涉及到一些现有的问题? 请描述清楚**

**Describe the solution you'd like**
A clear and concise description of what you want to happen.
简单而清晰的问题描述(例如:当我 xxx 时,我感到很疑惑)。

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**描述你想实现的效果**

**Additional context**
Add any other context or screenshots about the feature request here.
简单并清晰的描述你想实现的效果是怎样的。

**描述一些方案**

简单描述一下你想到的方案有哪些。

**额外信息**

你可以提供一些额外的信息或截图给我们进行参考。
2 changes: 1 addition & 1 deletion 404.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
<body>
<div class="joe_page_404">
<div class="error">
<img src="${RES_BASE_URL!}/source/svg/404.svg" alt="404">
<img src="${BASE_RES_URL!}/source/svg/404.svg" alt="404">
<h3 class="title">“未找到您要的资源”</h3>
<a href="/" class="error_link">回到主页</a>
</div>
Expand Down
14 changes: 7 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,39 @@
### 代码贡献步骤

#### 0. 提交 Issue
#### 1. 提交 Issue

任何新功能或者功能改进建议都先提交 `issue` 讨论一下再进行开发,`bug` 修复可以直接提交 `pull request`

#### 1. Fork 此仓库
#### 2. Fork 此仓库

点击右上角的 `fork` 按钮即可。

#### 2. Clone 仓库到本地
#### 3. Clone 仓库到本地

```bash
git clone https://github.com/{YOUR_USERNAME}/halo-theme-joe2.0
```

#### 3. 创建新的开发分支
#### 4. 创建新的开发分支

```bash
git checkout -b {BRANCH_NAME}
```

#### 4. 提交代码
#### 5. 提交代码

```bash
git push origin {BRANCH_NAME}
```

#### 5. 提交 pull request
#### 6. 提交 pull request

回到自己的仓库页面,选择 `New pull request` 按钮,创建 `Pull request` 到原仓库的 `master` 分支。

然后等待我们 `Review` 即可,如有 `Change Request`,在本地修改之后再次提交即可。

#### 6. 更新主仓库代码到自己的仓库
#### 7. 更新主仓库代码到自己的仓库

```bash
git remote add upstream https://github.com/qinhua/halo-theme-joe2.0.git
Expand Down
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@

Tip:如果你后台管理中之前已经配置了其它的 `Access Key`(内容不是 `joe2.0`),那么需要你到本主题设置中的 `基本设置` 配置一下 `AccessKey<必填>`,和你后台中的一致即可(切记一致才行,且不要填写中文或特殊字符)。

- 主题升级后配置项变化较大时可能报错,导致页面渲染不出来。只需要进入当前主题的设置界面执行一下保存操作来更新旧的配置,然后再访问页面即可,有时可能需要先切换到其它主题后再切回来才能看到最新的效果。
- 主题升级后配置项变化较大时可能报错,导致页面渲染不出来。只需要进入当前主题的设置界面执行一下保存操作来更新旧的配置,然后再访问页面即可

- 有时主题已经更新成功了,但是页面还是加载的旧版本的文件,可能是由于 `主题激活状态不正常` 导致的。此时只需要先切换到其他主题再切回来即可。或者可以试着重启下后台试试。

- 刷新时记得打开控制台进行强刷,避免潜在缓存的影响,`CDN缓存` 也要及时清除。

Expand Down Expand Up @@ -229,7 +231,11 @@
#### 1、如何自定义导航条图标?

> 主题自身已经引入了部分 `iconfont` 图标,你可以直接用。[全在这里](https://bbchin.com/iconfont-joe2.0/)
> 主题自身已经引入了部分 `iconfont` 图标,你可以直接用([全在这里](https://bbchin.com/iconfont-joe2.0/)),如果想在这个基础上增加图标,可联系我加入该项目的图标组。`iconfont` 使用方式如下:
```html
<i class="joe-font joe-icon-xxx"></i>
```

- 首先通过 [iconfont](https://www.iconfont.cn/) 获取自己的图标链接,也可以用 [fontawesome](http://www.fontawesome.com.cn/) 的字体,注意要使用 `font-class` 类型,最后这种地址://at.alicdn.com/t/font_2788564_1f1rnuqwnzj.css

Expand Down Expand Up @@ -271,11 +277,11 @@ Halo 已经提供好了邮件服务,我们只需要配置相关参数即可。
<link
rel="preload stylesheet"
as="style"
href="${RES_BASE_URL}/source/css/min/joe.index.min.css?v=${theme.version!}"
href="${BASE_RES_URL}/source/css/min/joe.index.min.css?v=${theme.version!}"
/>
```

把其中的 `${RES_BASE_URL}` 修改为主题自身路径 `${theme_base!}` 即可。
把其中的 `${BASE_RES_URL}` 修改为主题自身路径 `${theme_base!}` 即可。

#### 7、如何通过元数据为文章详情页进行单独的功能配置?

Expand Down
2 changes: 1 addition & 1 deletion categories.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<div class="joe_index__hot categories">
<@categoryTag method="list">
<#if categories?size &gt;0>
<#assign lazy_img=RES_BASE_URL+'/source/img/lazyload.gif'>
<#assign lazy_img=BASE_RES_URL+'/source/img/lazyload.gif'>
<ul class="joe_index__hot-list animated fadeIn">
<#list categories as category>
<li class="item">
Expand Down
2 changes: 1 addition & 1 deletion category.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</div>
</div>
<#if posts.content?size &gt;0>
<#assign lazy_img=settings.lazyload_thumbnail!RES_BASE_URL+'/source/img/lazyload.gif'>
<#assign lazy_img=settings.lazyload_thumbnail!BASE_RES_URL+'/source/img/lazyload.gif'>
<ul class="joe_archive__list joe_list animated fadeIn">
<#list posts.content as post>
<li class="joe_list__item default">
Expand Down
12 changes: 9 additions & 3 deletions journals.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
<div class="joe_container joe_main_container page-journals">
<div class="joe_main">
<div class="joe_detail">
<h1 class="joe_detail__title txt-shadow">${title}</h1>
<h1 class="joe_detail__title txt-shadow">${title}</h1>
<#if settings.enable_journal_add!false>
<a class="joe_journal_add" href="${blog_url+'/admin/index.html#/sheets/journals'}" target="_blank" rel="nofollow"><i class="joe-font joe-icon-edit"></i></a>
</#if>
<div class="joe_detail__count">
<div class="joe_detail__count-information">
<img width="35" height="35" class="avatar lazyload" data-src="${user.avatar!}" src="${settings.lazyload_avatar!}" alt="${user.nickname!}">
Expand All @@ -32,7 +35,8 @@
<ul class="joe_journals__list${settings.enable_journal_effect?then(' effects','')}">
<#list journals.content as journal>
<li class="joe_journal__item animated wow" data-wow-delay="0.2s" data-cid="${journal.id}" data-clikes="${journal.likes}">
<p class="joe_journal_date"><i class="joe-font joe-icon-feather"></i>
<p class="joe_journal_date">
<i class="joe-font joe-icon-feather"></i>
<#-- <em class="joe_journal-posttime">${journal.createTime?string('yyyy-MM-dd HH:mm:ss')}</em> -->
<@global.timeline datetime=journal.createTime />
</p>
Expand Down Expand Up @@ -108,7 +112,9 @@
</@paginationTag>
</div>
</div>
<#include "template/common/aside.ftl">
<#if settings.enable_journals_aside!true>
<#include "template/common/aside.ftl">
</#if>
</div>
<#include "template/common/footer.ftl">
</div>
Expand Down
15 changes: 9 additions & 6 deletions links.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,28 @@
<span class="title">${link.name!}</span>
<div class="content">
<div class="desc" title="${link.description!}">${link.description!}</div>
<#assign logo_default=(settings.links_logo_default?? && settings.links_logo_default!='')?then(settings.links_logo_default, RES_BASE_URL+'/source/img/icon_qiye.png')>
<#assign logo_default=(settings.links_logo_default?? && settings.links_logo_default!='')?then(settings.links_logo_default, BASE_RES_URL+'/source/img/icon_qiye.png')>
<#assign logo=(link.logo?? && link.logo!='')?then(link.logo,logo_default)>
<img width="40" height="40" class="avatar owo_image lazyload" data-src="${logo!}" src="${RES_BASE_URL+'/source/svg/spinner-preloader.svg'}" onerror="this.src=${logo_default}" alt="${link.name!}">
<img width="40" height="40" class="avatar owo_image lazyload" data-src="${logo!}" src="${BASE_RES_URL+'/source/svg/spinner-preloader.svg'}" onerror="this.src='${logo_default}'" alt="${link.name!}">
</div>
</a>
</li>
<#assign nextRandom = nextRandom * 10 % 38>
</#list>
</ul>
<#else>
<div class="joe_nodata">暂无友链</div>
<div class="joe_nodata">${settings.links_empty_text!}</div>
</#if>
</@linkTag>
</article>
<article class="joe_detail__article animated fadeIn">
<h5>申请格式</h5>
<div class="link-requirement">
<p>
<joe-message type="info" content="博客名称 + 博客地址 + 博客Logo + 博客介绍,在留言栏目里留言即可。"></joe-message>
<joe-message type="info" content='<em style="font-style:normal;font-weight:bold;">< 博客名称 + 博客地址 + 博客Logo + 博客介绍 ></em><br>补充一下:logo 链接可直接使用短链接形式,如:<br>- 博客地址/logo<br>- 博客地址/avatar<br>(大家在留言栏目里留言即可)'></joe-message>
</p>
<blockquote class="joe_link__demo">博客名称:${blog_title!}<br>博客地址:<a href="${blog_url!}">${blog_url!}</a><br>博客介绍:${meta_description!}<br>博客Logo: <a href="${blog_logo!}">${blog_logo!}</a></blockquote>
<#assign logo_url = blog_url + '/logo'>
<blockquote class="joe_link__demo">博客名称:${blog_title!}<br>博客地址:<a href="${blog_url!}">${blog_url!}</a><br>博客Logo:<a href="${logo_url!!}">${logo_url!}</a><br>博客介绍:${meta_description!'这是一个非常牛逼的博客'}</blockquote>
</div>
</article>
</div>
Expand All @@ -53,7 +54,9 @@
<@global.comment target=links type="links" />
</div> -->
</div>
<#include "template/common/aside.ftl">
<#if settings.enable_links_aside!false>
<#include "template/common/aside.ftl">
</#if>
</div>
<#include "template/common/footer.ftl">
</div>
Expand Down
4 changes: 2 additions & 2 deletions mail_template/mail_notice.ftl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="email-page" style="background:#fff;">
<style>@media screen and (max-width:400px){.email-title{padding:14px 20px!important;}.email-title .icon{display:none;}}</style>
<style>@media screen and (max-width:400px){.email-content{width:94%!important;}.email-title{padding:12px 14px!important;font-size:15px!important;}.email-title .icon{display:none;}.email-text{padding:20px 20px 0!important;}.email-text pre{margin:10px 0!important;}.email-footer{padding:10px!important;}}</style>
<div class="email-content" style="width:90%;max-width:660px;margin:20px auto 30px;line-height:1.5;text-align:left;overflow:hidden;border-radius:8px;box-shadow:0 2px 12px 0 rgba(0,0,0,0.1);">
<div style="overflow:hidden;">
<h1 class="email-title" style="position:relative;margin:0;-webkit-box-sizing:border-box;box-sizing:border-box;padding:14px 52px 14px 20px;line-height:1.6;font-size:16px;font-weight:normal;color:#fff;background:webkit-linear-gradient(-45deg,rgba(9,69,138,0.2),rgba(255,241,68,0.7),rgba(233,131,71,0.79),rgba(227,54,54,0.86),rgba(9,69,138,0.2));background:linear-gradient(-45deg,rgba(9,69,138,0.2),rgba(255,241,68,0.7),rgba(233,131,71,0.79),rgba(227,54,54,0.86),rgba(9,69,138,0.2));background-size:400% 400%;background-position:50% 100%;">
Expand All @@ -13,7 +13,7 @@
<p style="margin:0 0 16px;padding:0;line-height:24px;font-size:13px;color:#6e6e6e;">
<a href="${pageFullPath!}" target="_blank" style="color:#5caaef;text-decoration:none;">点击查看完整内容</a>
</p>
</pre>
</div>
<div class="email-footer" style="padding:10px 20px;border-top:1px solid #eee;">
<p style="margin:0;padding:0;line-height:24px;font-size:13px;color:#999;">* 注意:此邮件由 <a href="${blog_url!}" target="_blank" style="color:#fa7e5b;text-decoration:none;">${blog_title!'xxx'}</a> 自动发出,请勿回复。</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion mail_template/mail_reply.ftl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="email-page" style="background:#fff;">
<style>@media screen and (max-width:500px){.email-title{padding:14px 20px!important;}.email-title .icon{display:none;}}</style>
<style>@media screen and (max-width:400px){.email-content{width:94%!important;}.email-title{padding:12px 14px!important;font-size:15px!important;}.email-title .icon{display:none;}.email-text{padding:20px 20px 0!important;}.email-text pre{margin:10px 0!important;}.email-footer{padding:10px!important;}}</style>
<div class="email-content" style="width:90%;max-width:660px;margin:20px auto 30px;line-height:1.5;text-align:left;overflow:hidden;border-radius:8px;box-shadow:0 2px 12px 0 rgba(0,0,0,0.1);">
<div style="overflow:hidden;">
<h1 class="email-title" style="position:relative;margin:0;-webkit-box-sizing:border-box;box-sizing:border-box;padding:14px 52px 14px 20px;line-height:1.6;font-size:16px;font-weight:normal;color:#fff;background:-webkit-linear-gradient(-45deg,rgba(9,69,138,0.2),rgba(68,155,255,0.7),rgba(117,113,251,0.7),rgba(68,155,255,0.7),rgba(9,69,138,0.2));background:linear-gradient(-45deg,rgba(9,69,138,0.2),rgba(68,155,255,0.7),rgba(117,113,251,0.7),rgba(68,155,255,0.7),rgba(9,69,138,0.2));background-size:400% 400%;background-position:50% 100%;">
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "halo-theme-joe2.0",
"version": "1.0.2",
"version": "1.0.3",
"description": "A halo theme joe2.0",
"main": "index.js",
"author": "BabyChin",
Expand Down
10 changes: 5 additions & 5 deletions plugins/live2d/ftl/live2d.ftl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<#macro live2d>
<link rel="stylesheet" type="text/css" href="${RES_BASE_URL}/plugins/live2d/css/takagi.min.css"/>
<link rel="stylesheet" type="text/css" href="${BASE_RES_URL}/plugins/live2d/css/takagi.min.css"/>
<#if settings.live2d_style??>
${settings.live2d_style!}
</#if>
Expand All @@ -17,10 +17,10 @@
</div>
</div>
<#if settings.live2d_takagiDraggable?? && settings.live2d_takagiDraggable!='disable'>
<script src="${RES_BASE_URL}/source/lib/jquery-ui/jquery-ui.min.js"></script>
<script src="${BASE_RES_URL}/source/lib/jquery-ui/jquery-ui.min.js"></script>
</#if>
<script src="${RES_BASE_URL}/plugins/live2d/js/takagi-tips.min.js"></script>
<script src="${RES_BASE_URL}/plugins/live2d/js/live2d.min.js"></script>
<script src="${BASE_RES_URL}/plugins/live2d/js/takagi-tips.min.js"></script>
<script src="${BASE_RES_URL}/plugins/live2d/js/live2d.min.js"></script>
<script>
var options = {
modelAPI: "${((settings.live2d_modelAPI!'')?length>0)?string((settings.live2d_modelAPI!''), '//live2d.fghrsh.net/api/')}",
Expand Down Expand Up @@ -58,7 +58,7 @@
l2dVersion: "${((settings.live2d_l2dVersion!'')?length>0)?string((settings.live2d_l2dVersion!''), '1.0.0')}",
l2dVerDate: "${((settings.live2d_l2dVerDate!'')?length>0)?string((settings.live2d_l2dVerDate!''), '2020.07.01')}",
homePageUrl: "${((blog_url!'')?length>0)?string((blog_url!''), 'auto')}",
aboutPageUrl: "${((settings.live2d_aboutPageUrl!'')?length>0)?string((settings.live2d_aboutPageUrl!''), 'https://lixingyong.com/s/halo-live2d')}",
aboutPageUrl: "${((settings.live2d_aboutPageUrl!'')?length>0)?string((settings.live2d_aboutPageUrl!''), 'https://github.com/LIlGG/halo-live2d')}",
screenshotCaptureName: "${((settings.live2d_screenshotCaptureName!'')?length>0)?string((settings.live2d_screenshotCaptureName!''), 'live2d.png')}"
}
initModel("", options);
Expand Down
Loading

0 comments on commit 37575ff

Please sign in to comment.