Skip to content

Commit 5d016f6

Browse files
committed
[ Add ] Support Extra Links of Activity (such as Registration Forms)
1 parent cfb62cb commit 5d016f6

File tree

7 files changed

+42
-6995
lines changed

7 files changed

+42
-6995
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ Thumbs.db
33
db.json
44
*.log
55
node_modules/
6+
package-lock.json
67
public/
7-
.deploy*/
8+
.deploy*/

package-lock.json

Lines changed: 0 additions & 6982 deletions
This file was deleted.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@fcc-cdc/ows",
3-
"version": "1.4.0",
3+
"version": "1.5.0",
44
"private": true,
55
"keywords": [
66
"wiki"
@@ -23,7 +23,7 @@
2323
"hexo-generator-slidehtml": "0.0.62",
2424
"hexo-generator-tag": "^0.2.0",
2525
"hexo-migrator-web": "^0.4.4",
26-
"hexo-permalink-pinyin": "git+https://github.com/viko16/hexo-permalink-pinyin.git",
26+
"hexo-permalink-pinyin": "^1.0.0",
2727
"hexo-pwa": "^0.1.3",
2828
"hexo-reference": "^1.0.4",
2929
"hexo-renderer-ejs": "^0.3.1",
@@ -44,8 +44,8 @@
4444
}
4545
},
4646
"devDependencies": {
47-
"husky": "^1.3.1",
48-
"prettier": "^1.16.4"
47+
"husky": "^2.1.0",
48+
"prettier": "^1.17.0"
4949
},
5050
"prettier": {
5151
"tabWidth": 2

themes/Icarus/includes/helpers/data.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ module.exports = function (hexo) {
5656

5757
hexo.extend.helper.register('sponsor_list', function (posts) {
5858

59-
return posts.map(({categories, source, title, path, thumbnail, website}) =>
59+
return posts.map(({categories, source, title, path, thumbnail}) =>
6060

6161
has_category({ categories }, 'Sponsor') && {
6262
name: source.match( /([^/\\]+)\.\w+$/i )[1],
6363
title,
6464
logo: url_for.call(this, path + thumbnail),
65-
URL: website
65+
URL: url_for.call(this, path)
6666
}
6767
).filter(Boolean)
6868
});
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<main class="card">
2+
<div class="card-content content">
3+
4+
<h1><%= page.title %></h1>
5+
<p>
6+
<a class="button is-link is-rounded" target="_blank"
7+
href="https://github.com/FreeCodeCamp-Chengdu/Wiki/new/master/_posts/Activity/">添加活动</a>
8+
9+
<a class="button is-link is-rounded" target="_blank"
10+
href="https://github.com/FreeCodeCamp-Chengdu/Wiki/edit/master/_data/volunteer.yml">添加人员</a>
11+
</p>
12+
<form target="_blank" method="POST" action="https://fcc-cdc.leanapp.cn/form?source=JinShuJu">
13+
<p>
14+
<label>https://jinshuju.net/f/<input type="text" name="id" required></label>
15+
</p>
16+
<button type="submit" class="button is-link is-rounded">添加表单</button>
17+
</form>
18+
19+
<%- page.content %>
20+
</div>
21+
</main>

themes/Icarus/layout/widget/activity.ejs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
<%
22
const {
3-
permalink, title, description, start, end, address, mentors, workers, sponsors
3+
permalink, title, description, start, end, address, links, mentors, workers, sponsors
44
} = post;
55
66
const event = eventOf(title, description, start, end, address);
77
%>
88
<h2 class="flex-box" style="justify-content: space-between">
99
活动简讯
10-
<a class="button is-link" download="<%= title %>.ics"
11-
href="<%= toDataURI(event + '', 'text/calendar') %>">
12-
添加日历
13-
</a>
10+
<span>
11+
<a class="button is-link" download="<%= title %>.ics"
12+
href="<%= toDataURI(event + '', 'text/calendar') %>">
13+
添加日历
14+
</a>
15+
<% for (let key in links) { %>
16+
<a class="button is-link" target="_blank" href="<%= links[key] %>">
17+
<%= key %>
18+
</a>
19+
<% } %>
20+
</span>
1421
</h2>
1522
<ul>
1623
<li>时间:<%= full_date( start ) %> ~ <%= full_date( end ) %></li>

0 commit comments

Comments
 (0)