Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/wp to postman #57

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import watchify from 'watchify';
import browserify from 'browserify';
import babelify from 'babelify';
import pug from 'gulp-pug';
import massProduction from 'gulp-mass-production';
import browserSync from 'browser-sync';
import readConfig from 'read-config';
import watch from 'gulp-watch';
Expand Down Expand Up @@ -65,8 +66,32 @@ gulp.task('pug', () => {
locals.basePath = BASE_PATH;

return gulp.src(`${SRC}/pug/**/[!_]*.pug`)
.pipe(pug({
.pipe(massProduction({
locals: locals,
markdown: 'posts/*.md',
template: `${SRC}/pug/post.pug`,
hrefRule: function (slug, meta) {
return `${meta.category || 'no-category'}/${slug}`;
},
archive: {
top: {
template: `${SRC}/pug/index.pug`,
hrefRule: function () {
return '';
}
},
category: {
template: `${SRC}/pug/category.pug`,
slugRule: function (meta) {
return meta.category;
},
hrefRule: function (slug, meta) {
return `category/${slug}`;
}
}
}
}))
.pipe(pug({
pretty: true,
basedir: `${SRC}/pug`
}))
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"browser-sync": "2.11.*",
"browserify": "12.0.*",
"gulp": "git://github.com/gulpjs/gulp.git#4.0",
"gulp-mass-production": "2.0.0",
"gulp-pleeease": "2.0.*",
"gulp-pug": "^3.0.3",
"gulp-sass": "2.1.*",
Expand Down
17 changes: 17 additions & 0 deletions posts/emogtokyo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: emoji😄 only sns
category: frontend
---
世界一安全安心なSNSを作りました。

炎上の心配もなく、子供も安心して使える。

なおかつ世界中の人と誰でもコミュニケーションがとれるような。

そんな夢のようなWebサービス。

それが[こちら](https://emog.tokyo/)。

絵文字キーボードもあり、手軽に投稿ができます。

ぜひあなたも投稿してみてください。
10 changes: 10 additions & 0 deletions posts/matmax4dx.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: マットマックス4DX with Orphe
category: electronic-work
---

もともと、下記の図のような構成だった「マットマックス4DX」ですが、

Orpheをつかうことによってこんなにシンプルになりました。

Orpheはすごいです。
15 changes: 15 additions & 0 deletions src/pug/category.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
extends /layout/_default-layout

prepend config-block
- page_name = `category: ${massProduction.slug}`

//- append stylesheet-block

//- append javascript-block

block content-block
h2= page_name
ul
each post in massProduction.posts
li
a(href=`/${post.href}`)= post.title
5 changes: 4 additions & 1 deletion src/pug/index.pug
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ prepend config-block
//- append javascript-block

block content-block
| hello, world!
ul
each post in massProduction.posts
li
a(href=`/${post.href}`)= post.title
5 changes: 5 additions & 0 deletions src/pug/layout/_default-layout.pug
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ html(lang="ja")
.wrapper
block content-block

.sidebar
each href, slug in massProduction.siteMap.category
.sidebar__item
a(href=`/${href}`)= slug

// javascript
block javascript-block
script(src=basePath + "/js/script.js?v="+versions["script.js"])
11 changes: 11 additions & 0 deletions src/pug/post.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
extends /layout/_default-layout

prepend config-block
- page_name = massProduction.meta.title

//- append stylesheet-block

//- append javascript-block

block content-block
.content!= massProduction.body
Loading