Skip to content

Commit

Permalink
Add web contents
Browse files Browse the repository at this point in the history
  • Loading branch information
hakatashi committed Oct 27, 2017
1 parent 3171de0 commit b8f4703
Show file tree
Hide file tree
Showing 60 changed files with 12,096 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ kindlegen

## Generated by Mac filesystem
.DS_Store

node_modules
web/images/
webroot
1 change: 1 addition & 0 deletions layouts/layout-web.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<%= @body %>
447 changes: 447 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"scripts": {
"hakatashi": "cd web && pug -O hakatashi.js -p beautiful-hexo/layout/page.jade -P < beautiful-hexo/layout/page.jade > hakatashi.html",
"napier": "cd web && pug -O napier.js -p beautiful-hexo/layout/page.jade -P < beautiful-hexo/layout/page.jade > napier.html",
"columns": "cd web && pug -O columns.js -p beautiful-hexo/layout/page.jade -P < beautiful-hexo/layout/page.jade > columns.html",
"bib": "cd web && pug -O bib.js -p beautiful-hexo/layout/page.jade -P < beautiful-hexo/layout/page.jade > bib.html",
"index": "cd web && pug -O index.js -p beautiful-hexo/layout/index.jade -P < beautiful-hexo/layout/index.jade > index.html",
"build": "npm run index && npm run hakatashi && npm run napier && npm run columns && npm run bib"
},
"dependencies": {
"pug-cli": "^1.0.0-alpha6"
}
}
7 changes: 7 additions & 0 deletions web.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
set -x

rake web
cp -R images/ web/images/
cd web/
npm install
npm run build
Empty file added web/.gitignore
Empty file.
48 changes: 48 additions & 0 deletions web/base-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
module.exports = {
config: {
title: 'SunPro 2017技術書典',
author: 'SunPro',
email: 'admin@sunpro.io',
description: '技術書典2にて発行された技術系同人誌『SunPro会誌 2017技術書典』です。現在無料公開中。「異世界でゼロからコンピューターを作る方法」「不可能図形を3Dプリントで実現する」「おまけ: コラム集」の3本でお届けします。',
hatena_base: 'http://b.hatena.ne.jp/entry/s/sunpro.io/techbookfest2/',
base: 'https://sunpro.io/techbookfest2/',
},
page: {
url: '',
plain_title: '',
subtitle: '',
content: '',
posts: [],
},
theme: {
'navbar-links': {
'Home': undefined,
'GitHub': 'https://github.com/hakatashi/SunPro-techbookfest2',
},
footer: [],
avatar: '/../../favicon.png',
comment: {
enable: false,
},
highlight: {
enable: true,
},
header: {
title: 'SunPro <wbr>2017<wbr>技術書典',
motto: '技術系よろず同人誌 (2017年4月発行)',
bigimgs: [{
src: '/../../cover.jpg',
desc: '表紙',
}],
},
},
url_for: (path) => {
if (path === undefined) {
return './';
} else if (path.startsWith('http')) {
return path;
} else {
return `beautiful-hexo/source${path}`;
}
},
};
8 changes: 8 additions & 0 deletions web/beautiful-hexo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.DS_Store
Thumbs.db
db.json
*.log
node_modules/
public/
.deploy*/
.idea/
21 changes: 21 additions & 0 deletions web/beautiful-hexo/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2016 twoyao

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
30 changes: 30 additions & 0 deletions web/beautiful-hexo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# [Beautiful-hexo ] (http://twoyao.cn/beautiful-hexo/)[![hexo](https://img.shields.io/badge/Hexo-v3.1%2B-blue.svg)](https://hexo.io/)

