-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d2c3d68
Showing
8 changed files
with
793 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
|
||
# Dependency directories | ||
node_modules/ | ||
|
||
# Sass | ||
.sass-cache/ | ||
*.css.map | ||
|
||
# Ignore build | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
本ソフトウェアの著作権は、 コードに特に明記がない物は株式会社はてなに帰属します。 また、本ソフトウェアのライセンスは MIT License とします。 | ||
|
||
==== | ||
|
||
The MIT License | ||
|
||
Copyright (c) 2017 Hatena Co., Ltd | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Hatena-Blog-Theme-Boilerplate | ||
|
||
Boilerplate は、はてなブログのデザインCSSカスタマイズの土台に適したデザインテーマです。 | ||
|
||
はてなブログの必要最小限の見た目が調整されています。このテーマをもとにしてCSSを書くと比較的楽にデザインテーマが作れます。 | ||
「オリジナルテーマの制作にチャレンジしたいけど、0から作るのが大変」という方は、このデザインテーマをもとにしてCSSを書くと比較的楽にテーマが作れます。 | ||
|
||
## Required Components | ||
|
||
- [Node.js](http://nodejs.org/) | ||
|
||
# セットアップ | ||
|
||
下記の手順でリポジトリのcloneとモジュールのインストールを行います。 | ||
|
||
``` | ||
$ git clone [email protected]:hatena/Hatena-Blog-Theme-Boilerplate.git | ||
$ cd Hatena-Blog-Theme-Boilerplate | ||
$ npm install | ||
``` | ||
|
||
# 通常のテーマ開発 | ||
|
||
下記のコマンドで、SCSSファイル変更の監視とコンパイルを行います。 | ||
|
||
``` | ||
$ npm start | ||
``` | ||
|
||
また、コンパイル後 `build/boilerplate.css` が作られます。 | ||
|
||
つづいて、[はてなブログ](http://blog.hatena.ne.jp/)でテーマ検証に使うブログを1つ用意します。ブログの「設定」->「詳細設定」にアクセスし、「headに要素を追加」欄に下記を貼り付けて保存します。 | ||
|
||
``` | ||
<link rel="stylesheet" href="http://localhost:3000/boilerplate.css"/> | ||
<script async src="http://localhost:3000/browser-sync/browser-sync-client.js"></script> | ||
``` | ||
|
||
以降は、ブログを開いた状態でSCSSファイルを保存すると、変更したスタイルが自動的に反映されます。 | ||
|
||
## (オプション)レスポンシブデザインのテーマ開発 | ||
|
||
レスポンシブデザインのテーマを開発する場合、ブログの「デザイン設定」->「カスタマイズ」にアクセスし、「デザインCSS」欄の先頭に下記のコメントを挿入してください。 | ||
|
||
``` | ||
/* Responsive: yes */ | ||
``` | ||
|
||
ヘルプ: [レスポンシブデザインのテーマを作成する際の注意点 - はてなブログ ヘルプ](http://help.hatenablog.com/entry/theme/custom-theme#responsive) | ||
|
||
# 構成 | ||
|
||
``` | ||
boilerplate/ | ||
┣┳ scss/ | ||
┃┗┳ lib/ | ||
┃ ┗ boilerplate.scss | ||
┗┳ build/ | ||
┗ boilerplate.css | ||
``` | ||
|
||
# ライセンス | ||
|
||
このCSSおよびSCSSファイルはMITライセンスのもと自由に複製・再配布できます。 記事本文の書式やコメント欄のスタイルなど、必要な部分だけをコピーして使ってもかまいません。 このデザインテーマをもとにしたテーマの配布も自由です。 | ||
|
||
# 過去のバージョン | ||
|
||
- <https://github.com/hatena/Hatena-Blog-Theme-Boilerplate-Less> | ||
- BoilerplateのLessバージョンです。(開発終了) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = { | ||
files: ['build/boilerplate.css'], | ||
server: { | ||
baseDir: "build" | ||
}, | ||
open: false, | ||
socket: { | ||
domain: 'localhost:3000' | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"name": "hatena-blog-theme-boilerplate", | ||
"version": "2.0.0", | ||
"description": "Boilerplate for Hatena Blog theme", | ||
"author": "Hatena Blog", | ||
"license": "MIT", | ||
"scripts": { | ||
"prestart": "npm run build", | ||
"start": "npm-run-all -p watch server", | ||
"build": "npm-run-all scss autoprefixer", | ||
"scss": "node-sass scss/boilerplate.scss build/boilerplate.css --output-style expanded --indent-width 4", | ||
"autoprefixer": "postcss --use autoprefixer -r build/boilerplate.css --map true", | ||
"server": "browser-sync start -c bs-config.js", | ||
"watch": "chokidar 'scss/' -c 'npm run build'" | ||
}, | ||
"devDependencies": { | ||
"autoprefixer": "^7.1.4", | ||
"browser-sync": "^2.18.13", | ||
"chokidar-cli": "^1.2.0", | ||
"node-sass": "^4.5.3", | ||
"normalize.css": "^7.0.0", | ||
"npm-run-all": "^4.1.1", | ||
"postcss-cli": "^4.1.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
@charset "utf-8"; | ||
/* | ||
Theme: boilerplate | ||
Author: Hatena Blog Team | ||
Responsive: yes | ||
Description: | ||
はてなブログのデザインCSSカスタマイズの土台に適したデザインテーマです。 | ||
このテーマをもとにしてCSSを書くと比較的楽にカスタマイズできます。 | ||
特定の部分(例えば記事本文の書式やコメント欄のスタイルなど)だけをコピーして使ってもかまいません。 | ||
もちろんそのままの状態でも、シンプルなテーマとして使うことができます。 | ||
このCSSおよびSCSSファイルは自由に複製・再配布できます。 | ||
このテーマをもとにしたデザインテーマの配布も自由です。 | ||
Released under the MIT License. | ||
*/ | ||
|
||
// import normalize | ||
@import "node_modules/normalize.css/normalize"; | ||
|
||
// import variable | ||
@import "lib/_variable"; | ||
|
||
// import core | ||
@import "lib/_core"; |
Oops, something went wrong.