forked from cnodejs/nodeclub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlayout.html
158 lines (145 loc) · 5.05 KB
/
layout.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- meta -->
<meta charset="utf-8"/>
<meta name='description' content='<%= config.description %>'>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="keywords" content="<%= config.keywords %>"/>
<!-- see http://smerity.com/articles/2013/where_did_all_the_http_referrers_go.html -->
<meta name="referrer" content="always">
<%
var headers = config.site_headers || [];
for (var i = 0, l = headers.length; i < l; i++) {
%>
<%- headers[i] %>
<% } %>
<link title="RSS" type="application/rss+xml" rel="alternate" href="/rss"/>
<% if (config.site_icon) { %>
<link rel="icon" href="<%- staticFile(config.site_icon) %>" type="image/x-icon"/>
<% } %>
<!-- style -->
<%- Loader('/public/stylesheets/index.min.css')
.css('/public/libs/bootstrap/css/bootstrap.css')
.css('/public/stylesheets/common.css')
.css('/public/stylesheets/style.less')
.css('/public/stylesheets/responsive.css')
.css('/public/stylesheets/jquery.atwho.css')
.css('/public/libs/editor/editor.css')
.css('/public/libs/webuploader/webuploader.css')
.css('/public/libs/code-prettify/prettify.css')
.css('/public/libs/font-awesome/css/font-awesome.css')
.done(assets, config.site_static_host, config.mini_assets)
%>
<!-- scripts -->
<%- Loader('/public/index.min.js')
.js('/public/libs/jquery-2.1.0.js')
.js('/public/libs/lodash.compat.js')
.js('/public/libs/jquery-ujs.js')
.js('/public/libs/bootstrap/js/bootstrap.js')
.js('/public/libs/jquery.caret.js')
.js('/public/libs/jquery.atwho.js')
.js('/public/libs/markdownit.js')
.js('/public/libs/code-prettify/prettify.js')
.js('/public/libs/qrcode.js')
.js('/public/javascripts/main.js')
.js('/public/javascripts/responsive.js')
.done(assets, config.site_static_host, config.mini_assets)
%>
<% if (typeof(topic) !== 'undefined') { %>
<title><%= topic.title %> - <%= config.name %></title>
<% } else if (typeof(pageTitle) !== 'undefined') { %>
<title><%= pageTitle %> - <%= config.name %></title>
<% } else { %>
<title><%= config.description %></title>
<% } %>
<meta content="_csrf" name="csrf-param">
<meta content="<%= csrf %>" name="csrf-token">
</head>
<body>
<!-- navbar -->
<div class='navbar'>
<div class='navbar-inner'>
<div class='container'>
<a class='brand' href='/'>
<% if (config.site_logo) {%>
<img src="<%- staticFile(config.site_logo) %>" />
<%} else {%>
<%- config.name %>
<%}%>
</a>
<form id='search_form' class='navbar-search' action="/search">
<input type='text' id='q' name='q' class='search-query span3' value=''/>
</form>
<ul class='nav pull-right'>
<li><a href='/'>首页</a></li>
<% if (current_user){ %>
<li>
<a href='/my/messages'>
<% if (current_user.messages_count) { %>
<span class='big messages_count'><%= current_user.messages_count %></span>
<% } %>
未读消息
</a>
</li>
<% } %>
<li><a href='/getstart'>新手入门</a></li>
<li><a href='/api'>API</a></li>
<%
var site_navs = config.site_navs || [];
for (var i = 0, l = site_navs.length; i < l; i++) {
var nav = site_navs[i];
%>
<li><a href="<%- nav[0] %>" target="<%- nav[2] %>"><%- nav[1] %></a></li>
<% } %>
<% if (current_user) { %>
<li><a href='/setting'>设置</a></li>
<li>
<a href='/signout' data-method="post" rel="nofollow">退出</a>
</li>
<% } else { %>
<li><a href='/signup'>注册</a></li>
<li><a href='/signin'>登录</a></li>
<% } %>
</ul>
<a class="btn btn-navbar" id="responsive-sidebar-trigger">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
</div>
</div>
</div>
<div id='main'>
<%- body %>
</div>
<div id='backtotop'>回到顶部</div>
<div id='footer'>
<div id='footer_main'>
<div class="links">
<a class='dark' href='/rss'>RSS</a>
|
<a class='dark' href='https://github.com/cnodejs/nodeclub/'>源码地址</a>
</div>
<%- partial('./_sponsors') %>
</div>
</div>
<div id="sidebar-mask"></div>
<% if (config.google_tracker_id) { %>
<script>
// google analytics
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script', "<%- proxy('https://www.google-analytics.com/analytics.js') %>",'ga');
ga('create', '<%-config.google_tracker_id%>', 'auto');
ga('send', 'pageview');
</script>
<% } %>
<% if (config.cnzz_tracker_id) { %>
<div style="display:none;">
<script src="//s95.cnzz.com/z_stat.php?id=<%- config.cnzz_tracker_id %>&web_id=<%- config.cnzz_tracker_id %>" language="JavaScript"></script>
</div>
<% } %>
</body>
</html>