Skip to content

Commit

Permalink
update to 1.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
HeskeyBaozi committed May 4, 2018
1 parent f26a62b commit b880a52
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 17 deletions.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,12 @@ Edit the file [lite/__config.yml](https://github.com/HeskeyBaozi/hexo-theme-lite
```yml
avatar:
enable: true
url: /static/images/kamuyi.jpg
url: /static/images/kamuyi.jpg # mapping to '<blog root>/source/static/images/kamuyi.jpg'
```
As usual, `/` is mapped to your `<blog root>/source`, not the `static` folder in the theme.
通常这个路径指的是你博客根目录下的`/source`文件夹,而不是主题中的`static`文件夹

- theme filter blur | 主题模糊滤镜设置

you can set the gaussian radius here.
Expand Down Expand Up @@ -159,6 +162,11 @@ blur:
opacity_value: 0.4
```

- Post Excerpt | 文章摘要

insert `<!-- more -->` in your raw markdown post. [Example](https://github.com/HeskeyBaozi/hexo-theme-lite/issues/41).
在你的文章markdown中插入`<!-- more -->`来进行手动截断. [例子](https://github.com/HeskeyBaozi/hexo-theme-lite/issues/41).

- top menu item | 顶部导航菜单项目设置

```yml
Expand Down Expand Up @@ -209,6 +217,14 @@ social_icons:
qq: fa-qq
```

- powered by

```yml
powered_by:
text: Hexo Theme Lite
url: https://github.com/HeskeyBaozi/hexo-theme-lite/ # or false to disable link
```

- favicon | 网站图标

![icon](./docs/ico.png)
Expand Down
7 changes: 6 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,9 @@ google_analytics:
# -------------------------------------------------------
# Powered by
# -------------------------------------------------------
powered_by: Hexo Theme Lite
# if you want to disable powered-by
# powered_by: false
# powered_by: ''
powered_by:
text: Hexo Theme Lite
url: https://github.com/HeskeyBaozi/hexo-theme-lite/ # or false to disable link
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lite-fe",
"version": "1.4.0",
"version": "1.4.1",
"description": "Hexo Theme Lite FE",
"author": "HeskeyBaozi <[email protected]>",
"scripts": {
Expand Down
39 changes: 30 additions & 9 deletions src/models/theme-config.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ export class Theme {
gitment = new GitmentOptions();
google_analytics = new GoogleAnalytics();
layout = new ThemeLayout();
powered_by = '';
powered_by = new ThemePoweredBy();

constructor(raw?: any) {
const raw_theme = raw && raw['theme_config'];
const raw_theme = raw && raw[ 'theme_config' ];
if (raw_theme) {
this.menu = new ThemeMenu(raw_theme.menu);
this.menu_icons = raw_theme.menu_icons;
Expand All @@ -36,6 +36,7 @@ export class Theme {
this.blur = new ThemeBlur(raw_theme.blur);
this.google_analytics = new GoogleAnalytics(raw_theme.google_analytics);
this.layout = new ThemeLayout(raw_theme.theme_layout);
this.powered_by = new ThemePoweredBy(raw_theme.powered_by);
}
}
}
Expand All @@ -48,7 +49,7 @@ export class ThemeCustom404 {
if (raw) {
for (const key of Object.keys(this)) {
if (raw.hasOwnProperty(key)) {
Object.assign(this, { [key]: raw[key] });
Object.assign(this, { [ key ]: raw[ key ] });
}
}
}
Expand Down Expand Up @@ -77,14 +78,14 @@ export class ThemeMenu implements LiteMenu {
const basicKeys = Object.keys(extract);
if (raw) {
for (const basicKey of basicKeys) {
if (typeof raw[basicKey] === 'boolean' && raw[basicKey]) {
Object.assign(this, { [basicKey]: extract[basicKey] });
if (typeof raw[ basicKey ] === 'boolean' && raw[ basicKey ]) {
Object.assign(this, { [ basicKey ]: extract[ basicKey ] });
}
}

for (const otherKey of Object.keys(raw)) {
if (basicKeys.every(basicKey => otherKey !== basicKey)) {
Object.assign(this, { [otherKey]: raw[otherKey] });
Object.assign(this, { [ otherKey ]: raw[ otherKey ] });
}
}
}
Expand All @@ -99,7 +100,7 @@ export class ThemeAvatar {
if (raw) {
for (const key of Object.keys(this)) {
if (raw.hasOwnProperty(key)) {
Object.assign(this, { [key]: raw[key] });
Object.assign(this, { [ key ]: raw[ key ] });
}
}
}
Expand All @@ -126,7 +127,7 @@ export class ThemeBackground {
if (raw) {
for (const key of Object.keys(this)) {
if (raw.hasOwnProperty(key)) {
Object.assign(this, { [key]: raw[key] });
Object.assign(this, { [ key ]: raw[ key ] });
}
}
}
Expand All @@ -140,7 +141,7 @@ export class ThemeLayout {
if (raw) {
for (const key of Object.keys(this)) {
if (raw.hasOwnProperty(key)) {
Object.assign(this, { [key]: raw[key] });
Object.assign(this, { [ key ]: raw[ key ] });
}
}
}
Expand Down Expand Up @@ -205,3 +206,23 @@ export class GoogleAnalytics {
}
}
}

export class ThemePoweredBy {
text: string = '';
url: string | boolean = false;

constructor(raw?: { text: string, url: string | false } | string | boolean) {
if (raw) {
if (typeof raw === 'string') {
this.text = raw;
this.url = false;
} else if (typeof raw === 'boolean') {
this.text = '';
this.url = raw;
} else {
this.text = raw.text;
this.url = raw.url;
}
}
}
}
5 changes: 4 additions & 1 deletion src/views/components/bottom-footer/BottomFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
</span>
</a>
</div>
<p v-if="powered.length" class="powered-by">{{ powered }}</p>
<p v-if="powered.text" class="powered-by">
<a v-if="powered.url" :href="powered.url" target="_blank">{{ powered.text }}</a>
<span v-else>{{ powered.text }}</span>
</p>
<router-link class="title" :to="{ path: '/' }">{{ site.title }}</router-link>
<p class="subtitle">{{ site.subtitle }}</p>
</blur-div>
Expand Down
8 changes: 4 additions & 4 deletions src/views/components/bottom-footer/bottom-footer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import BlurDiv from '@/views/components/blur-div/blur-div.component.ts';
components: { BlurDiv },
props: {
powered: {
type: String,
'default': 'Hexo Theme Lite'
type: Object,
required: true
},
social: {
required: true,
Expand Down Expand Up @@ -40,8 +40,8 @@ export default class BottomFooter extends Vue {
return Object.keys(this.social)
.map(key => ({
name: key,
url: this.social[key],
icon: this.icons[key]
url: this.social[ key ],
icon: this.icons[ key ]
}));
}
}

0 comments on commit b880a52

Please sign in to comment.