Skip to content

Commit 5b8ea4f

Browse files
authored
Feature/migration (#210)
* 🌋 chore: initial commit * chore(.node-version): fix node version * chore(package.json): add gulp-marked * doc(SITEMAP): modify SITEMAP * chore(old): add old site * feat(bulbo): add basic build structure * feat(pages): add pages * design(font): use noto * feat(events): add events pages * chore(todo): update todo * design(event): modify event template * feat(docs): add docs page * style(layout.njk): add space at bottom * chore(pkg.json): update vinyl-accumulate * feat(events): add past events * feat(events): sort items * feat(jobboard): add jobboard * chore(TODO): update TODO * feat(job): sort jobboard * feat(build): add build script * feat(home): show events * feat(contact): update contact list * chore(TODO.md): update TODO * refactor(jobboard): refactor jobboard * feat(news): implement news pages * doc(README.md): add documentation * refactor(bulbofile.js): use global base * feat(index): show only one event in index * fix(news-index): show date correctly * feat(auto-publish): publish from circle ci * feat(doc): update doc link * doc(README.md): update dev doc * fix(update.sh): fix update script * chore(package.json): update vinyl-accumulate * fix(package): update nunjucks to version 3.0.0 https://greenkeeper.io/ * chore: move old site under * fix(old/index.html): change relative path to absolute path * chore(package.json): update yarn.lock * chore(build): make basepath production version * doc(README.md): add note about release * chore(.node-version): update .node-version * chore(.editorconfig): add .editorconfig * fix(old): make old site works under the new site's old/ path * chore(jobboard): remove dummy data * perf(old): move script tags before closing of body * feat(ga): add google analytics * chore(update.sh): update update.sh script
1 parent f70a748 commit 5b8ea4f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+3372
-41
lines changed

.editorconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
root=true
2+
[*]
3+
indent_style=space
4+
indent_size=2
5+
trim_trailing_whitespace=true
6+
insert_final_newline=true

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/node_modules
2+
/build

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6.3.1

README.md

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
# [nodejs.jp][homepage]
2+
3+
# ビルド
4+
5+
npm run build
6+
7+
`build/` 以下にサイトが生成されます。
8+
9+
# 開発サーバ起動
10+
11+
npm run server
12+
13+
`localhost:3100` に開発用ローカルサイトが立ち上がります。
14+
15+
# Event を追加する
16+
17+
`source/events/YYYY/MM-DD-イベント名.md` というファイル名で下のような front-matter つき markdown ファイルを追加してください。
18+
19+
***Note***: path がそのまま URL になるため、URL で利用可能な path 名を選んでください。
20+
21+
```md
22+
---
23+
name: 東京Node学園祭2016
24+
image: images/nodefest-2016.png
25+
date:
26+
- 2016-11-12
27+
- 2016-11-13
28+
venue:
29+
- 1日目 イベント&コミュニティスペース dots.
30+
- 2日目 渋谷マークシティ
31+
ticket:
32+
- url: http://nodejs.connpass.com/event/43011/
33+
name: 東京Node学園祭2016 (1日目)
34+
- url: http://nodejs.connpass.com/event/42182/
35+
name: 東京Node学園祭2016 (2日目)
36+
site:
37+
name: オフィシャルサイト
38+
url: http://nodefest.jp/2016/
39+
---
40+
41+
近年、Node.jsを利用する機会は飛躍的に増えています。クライアントサイドのビルドモジュールやAWS Lambda, WebSocket を使ったリアルタイムウェブアプリケーション、軽量エンジンであることを活かしたIoTでの利用、デスクトップアプリ等、適用範囲が増えています。また昨今のECMAScript 2016が仕様化されたこと、Node.jsとio.jsの分裂と統合等のドラマを経てより一層の注目が期待されます。
42+
43+
...
44+
```
45+
46+
フロントマターの意味
47+
48+
- {string} name - イベント名 (必須)
49+
- {string} image - 画像の path (path は `source` からの相対 path で入力してください。対応する画像を一緒にコミットしてください) (省略可)
50+
- {string[]} date - 実施日の配列 (必須、最低1件)
51+
- {string[]} venue - 会場名の配列 (必須、最低1件)
52+
- {Ticket[]} ticket - チケットの配列 (必須、最低1件)
53+
- {string} ticket[].name - チケット(のリンク)名 (必須)
54+
- {string} ticket[].url - チケットのリンク先 (必須)
55+
- {string} site.name - イベントオフィシャルサイト名 (省略可)
56+
- {string} site.url - イベントオフィシャルサイトURL (省略可)
57+
58+
# News を追加する
59+
60+
`source/news/YYYY/MM-DD-title.md` というファイル名で下のような front-matter つき markdown ファイルを追加してください。
61+
62+
***Note***: path がそのまま URL になるため、URL で利用可能な path 名を選んでください。
63+
64+
```md
65+
---
66+
title: Node v7 がリリースされました。
67+
date: 2016-10-25
68+
author: kt3k
69+
---
70+
71+
Node v7 がリリースされています。詳しくは下記、公式のニュースリリース参照。
72+
73+
https://nodejs.org/en/blog/release/v7.0.0/
74+
```
75+
76+
フロントマターの意味
77+
78+
- {string} title - 記事のタイトル (必須)
79+
- {string} date - 記事の日付 (必須)
80+
- {string} author - 記事の作者 (省略可)
81+
82+
# 求人情報を追加する
83+
84+
`source/jobs/会社名.md` というファイル名で下のような front-matter つき markdown ファイルを追加してください。
85+
86+
***Note***: path がそのまま URL になるため、URL で利用可能な path 名を選んでください。
87+
88+
```md
89+
---
90+
postedAt: 2016-10-10
91+
name: 株式会社リンクリンク
92+
image: images/company-logo/linklink.svg
93+
role:
94+
- Node.js プログラマ
95+
- ディレクター
96+
url: https://www.google.com/
97+
---
98+
99+
当社は1945年設立、2011年マザーズ上場の若い企業で、街コンワールド( http://machicon-world.com/ )という街コンポータルサイトを運営しています。
100+
```
101+
102+
フロントマターの意味
103+
104+
- {string} postedAt - 掲載日 (必須)
105+
- {string} name - 会社名 (求人名) (必須)
106+
- {string} image - 画像の path (path は `source` からの相対 path で入力してください。対応する画像を一緒にコミットしてください) (省略可)
107+
- {string[]} role - 募集職種の配列、(必須、最低1件)
108+
- {string} url - 求人情報の詳細/応募フォームなどへのリンク先 (必須)
109+
110+
# その他のページを編集する
111+
112+
以下の対応するファイルを編集してください。
113+
114+
- index.html - `source/layout/index.njk`
115+
- about.html - `source/about.md`
116+
- events.html - `source/layout/event-index.njk`
117+
- contact.html - `source/about.md`
118+
- docs.html - `source/about.md`
119+
- news.html - `source/layout/news-index.njk`
120+
- jobboard.html - `source/layout/job-index.njk`
121+
122+
***Note***: `.njk` 拡張子のファイルは [nunjucks][nunjucks] テンプレートです。記法は [nunjucks のドキュメント][nunjucks-tmpl-doc] を参照してください。
123+
124+
# デザインを変更する
125+
126+
各ページのベースのテンプレート `source/layout/layout.njk` を編集してください。
127+
128+
# それ以上の細かい修正
129+
130+
[bulbo][bulbo] を使ってビルドしています。具体的にどのファイルがどういうパイプラインでビルドされているかは、`bulbofile.js` を参照してください。bulbofile.js の記法については、[bulbo][bulbo] の README を参照してください。
131+
132+
bulbo の各パイプラインは gulp-plugin (vinyl stream の duplex) の連鎖で成り立ってます (gulp の各タスクと同様)。各パイプラインの各ノードの挙動については各 gulp-plugin のドキュメントを参照してください。
133+
134+
# リリースの仕組み
135+
136+
master にマージされると [CircleCI][CircleCI] 上で `circle.yml` の publish タスクが走り自動的に publish されます。具体的な内容は、`circle.yml``update.sh` の内容を確認してください。
137+
138+
ビルドがうまくいかない/何かが分からないなどの場合は @kt3k まで問い合わせてください。( https://twitter.com/kt3k )
139+
140+
[homepage]: http://nodejs.jp
141+
[bulbo]: https://github.com/kt3k/bulbo
142+
[nunjucks]: http://mozilla.github.io/nunjucks/
143+
[nunjucks-tmpl-doc]: https://mozilla.github.io/nunjucks/templating.html
144+
[CircleCI]: https://circleci.com/

SITEMAP.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# SITEMAP
2+
- HOME - ダウンロードリンク, 本家ドキュメントリンク, 直近イベント1件
3+
- ABOUT - Nodejs.jp (Node.js 日本ユーザーグループ) について
4+
- EVENTS - node学園(等)情報
5+
- event の並び順は新しいもの順
6+
- TODO: あまりにも未来のものがエントリーされるとそのイベントがずっと先頭表示されてしまうので、問題になるかもしれないが、今の所そういうケースは無いと考えて、一旦単純に新しいもの順にする
7+
- CONTACT - irc, ml, email など
8+
- DOCS - 公式ドキュメントリンク, その他記事へリンク
9+
- NEWS - 書籍 LTS リリースなど
10+
- JOBBOARDS - node.js 求人
11+
12+
EVENTS と NEWS は定期的に追加する. その他は不定期更新.

TODO.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# TODO
2+
- HOME に未実施の event が全て表示される
3+
- accumulate filter option を使う
4+
5+
# DONE
6+
- circle ci で gh-pages にデプロイされるように
7+
- ./build に gh-pages 最新が checkout された状態で build して、build 以下を commit push する
8+
- NEWS - 書籍発売, Node.js major version リリースなど
9+
- JOBBOARD - もう一件ついか (jobboard.html のみため確認のため)
10+
- sort accumulated files
11+
- JOBBOARD - node.js 求人
12+
- events
13+
- HOME - ダウンロードリンク, 本家リンク, 直近イベント1件
14+
- ABOUT - nodejs.jp について
15+
- EVENTS - node学園情報
16+
- CONTACT - irc, ml, groups など
17+
- RESOURCES - 記事など
18+
- DOC - 公式ドキュメント

bulbofile.js

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
const bulbo = require('bulbo')
2+
const asset = bulbo.asset
3+
4+
const path = require('path')
5+
const frontMatter = require('gulp-front-matter')
6+
const nunjucks = require('gulp-nunjucks')
7+
const marked = require('gulp-marked')
8+
const wrapper = require('layout-wrapper')
9+
const accumulate = require('vinyl-accumulate')
10+
11+
const data = {
12+
orgName: 'Node.js 日本ユーザーグループ',
13+
pages: require('./pages'),
14+
layoutDir: path.join(__dirname, 'source/layout'),
15+
basepath: process.env.BASEPATH || ''
16+
}
17+
18+
require('nunjucks').configure().addFilter('date', require('nunjucks-date'))
19+
20+
bulbo.dest('build') // Sets the destination
21+
bulbo.port(3100) // Sets the dev server's port
22+
bulbo.base('source')
23+
24+
const layout = defaultLayout => wrapper.nunjucks({
25+
data,
26+
defaultLayout,
27+
layout: 'source/layout',
28+
extname: '.njk'
29+
})
30+
31+
asset('source/**/*.md', '!source/{events,jobs,news}/**/*')
32+
.watch('source/**/*.{md,njk}')
33+
.pipe(frontMatter({property: 'fm'}))
34+
.pipe(nunjucks.compile(data))
35+
.pipe(marked())
36+
.pipe(layout('default'))
37+
38+
asset('source/events/**/*.md')
39+
.watch('source/**/*.{md,njk}')
40+
.pipe(frontMatter({property: 'fm'}))
41+
.pipe(marked())
42+
.pipe(accumulate('index.html', {
43+
debounce: true,
44+
sort: (x, y) => y.fm.date[0].valueOf() - x.fm.date[0].valueOf()
45+
}))
46+
.pipe(layout('index'))
47+
48+
asset('source/events/**/*.md')
49+
.watch('source/**/*.{md,njk}')
50+
.pipe(frontMatter({property: 'fm'}))
51+
.pipe(marked())
52+
.pipe(accumulate('events.html', {
53+
debounce: true,
54+
sort: (x, y) => y.fm.date[0].valueOf() - x.fm.date[0].valueOf()
55+
}))
56+
.pipe(layout('event-index'))
57+
58+
asset('source/events/**/*.md')
59+
.watch('source/**/*.{md,njk}')
60+
.pipe(frontMatter({property: 'fm'}))
61+
.pipe(marked())
62+
.pipe(layout('event'))
63+
64+
asset('source/news/**/*.md')
65+
.watch('source/**/*.{md,njk}')
66+
.pipe(frontMatter({property: 'fm'}))
67+
.pipe(marked())
68+
.pipe(accumulate('news.html', {
69+
debounce: true,
70+
sort: (x, y) => y.fm.date.valueOf() - x.fm.date.valueOf()
71+
}))
72+
.pipe(layout('news-index'))
73+
74+
asset('source/news/**/*.md')
75+
.watch('source/**/*.{md,njk}')
76+
.pipe(frontMatter({property: 'fm'}))
77+
.pipe(marked())
78+
.pipe(layout('news'))
79+
80+
asset('source/jobs/**/*.md')
81+
.watch('source/**/*.{md,njk}')
82+
.pipe(frontMatter({property: 'fm'}))
83+
.pipe(marked())
84+
.pipe(accumulate('jobboard.html', {
85+
debounce: true,
86+
sort: (x, y) => y.fm.postedAt.valueOf() - x.fm.postedAt.valueOf()
87+
}))
88+
.pipe(layout('jobboard'))
89+
90+
asset('source/jobs/**/*.md')
91+
.watch('source/**/*.{md,njk}')
92+
.pipe(frontMatter({property: 'fm'}))
93+
.pipe(marked())
94+
.pipe(layout('job'))
95+
96+
asset('source/css/*.css')
97+
98+
asset('source/images/**/*.{png,svg,jpg,jpeg,gif}')
99+
100+
asset('./old/*.*').base('./')

circle.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
machine:
2+
node:
3+
version: 4
4+
deployment:
5+
publish:
6+
branch: source
7+
commands:
8+
- ./update.sh

favicon.ico

-1.14 KB
Binary file not shown.
File renamed without changes.

0 commit comments

Comments
 (0)