Skip to content

Commit 123f94f

Browse files
sinchangJacksonTian
authored andcommitted
chore: make page title readable and fix the bug (#76)
* chore: make page title readable and fix the bug * chore: add nav link for the about page
1 parent 74600b9 commit 123f94f

File tree

15 files changed

+22
-17
lines changed

15 files changed

+22
-17
lines changed

app/controller/page.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class PageController extends Controller {
99

1010
// FAQ
1111
async faq() {
12-
await this.ctx.render('static/faq');
12+
await this.ctx.render('static/faq', { pageTitle: 'FAQ' });
1313
}
1414

1515
async getstart() {
@@ -28,7 +28,7 @@ class PageController extends Controller {
2828
}
2929

3030
async api() {
31-
await this.ctx.render('static/api');
31+
await this.ctx.render('static/api', { pageTitle: 'API' });
3232
}
3333

3434
}

app/controller/sign.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ const tools = require('../common/tools');
1010
class SignController extends Controller {
1111
async showLogin() {
1212
const { ctx } = this;
13-
await ctx.render('/sign/signin', {});
13+
await ctx.render('/sign/signin', { pageTitle: '登录' });
1414
}
1515

1616
// sign up
1717
async showSignup() {
1818
const { ctx } = this;
19-
await ctx.render('/sign/signup', {});
19+
await ctx.render('/sign/signup', { pageTitle: '注册' });
2020
}
2121

2222
async signup() {

app/controller/user.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ class UserController extends Controller {
184184
user.success = '保存成功。';
185185
}
186186

187-
return await ctx.render('user/setting', { user });
187+
return await ctx.render('user/setting', { user, pageTitle: '设置' });
188188
}
189189

190190
async setting() {

app/view/layout.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
<div class='container'>
7070
<a class='brand' href='/'>
7171
<% if (config.site_logo) {%>
72-
<img src="<%- staticFile(config.site_logo) %>" />
72+
<img src="<%- helper.staticFile(config.site_logo) %>" />
7373
<%} else {%>
7474
<%- config.name %>
7575
<%}%>
@@ -92,6 +92,7 @@
9292
<% } %>
9393
<li><a href='/getstart'>新手入门</a></li>
9494
<li><a href='/api'>API</a></li>
95+
<li><a href='/about'>关于</a></li>
9596
<%
9697
var site_navs = config.site_navs || [];
9798
for (var i = 0, l = site_navs.length; i < l; i++) {

app/view/sidebar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<span class='col_fade'>个人信息</span>
77
</div>
88
<div class='inner'>
9-
<%- include('./user/card.html', { user: typeof user === 'undefined' ? current_user : user }) %>
9+
<%- include('./user/card.html', { user: typeof user === 'undefined' ? current_user : user }) %>
1010
</div>
1111
<% } else { %>
1212
<div class='inner'>

app/view/static/about.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<% include ../sidebar.html %>
1+
<%- include('../sidebar.html') %>
22

33
<div id='content'>
44
<div class='panel'>

app/view/static/api.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<% include ../sidebar.html %>
1+
<%- include('../sidebar.html') %>
22

33
<div id='content'>
44
<div class='panel'>

app/view/static/faq.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<%- include ../sidebar.html %>
1+
<%- include('../sidebar.html') %>
22

33
<div id='content'>
44
<div class='panel'>

app/view/static/getstart.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<%- include ../sidebar.html %>
1+
<%- include('../sidebar.html') %>
22

33
<div id='content'>
44
<div class='panel'>

app/view/user/collect_topics.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<%- include('../topic/list.html', {
1414
topics,
1515
pages,
16-
current_pages,
16+
current_page,
1717
base: `/user/${user.loginname}/collections`
1818
}) %>
1919
<% } else { %>

0 commit comments

Comments
 (0)