Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

静态资源重构

  • Loading branch information...
commit f7b602f7fd842465b51966a7d421802e7034a586 1 parent b7939d9
@JacksonTian JacksonTian authored
View
4 .gitignore
@@ -5,3 +5,7 @@ node_modules
public/user_data
coverage.html
.monitor
+
+*.min.*.js
+*.min.*.css
+assets.json
View
3  Makefile
@@ -22,4 +22,7 @@ test-cov: cov
@$(MAKE) -C .cov test REPORTER=progress
@$(MAKE) -C .cov test REPORTER=html-cov > coverage.html
+build:
+ @./bin/combo views .
+
.PHONY: test test-cov cov
View
13 app.js
@@ -8,8 +8,10 @@
var fs = require('fs');
var path = require('path');
+var Loader = require('loader');
var express = require('express');
var ndir = require('ndir');
+var assets = JSON.parse(fs.readFileSync(path.join(__dirname, 'assets.json')));
var pkg = JSON.parse(fs.readFileSync(path.join(__dirname, 'package.json')));
var config = require('./config').config;
config.version = pkg.version;
@@ -31,9 +33,8 @@ var app = express.createServer();
// configuration in all env
app.configure(function () {
- var viewsRoot = path.join(__dirname, 'views');
app.set('view engine', 'html');
- app.set('views', viewsRoot);
+ app.set('views', path.join(__dirname, 'views'));
app.register('.html', require('ejs'));
app.use(express.bodyParser({
uploadDir: config.upload_dir
@@ -66,7 +67,9 @@ if (process.env.NODE_ENV !== 'test') {
// set static, dynamic helpers
app.helpers({
- config: config
+ config: config,
+ Loader: Loader,
+ assets: assets
});
app.dynamicHelpers(require('./common/render_helpers'));
@@ -77,12 +80,12 @@ app.use('/user_data/', express.static(path.join(__dirname, 'public', 'user_data'
var staticDir = path.join(__dirname, 'public');
app.configure('development', function () {
- app.use(express.static(staticDir));
+ app.use('/public', express.static(staticDir));
app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
});
app.configure('production', function () {
- app.use(express.static(staticDir, { maxAge: maxAge }));
+ app.use('/public', express.static(staticDir, { maxAge: maxAge }));
app.use(express.errorHandler());
app.set('view cache', true);
});
View
27 bin/combo
@@ -0,0 +1,27 @@
+#!/usr/bin/env node
+"use strict";
+var path = require('path');
+var fs = require('fs');
+var Loader = require('loader');
+
+// app/views
+var viewsDir = path.join(process.cwd(), process.argv[2]);
+// app/
+var baseDir = path.join(process.cwd(), process.argv[3]);
+
+// scan views folder, get the assets map
+var scaned = Loader.scanDir(viewsDir);
+console.log("Scaned:");
+console.log(scaned);
+
+// need minify?
+var justCombo = process.argv[4];
+// combo?md5 hash
+var minified = Loader.minify(baseDir, scaned, justCombo);
+console.log(minified);
+console.log("Compile static assets done.");
+
+// write the assets mapping into assets.json
+fs.writeFileSync(path.join(baseDir, 'assets.json'), JSON.stringify(Loader.map(minified)));
+console.log("write assets.json done. assets.json: ");
+console.log(fs.readFileSync(path.join(baseDir, 'assets.json'), 'utf-8'));
View
2  controllers/sign.js
@@ -273,7 +273,7 @@ function getAvatarURL(user) {
}
var avatar_url = user.profile_image_url || user.avatar;
if (!avatar_url) {
- avatar_url = config.site_static_host + '/images/user_icon&48.png';
+ avatar_url = config.site_static_host + '/public/images/user_icon&48.png';
}
return avatar_url;
}
View
8 models/user.js
@@ -1,6 +1,6 @@
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
-var config = require('../config');
+var config = require('../config').config;
var UserSchema = new Schema({
name: { type: String, index: true },
@@ -37,11 +37,7 @@ var UserSchema = new Schema({
});
UserSchema.virtual('avatar_url').get(function () {
- var avatar_url = this.profile_image_url || this.avatar;
- if (!avatar_url) {
- avatar_url = config.site_static_host + '/images/user_icon&48.png';
- }
- return avatar_url;
+ return this.profile_image_url || this.avatar || config.site_static_host + '/public/images/user_icon&48.png';
});
mongoose.model('User', UserSchema);
View
9 package.json
@@ -6,17 +6,18 @@
"customHost": ["cnodejs.org", "club.cnodejs.org"],
"dependencies": {
"express": "2.5.1",
- "ejs": "0.8.0",
- "eventproxy": "0.2.2",
+ "ejs": "0.8.4",
+ "eventproxy": "0.2.5",
"mongoose": "2.4.1",
"node-markdown": "0.1.0",
"validator": "0.3.7",
"ndir": "0.1.3",
"nodemailer": "0.3.43",
- "data2xml": "0.4.0",
+ "data2xml": "0.8.0",
"utility": "0.0.x",
"marked-prettyprint": "0.2.8",
- "xss": "0.0.3"
+ "xss": "0.0.5",
+ "loader": "0.0.4"
},
"devDependencies": {
"should": "*",
View
18 public/javascripts/topic.js
@@ -0,0 +1,18 @@
+$(document).ready(function () {
+ // pretty code
+ prettyPrint();
+
+ //fancy image
+ $('.topic_content img,.reply_content img').each(function () {
+ if ($(this).width > 500) {
+ $(this).width(500);
+ }
+ var elem = $('<a class="content_img"></a>');
+ elem.attr('href', $(this).attr('src'));
+ $(this).wrap(elem);
+ });
+ $('.content_img').fancybox({
+ transitionIn: 'elastic',
+ transitionOut: 'elastic'
+ });
+});
View
2  public/stylesheets/style.css
@@ -463,7 +463,7 @@ img.unread {
cursor: pointer;
}
.wmd-button > span {
- background-image: url(/libs/pagedown/wmd-buttons.png);
+ background-image: url(../libs/pagedown/wmd-buttons.png);
background-repeat: no-repeat;
background-position: 0px 0px;
width: 20px;
View
2  test/mocha.opts
@@ -1,4 +1,4 @@
--require should
--require test/support/http.js
--growl
---ignore-leaks
+--ignore-leaks
View
37 views/layout.html
@@ -12,25 +12,30 @@
<% } %>
<link title="RSS" type="application/rss+xml" rel="alternate" href="/rss" />
<!-- style -->
- <link rel="stylesheet" type="text/css" href="/libs/bootstrap/css/bootstrap.css" />
- <link rel="stylesheet" type="text/css" href="/stylesheets/common.css" />
- <link rel="stylesheet" type="text/css" href="/stylesheets/style.css" />
- <link type='text/css' rel='stylesheet' href='/libs/code-prettify/prettify.css' />
+ <%- Loader('/public/stylesheets/index.min.css')
+ .css('/public/libs/bootstrap/css/bootstrap.css')
+ .css('/public/stylesheets/common.css')
+ .css('/public/stylesheets/style.css')
+ .css('/public/libs/code-prettify/prettify.css')
+ .done(assets, config.site_static_host)
+ %>
<% if (locals.extra_style) { %>
<style type="text/css">
<%- locals.extra_style %>
</style>
<% } %>
- <script src='/libs/code-prettify/prettify.js'></script>
- <!-- script -->
- <script src='/libs/jquery/jquery.js'></script>
- <script src='/libs/bootstrap/js/bootstrap.js'></script>
- <script src='/javascripts/main.js'></script>
+ <%- Loader('/public/index.min.js')
+ .js('/public/libs/code-prettify/prettify.js')
+ .js('/public/libs/jquery/jquery.js')
+ .js('/public/libs/bootstrap/js/bootstrap.js')
+ .js('/public/javascripts/main.js')
+ .done(assets, config.site_static_host)
+ %>
<% if (config.site_enable_search_preview) { %>
<script>
var __google_search_domain = '<%= config.site_google_search_domain || "" %>';
</script>
- <script src='/javascripts/google_search_preview.js'></script>
+ <script src='/public/javascripts/google_search_preview.js'></script>
<% } %>
<% if (locals.topic) { %>
<title><%= topic.title %> - <%= config.name %></title>
@@ -79,21 +84,19 @@
</div>
</div>
<div id='backtotop'>回到顶部</div>
- <!-- <a href="https://github.com/muyuan/nodeclub"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://a248.e.akamai.net/assets.github.com/img/71eeaab9d563c2b3c590319b398dd35683265e85/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f677261795f3664366436642e706e67" alt="Fork me on GitHub"></a> -->
- <!-- footer -->
<div id='footer'>
<div id='footer_main'>
- <div>
+ <div class="links">
<a class='dark' href='/about'><strong>关于</strong></a>
- &nbsp;&nbsp;|&nbsp;&nbsp;
+ |
<a class='dark' href='/faq'><strong>FAQ</strong></a>
- &nbsp;&nbsp;|&nbsp;&nbsp;
+ |
<a class='dark' href='https://github.com/cnodejs/nodeclub/' target="_blank"><strong>Github</strong></a>
- &nbsp;&nbsp;|&nbsp;&nbsp;
+ |
<a class='dark' href='/rss' target="_blank"><strong>RSS</strong></a>
</div>
<div class='col_fade'>
- &copy; 2012 <br>本社区为开源系统,版本: <%= config.version %> ,欢迎贡献代码<br>
+ &copy; 2012 - 2013 <br>本社区为开源系统,版本: <%= config.version %> ,欢迎贡献代码<br>
由<a href='http://cnodejs.net' target='_blank'> NAE </a>为 <%= config.name %> 提供动力
</div>
</div>
View
4 views/message/message.html
@@ -34,11 +34,11 @@
<% } %>
<% if (message.has_read) { %>
- <span class="marked_icon"><img src='<%- config.site_static_host %>/images/checkmark_icon&16.png' title='消息已读'/></span>
+ <span class="marked_icon"><img src='<%- config.site_static_host %>/public/images/checkmark_icon&16.png' title='消息已读'/></span>
<% } else { %>
<span class="marked_icon mark_read_btn">
<img class='unread'
- src='<%- config.site_static_host %>/images/checkmark_icon&16.png'
+ src='<%- config.site_static_host %>/public/images/checkmark_icon&16.png'
title='消息已读'
/>
</span>
View
2  views/reply/reply.html
@@ -17,7 +17,7 @@
<span class='col_fade'>#<%= indexInCollection + 1 %></span>
<% if (locals.current_user && current_user._id.toString() == reply.author._id.toString()) { %>
<a href='javascript:void(0);' class='delete_reply_btn'>
- <img class='user_icon' src="<%- config.site_static_host %>/images/trash_icon&16.png" title='删除' />
+ <img class='user_icon' src="<%- config.site_static_host %>/public/images/trash_icon&16.png" title='删除' />
</a>
<% } %>
<span>
View
2  views/reply/reply2.html
@@ -15,7 +15,7 @@
<div class='user_action'>
<% if (locals.current_user && current_user._id.toString() == reply2.author._id.toString()) { %>
<a href='javascript:void(0)' class='delete_reply2_btn'>
- <img class='user_icon' src="<%- config.site_static_host %>/images/trash_icon&16.png" title='删除' />
+ <img class='user_icon' src="<%- config.site_static_host %>/public/images/trash_icon&16.png" title='删除' />
</a>
<% } %>
<span>
View
4 views/sidebar.html
@@ -20,7 +20,7 @@
<div class=panel>
<div class='header'>
- <!-- <img src='<%- config.site_static_host %>/images/tag_icon&16.png' title='标签'/> -->
+ <!-- <img src='<%- config.site_static_host %>/public/images/tag_icon&16.png' title='标签'/> -->
<!-- CNode社区宣传通告 -->
<span class="index_notify">社区消息
</div>
@@ -152,7 +152,7 @@
<span class='col_fade'>RSS订阅</span>
</div>
<div class='inner'>
- <a href="/rss"><img alt="RSS订阅" src="/images/rss_icon&40.png" /></a>
+ <a href="/rss"><img alt="RSS订阅" src="<%- config.site_static_host %>/public/images/rss_icon&40.png" /></a>
</div>
</div>
</div>
View
4 views/tag/tag_can_edit.html
@@ -2,9 +2,9 @@
<td><%= tag.order %></td>
<td><%= tag.name %></td>
<td>
- <a href='/tag/<%= tag.name %>/edit'><img class='user_icon' src='<%- config.site_static_host %>/images/doc_edit_icon&16.png' title='编辑' /></a>
+ <a href='/tag/<%= tag.name %>/edit'><img class='user_icon' src='<%- config.site_static_host %>/public/images/doc_edit_icon&16.png' title='编辑' /></a>
</td>
<td>
- <a class='delete_tag_btn' href='/tag/<%= tag.name %>/delete'><img class='user_icon' src='<%- config.site_static_host %>/images/trash_icon&16.png' title='删除' /></a>
+ <a class='delete_tag_btn' href='/tag/<%= tag.name %>/delete'><img class='user_icon' src='<%- config.site_static_host %>/public/images/trash_icon&16.png' title='删除' /></a>
</td>
</tr>
View
30 views/topic/edit.html
@@ -89,30 +89,18 @@
</div>
<!-- ajaxupload -->
-<script src='/libs/ajax-upload/ajaxupload.js'></script>
<!-- markdown editor -->
-<!-- <script src='/libs/pagedown/Markdown.Converter.js'></script>
-<script src='/libs/showdown.js'></script>
-<script src='/libs/pagedown/Markdown.Editor.js'></script> -->
-<script src='/libs/ace/ace.js'></script>
-<script src='/javascripts/editor.js'></script>
-
+<%- Loader('/public/topic_edit.min.js')
+ .js('/public/libs/ajax-upload/ajaxupload.js')
+ .js('/public/libs/ace/ace.js')
+ .js('/public/libs/ace/theme-textmate.js')
+ .js('/public/libs/ace/theme-chrome.js')
+ .js('/public/libs/ace/mode-markdown.js')
+ .js('/public/javascripts/editor.js')
+ .done(assets, config.site_static_host)
+%>
<script>
$(function () {
- // var editor;
- // function run_md_editor(){
- // // var converter = Markdown.getSanitizingConverter();
- // var converter = new Showdown.converter();
- // editor = new Markdown.Editor(converter);
- // editor.run();
- // }
- // run_md_editor();
-
- // $('.preview-btn').click(function() {
- // editor.makePreviewHtml();
- // prettyPrint();
- // });
-
$('.tag_selectable').click(function(){
$(this).toggleClass('tag_select');
});
View
60 views/topic/index.html
@@ -91,15 +91,15 @@
<% if (locals.current_user) { %>
<% if (current_user.is_admin) { %>
<% if (topic.top) { %>
- <a href='/topic/<%= topic._id %>/top/0'><img class='user_icon' src='<%- config.site_static_host %>/images/star_fav_empty_icon&16.png' title='取消置顶' /></a>
+ <a href='/topic/<%= topic._id %>/top/0'><img class='user_icon' src='<%- config.site_static_host %>/public/images/star_fav_empty_icon&16.png' title='取消置顶' /></a>
<% } else { %>
- <a href='/topic/<%= topic._id %>/top/1'><img class='user_icon' src='<%- config.site_static_host %>/images/star_fav_icon&16.png' title='置顶' /></a>
+ <a href='/topic/<%= topic._id %>/top/1'><img class='user_icon' src='<%- config.site_static_host %>/public/images/star_fav_icon&16.png' title='置顶' /></a>
<% } %>
- <a href='/topic/<%= topic._id %>/edit'><img class='user_icon' src='<%- config.site_static_host %>/images/doc_edit_icon&16.png' title='编辑' /></a>
- <a href='javascript:;' data-id="<%= topic._id %>" class='delete_topic_btn'><img class='user_icon' src='<%- config.site_static_host %>/images/trash_icon&16.png' title='删除' /></a>
+ <a href='/topic/<%= topic._id %>/edit'><img class='user_icon' src='<%- config.site_static_host %>/public/images/doc_edit_icon&16.png' title='编辑' /></a>
+ <a href='javascript:;' data-id="<%= topic._id %>" class='delete_topic_btn'><img class='user_icon' src='<%- config.site_static_host %>/public/images/trash_icon&16.png' title='删除' /></a>
<% } else { %>
<% if (current_user._id == topic.author_id) { %>
- <a href='/topic/<%= topic._id %>/edit'><img class='user_icon' src='<%- config.site_static_host %>/images/doc_edit_icon&16.png' title='编辑' /></a>
+ <a href='/topic/<%= topic._id %>/edit'><img class='user_icon' src='<%- config.site_static_host %>/public/images/doc_edit_icon&16.png' title='编辑' /></a>
<% } %>
<% } %>
<% } %>
@@ -148,14 +148,16 @@
<% if (locals.current_user && locals.topic) { %>
<!-- ajaxupload -->
-<script src='/libs/ajax-upload/ajaxupload.js'></script>
<!-- markdown editor -->
-<!-- <script src='/libs/pagedown/Markdown.Converter.js'></script>
-<script src='/libs/showdown.js'></script>
-<script src='/libs/pagedown/Markdown.Editor.js'></script> -->
-<script src='/libs/ace/ace.js'></script>
-<script src='/javascripts/editor.js'></script>
-
+<%- Loader('/public/topic_edit.min.js')
+ .js('/public/libs/ajax-upload/ajaxupload.js')
+ .js('/public/libs/ace/ace.js')
+ .js('/public/libs/ace/theme-textmate.js')
+ .js('/public/libs/ace/theme-chrome.js')
+ .js('/public/libs/ace/mode-markdown.js')
+ .js('/public/javascripts/editor.js')
+ .done(assets, config.site_static_host)
+%>
<script>
$(document).ready(function () {
$('#wmd-input').mouseover(function(){
@@ -168,7 +170,7 @@
var editorWrap = parent.find('.reply2_form');
parent.find('.reply2_area').prepend(editorWrap);
var textarea = editorWrap.find('textarea.editor');
- var user = $btn.parents('.cell').find('.reply_author').find('a').html();
+ var user = $btn.parents('.cell').find('.reply_author a').html();
editorWrap.show('fast', function () {
var editor = ace.edit("ace_" + textarea.attr('id'));
editor.setValue(textarea.val(), 1);
@@ -181,7 +183,7 @@
var editorWrap = $btn.parents('.reply2_area').find('.reply2_form');
$btn.parents('.reply2_item').after(editorWrap);
var textarea = editorWrap.find('textarea.editor');
- var user = $btn.parents('.cell').find('.reply_author').find('a').html();
+ var user = $btn.parents('.cell').find('.reply_author a').html();
if (textarea.val().indexOf('@' + user) < 0) {
textarea.val('@' + user + ' ');
}
@@ -249,7 +251,7 @@
if (!result.success) {
alert(result.message);
} else {
- window.location.href = '/';
+ location.href = '/';
}
});
}
@@ -283,25 +285,9 @@
});
</script>
<% } %>
-<link type='text/css' rel='stylesheet' href='/libs/fancybox/jquery.fancybox-1.3.4.css' />
-<script src='/libs/fancybox/jquery.fancybox-1.3.4.pack.js'></script>
-<script>
-$(document).ready(function () {
- // pretty code
- prettyPrint();
-
- //fancy image
- $('.topic_content img,.reply_content img').each(function(){
- if($(this).width > 500){
- $(this).width(500);
- }
- var elem = $('<a class="content_img"></a>');
- elem.attr('href',$(this).attr('src'));
- $(this).wrap(elem);
- });
- $('.content_img').fancybox({
- transitionIn: 'elastic',
- transitionOut: 'elastic'
- });
-});
-</script>
+<%- Loader('/public/fancebox.min.js', '/public/libs/fancybox/fancebox.min.css')
+ .css('/public/libs/fancybox/jquery.fancybox-1.3.4.css')
+ .js('/public/libs/fancybox/jquery.fancybox-1.3.4.pack.js')
+ .js('/public/javascripts/topic.js')
+ .done(assets, config.site_static_host)
+%>
View
8 views/user/index.html
@@ -22,7 +22,7 @@
<a class='dark'><%= user.name %></a>
<div class='col_fade'>
<span>
- <img src="<%- config.site_static_host %>/images/cert_icon&16.png" />
+ <img src="<%- config.site_static_host %>/public/images/cert_icon&16.png" />
<%= user.following_count %> 关注
<%= user.follower_count %> 粉丝
<%= user.score %> 积分</span>
@@ -34,19 +34,19 @@
<ul class='unstyled'>
<% if (user.url) { %>
<li>
- <img class='user_icon' src="<%- config.site_static_host %>/images/paper_airplane_icon&16.png" />
+ <img class='user_icon' src="<%- config.site_static_host %>/public/images/paper_airplane_icon&16.png" />
<a class='dark' href="<%= user.url %>" target='_blank'><%= user.url %></a>
</li>
<% } %>
<% if (user.location) { %>
<li>
- <img class='user_icon' src="<%- config.site_static_host %>/images/compass_icon&16.png" />
+ <img class='user_icon' src="<%- config.site_static_host %>/public/images/compass_icon&16.png" />
<span class='col_fade'><%= user.location %></span>
</li>
<% } %>
<% if (user.weibo) { %>
<li>
- <img class='user_icon' src="<%- config.site_static_host %>/images/twitter_2_icon&16.png" />
+ <img class='user_icon' src="<%- config.site_static_host %>/public/images/twitter_2_icon&16.png" />
<a class='dark' href="<%= user.weibo %>" target='_blank'><%= user.weibo %></a>
</li>
<% } %>
View
8 views/user/replies.html
@@ -21,7 +21,7 @@
<% } %>
<h2><%= user.name %></h2>
<div class='col_fade'>
- <span><img src="<%- config.site_static_host %>/images/cert_icon&16.png" /> <%= user.follower_count %> 粉丝</span>
+ <span><img src="<%- config.site_static_host %>/public/images/cert_icon&16.png" /> <%= user.follower_count %> 粉丝</span>
<% if(user.signature){ %>
<span><%= user.signature %></span>
<% } %>
@@ -30,19 +30,19 @@
<ul class='unstyled'>
<% if(user.url){ %>
<li>
- <img class='user_icon' src="<%- config.site_static_host %>/images/paper_airplane_icon&16.png" />
+ <img class='user_icon' src="<%- config.site_static_host %>/public/images/paper_airplane_icon&16.png" />
<a class='dark' href="<%= user.url %>" target='_blank'><%= user.url %></a>
</li>
<% } %>
<% if(user.location){ %>
<li>
- <img class='user_icon' src="<%- config.site_static_host %>/images/compass_icon&16.png" />
+ <img class='user_icon' src="<%- config.site_static_host %>/public/images/compass_icon&16.png" />
<span class='col_fade'><%= user.location %></span>
</li>
<% } %>
<% if(user.weibo){ %>
<li>
- <img class='user_icon' src="<%- config.site_static_host %>/images/twitter_2_icon&16.png" />
+ <img class='user_icon' src="<%- config.site_static_host %>/public/images/twitter_2_icon&16.png" />
<a class='dark' href="<%= user.weibo %>" target='_blank'><%= user.weibo %></a>
</li>
<% } %>
View
2  views/user/star.html
@@ -1,6 +1,6 @@
<li>
<div>
- <img class='user_icon' src='<%- config.site_static_host %>/images/star_fav_empty_icon&16.png' />
+ <img class='user_icon' src='<%- config.site_static_host %>/public/images/star_fav_empty_icon&16.png' />
<a class='dark star_name' href="/user/<%= user.name %>"><%= user.name %></a>
</div>
<span class='col_fade'><%= user.follower_count %> 粉丝</span>
View
8 views/user/topics.html
@@ -21,7 +21,7 @@
<% } %>
<h2><%= user.name %></h2>
<div class='col_fade'>
- <span><img src="<%- config.site_static_host %>/images/cert_icon&16.png" /> <%= user.follower_count %> 粉丝</span>
+ <span><img src="<%- config.site_static_host %>/public/images/cert_icon&16.png" /> <%= user.follower_count %> 粉丝</span>
<% if (user.signature) { %>
<span class='sp10'></span>
<span><%= user.signature %></span>
@@ -31,19 +31,19 @@
<ul class='unstyled'>
<% if(user.url){ %>
<li>
- <img class='user_icon' src="<%- config.site_static_host %>/images/paper_airplane_icon&16.png" />
+ <img class='user_icon' src="<%- config.site_static_host %>%>/public/images/paper_airplane_icon&16.png" />
<a class='dark' href="<%= user.url %>" target='_blank'><%= user.url %></a>
</li>
<% } %>
<% if (user.location) { %>
<li>
- <img class='user_icon' src="<%- config.site_static_host %>/images/compass_icon&16.png" />
+ <img class='user_icon' src="<%- config.site_static_host %>/public/images/compass_icon&16.png" />
<span class='col_fade'><%= user.location %></span>
</li>
<% } %>
<% if (user.weibo) { %>
<li>
- <img class='user_icon' src="<%- config.site_static_host %>/images/twitter_2_icon&16.png" />
+ <img class='user_icon' src="<%- config.site_static_host %>/public/images/twitter_2_icon&16.png" />
<a class='dark' href="<%= user.weibo %>" target='_blank'><%= user.weibo %></a>
</li>
<% } %>
View
6 views/user/user.html
@@ -12,20 +12,20 @@
<div>
<span>
<a href='mailto:<%= user.email %>'>
- <img class='user_icon' src="<%- config.site_static_host %>/images/mail_icon&16.png" title='电子邮箱' />
+ <img class='user_icon' src="<%- config.site_static_host %>/public/images/mail_icon&16.png" title='电子邮箱' />
</a>
</span>
<% if (user.url) { %>
<span>
<a href="<%= user.url %>" target='_blank'>
- <img class='user_icon' src="<%- config.site_static_host %>/images/paper_airplane_icon&16.png" title='个人网站' />
+ <img class='user_icon' src="<%- config.site_static_host %>/public/images/paper_airplane_icon&16.png" title='个人网站' />
</a>
</span>
<% } %>
<% if (user.weibo) { %>
<span>
<a href="<%= user.weibo %>" target='_blank'>
- <img class='user_icon' src="<%- config.site_static_host %>/images/twitter_2_icon&16.png" title='微博' />
+ <img class='user_icon' src="<%- config.site_static_host %>/public/images/twitter_2_icon&16.png" title='微博' />
</a>
</span>
<% } %>
Please sign in to comment.
Something went wrong with that request. Please try again.