Beautiful-hexo is a simple elegant hexo theme ported from [Beautiful-jekyll](http://deanattali.com/beautiful-jekyll) which written by [Dean Attali](http://deanattali.com/aboutme). Nice work!

![hexo-preview](images/hexo-preview.png)

### Install

```
hexo init site
cd site
npm install --save hexo-generator-archive hexo-renderer-jade hexo-generator-tag hexo-generator-feed hexo-generator-sitemap hexo-browsersync
git clone --depth 1 git@github.com:twoyao/beautiful-hexo.git themes/beautiful-hexo
```


Modify `_config.yml` change `theme` to `beautiful-hexo` and configure hexo-generator-archive :

```
theme: beautiful-hexo
archive_generator:
per_page: 0
yearly: false
monthly: false
daily: false
```

Theme config file is brief and clear.
If you have any question, check [hexo online document](https://hexo.io/).
78 changes: 78 additions & 0 deletions web/beautiful-hexo/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
navbar-links:
Archive: /archives
Github: https://github.com/twoyao/beautiful-hexo
About: /about/

avatar: /hexo.png
favicon: /hexo.png

header:
title: "Beautiful Hexo"
motto: Build a beautiful and simple website in minutes
bigimgs:
- src: /bigimgs/01.jpg
desc: beautiful island
- src: /bigimgs/02.jpg
desc: Tropical Fish
- src: /bigimgs/03.jpg
desc: ocean

rss: /atom.xml
googlefonts:
- "Lora:400,700,400italic,700italic"
- "Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800"

highlight:
enable: true
# or use any highlight.js style
# style_path: "//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.5.0/styles/default.min.css"
style_path: "/css/highlight.css"

footer:
facebook:
link: # your link e.g. https://...
title: Facebook
icon: fa-facebook
enalbe: false
weibo:
link: 'http://weibo.com/bisyao?is_all=1'
title: Weibo
icon: fa-weibo
enalbe: true
github:
link: 'https://github.com/twoyao'
title: GitHub
icon: fa-github
enable: true
rss:
link: '/atom.xml'
title: RSS
icon: fa-rss
enable: true
twitter:
link: 'https://twitter.com/twoyao_'
title: Twitter
icon: fa-twitter
enable: true
mail:
link: 'mailto:bisyao@gmail.com'
title: Email me
icon: fa-envelope
enable: true
linkin:
link: # your link here e.g. http...
title: LinkedIn
icon: fa-linkedin
enable: false
stackoverflow:
link: # your link here e.g. http...
title: StackOverflow
icon: fa-stack-overflow
enable: false

google_analytics:

comment:
enable: true
disqus: twoyao

Binary file added web/beautiful-hexo/images/hexo-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions web/beautiful-hexo/languages/en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
prev: '← Newer Posts'
next: 'Older Posts →'
prev_post: '← Previous Post'
next_post: 'Next Post →'
more: '[Read More]'
6 changes: 6 additions & 0 deletions web/beautiful-hexo/languages/zh-cn.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
prev: 上一页
next: 下一页
prev_post: 上一篇
next_post: 下一篇
more: 【阅读全文】

24 changes: 24 additions & 0 deletions web/beautiful-hexo/layout/archive.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
extends partial/base

block header
header.header-section
.intro-header.no-img

block content
.container
.row
.col-lg-6.col-lg-offset-3.col-md-10.col-md-offset-1
ul.archive-list
- var prev_year = 0;
- page.posts.each(function(post) {
- var current_year = full_date(post.date, 'YYYY')-0;
if current_year !== prev_year
h2= current_year
- prev_year=current_year;
li.col-lg-offset-1.col-md-offset-1
span.post-meta= full_date(post.date, 'MMM D')
a.post-title(href=url_for(post.path))= post.title
- })



71 changes: 71 additions & 0 deletions web/beautiful-hexo/layout/index.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
extends partial/base.jade

block header
include partial/index-header.jade

block content
div(class="container", role="main")
.row
.col-lg-6.col-lg-offset-3.col-md-8.col-md-offset-2
p 2017年4月9日に開催された技術書オンリーイベント「技術書典2」にて、技術系同人SunProが発行した技術系同人誌です。
p 現在、半年間のエンバーゴ(公開猶予期間)が過ぎたため、全内容を無料で公開しています!
.col-lg-8.col-lg-offset-2.col-md-10.col-md-offset-1
.downloads.text-center
.pdf
a(href='https://github.com/hakatashi/SunPro-C91/releases/download/201710271545/C91.pdf')
span.fa-stack.fa-lg
i.fa.fa-circle.fa-stack-2x
i.fa.fa-stack-1x.fa-inverse.fa-file-pdf-o
| PDF (14.9MB)
.epub
a(href='https://github.com/hakatashi/SunPro-C91/releases/download/201710271545/C91.epub')
span.fa-stack.fa-lg
i.fa.fa-circle.fa-stack-2x
i.fa.fa-stack-1x.fa-inverse.fa-book
| EPUB (11.5MB)
.mobi
a(href='https://github.com/hakatashi/SunPro-C91/releases/download/201710271545/C91.mobi')
span.fa-stack.fa-lg
i.fa.fa-circle.fa-stack-2x
i.fa.fa-stack-1x.fa-inverse.fa-book
| Kindle (20.5MB)
.socials.text-center
include partial/socials.jade
.col-lg-8.col-lg-offset-2.col-md-10.col-md-offset-1
-
const articles = [
{
title: '異世界でゼロからコンピューターを作る方法',
author: 'hakatashi',
name: 'hakatashi',
entry: '<p>突然ですが、異世界にいきなり飛ばされたら、あなたは何をしますか?</p><p>世界を救う?世界を滅ぼす?ヒロインと結ばれる?どれも魅力的ですが、エンジニアないしプログラマーであるあなたにはもっと他にやることがあるはずです。</p><p>それは……そう、コンピューターを作ることです。</p><p>あなたが異世界転生して最初にするべきことは、蒸気機関を作ることなのです。</p>',
},
{
title: '不可能図形を3Dプリントで実現する',
author: 'Napier_Sabre_V',
name: 'napier',
entry: '<p>初めまして、SunProの3D担当ねいぴあさぶれ(@Napier_Sabre_V)です。今までの出展イベントではマスコットD言語くんとGopher、それにくっつける小物を作ることに終始しており、こうした記事を書くことはなかったのですが、毎回そういうマスコットを増やしていくにも限界があろうということで、もっと一般的な立体を作ってその製作過程を記事にすることとなりました。加えて、コミックマーケット89および91で配布していた3Dプリント外注に関するレポートペーパーもこの記事の後ろに掲載してあります。</p>',
},
{
title: 'おまけ: コラム集',
author: 'Napier_Sabre_V / hideo54',
name: 'columns',
entry: '',
},
{
title: '参考文献',
author: '',
name: 'bib',
entry: '',
},
]
.articles
each article in articles
article.post-preview
a(href=article.name+'.html')
h2.post-title.title #{article.title}
h3.post-subtitle.author #{article.author}
.post-entry
!= article.entry
p.read-more
a(href=article.name+'.html') 続きを読む
49 changes: 49 additions & 0 deletions web/beautiful-hexo/layout/page.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
extends partial/base.jade

block header
header.header-section
.intro-header.no-img
.page-heading
h1!= page.title
if page.subtitle
hr.small
span.page-subheading!= page.subtitle
.pdf.text-center
a(href=page.pdf.link)
span.fa-stack.fa-lg
i.fa.fa-circle.fa-stack-2x
i.fa.fa-stack-1x.fa-inverse.fa-file-pdf-o
= `PDF版 (${page.pdf.size}MB)`
.socials.text-center
include partial/socials.jade
.links
if page.prev
.link-prev
a(href=page.prev.link)
i.fa.fa-arrow-left
= page.prev.title
if page.next
.link-next
a(href=page.next.link)
= page.next.title
i.fa.fa-arrow-right

block content
.container
.row
.col-lg-8.col-lg-offset-2.col-md-10.col-md-offset-1
article(role="main", class="blog-post")
!= page.content

include partial/comment.jade
.links
if page.prev
.link-prev
a(href=page.prev.link)
i.fa.fa-arrow-left
= page.prev.title
if page.next
.link-next
a(href=page.next.link)
= page.next.title
i.fa.fa-arrow-right
13 changes: 13 additions & 0 deletions web/beautiful-hexo/layout/partial/base.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
doctype
html(lang=config.language)
head
include head.jade
body
include nav.jade

block header
block content
block comment

include footer.jade
include footer-scripts.jade
Loading

0 comments on commit b8f4703

Please sign in to comment.