Octopressのテーマを変更する
#Octopress3rd Party Octopress Themesで公開されているので気に入ったものを選ぶ。
CleanPressがステキ。
# テーマのディレクトリまで行ってテーマのリポジトリをclone
$ cd octopress/.theme
$ git clone [email protected]:macjasp/cleanpress.git
Cloning into 'cleanpress'...
remote: Counting objects: 273, done.
remote: Compressing objects: 100% (248/248), done.
remote: Total 273 (delta 30), reused 229 (delta 16)
Receiving objects: 100% (273/273), 1.09 MiB | 554 KiB/s, done.
Resolving deltas: 100% (30/30), done.
# テーマを適用する
$ rake install\[cleanpress\]
(in /Users/kobtea/Programs/octopress)
A theme is already installed, proceeding will overwrite existing files. Are you sure? [y/n] y
## Copying cleanpress theme into ./source and ./sass
mkdir -p source
cp -r .themes/cleanpress/source/. source
mkdir -p sass
cp -r .themes/cleanpress/sass/. sass
mkdir -p source/_posts
mkdir -p public
# generate!
$ rake generate
(in /Users/kobtea/Programs/octopress)
## Generating Site with Jekyll
unchanged sass/screen.scss
Configuration from /Users/kobtea/Programs/octopress/_config.yml
Building site: source -> public
Successfully generated site: source -> public
rake preview
してちゃんと反映されているかを確認する。
おおん、ページ作っていないAboutとかPortfolioがおる…
どのへんで定義されているか探してみる。
$ find . -type f | xargs grep Portfolio
./.themes/cleanpress/source/_includes/custom/navigation.html: <li><a href="{{ root_url }}/portfolio">Portfolio</a></li>
./public/404.html: <li><a href="/portfolio">Portfolio</a></li>
./public/404.html: <li><a href="/portfolio">Portfolio</a></li>
./public/archives/index.html: <li><a href="/portfolio">Portfolio</a></li>
./public/archives/index.html: <li><a href="/portfolio">Portfolio</a></li>
./public/atom.xml:<p>おおん、ページ作っていないAboutとかPortfolioがおる…<br/>
./public/blog/2013/06/15/tywin-lannister-quote/index.html: <li><a href="/portfolio">Portfolio</a></li>
./public/blog/2013/06/15/tywin-lannister-quote/index.html: <li><a href="/portfolio">Portfolio</a></li>
./public/blog/2013/09/22/hello-octopress/index.html: <li><a href="/portfolio">Portfolio</a></li>
./public/blog/2013/09/22/hello-octopress/index.html: <li><a href="/portfolio">Portfolio</a></li>
./public/blog/2013/09/22/use-markdown-on-vim/index.html: <li><a href="/portfolio">Portfolio</a></li>
./public/blog/2013/09/22/use-markdown-on-vim/index.html: <li><a href="/portfolio">Portfolio</a></li>
./public/blog/2013/09/22/use-multibytes-on-ruby/index.html: <li><a href="/portfolio">Portfolio</a></li>
./public/blog/2013/09/22/use-multibytes-on-ruby/index.html: <li><a href="/portfolio">Portfolio</a></li>
./public/blog/2013/09/23/change-octopress-theme/index.html: <li><a href="/portfolio">Portfolio</a></li>
./public/blog/2013/09/23/change-octopress-theme/index.html: <li><a href="/portfolio">Portfolio</a></li>
./public/blog/2013/09/23/change-octopress-theme/index.html:<p>おおん、ページ作っていないAboutとかPortfolioがおる…<br/>
./public/blog/2013/09/23/install-ruby-on-mba/index.html: <li><a href="/portfolio">Portfolio</a></li>
./public/blog/2013/09/23/install-ruby-on-mba/index.html: <li><a href="/portfolio">Portfolio</a></li>
./public/blog/2013/09/23/setup-octopress/index.html: <li><a href="/portfolio">Portfolio</a></li>
./public/blog/2013/09/23/setup-octopress/index.html: <li><a href="/portfolio">Portfolio</a></li>
./public/blog/archives/index.html: <li><a href="/portfolio">Portfolio</a></li>
./public/blog/archives/index.html: <li><a href="/portfolio">Portfolio</a></li>
./public/blog/categories/etc/index.html: <li><a href="/portfolio">Portfolio</a></li>
./public/blog/categories/etc/index.html: <li><a href="/portfolio">Portfolio</a></li>
./public/blog/categories/markdown/index.html: <li><a href="/portfolio">Portfolio</a></li>
./public/blog/categories/markdown/index.html: <li><a href="/portfolio">Portfolio</a></li>
./public/blog/categories/octopress/atom.xml:<p>おおん、ページ作っていないAboutとかPortfolioがおる…<br/>
./public/blog/categories/octopress/index.html: <li><a href="/portfolio">Portfolio</a></li>
./public/blog/categories/octopress/index.html: <li><a href="/portfolio">Portfolio</a></li>
./public/blog/categories/ruby/index.html: <li><a href="/portfolio">Portfolio</a></li>
./public/blog/categories/ruby/index.html: <li><a href="/portfolio">Portfolio</a></li>
./public/blog/categories/vim/index.html: <li><a href="/portfolio">Portfolio</a></li>
./public/blog/categories/vim/index.html: <li><a href="/portfolio">Portfolio</a></li>
./public/blog/index.html: <li><a href="/portfolio">Portfolio</a></li>
./public/blog/index.html: <li><a href="/portfolio">Portfolio</a></li>
./public/blog/index.html:<p>おおん、ページ作っていないAboutとかPortfolioがおる…<br/>
./public/index.html: <li><a href="/portfolio">Portfolio</a></li>
./public/index.html: <li><a href="/portfolio">Portfolio</a></li>
./public/index.html:<p>おおん、ページ作っていないAboutとかPortfolioがおる…<br/>
./source/_includes/custom/navigation.html: <li><a href="{{ root_url }}/portfolio">Portfolio</a></li>
Binary file ./source/_posts/.2013-09-23-change-octopress-theme.markdown.swp matches
./source/_posts/2013-09-23-change-octopress-theme.markdown:おおん、ページ作っていないAboutとかPortfolioがおる...
octopress/.themes/cleanpress/source/_includes/custom/navigation.html
あたりがくさい。
ブランチ切って編集する。
$ cd .themes/cleanpress
$ git branch
* master
$ git checkout -b edit-contents-links
Switched to a new branch 'edit-contents-links'
$ git branch
* edit-contents-links
master
ひとまずコメントアウトしておく。
source: octopress/.themes/cleanpress/source/_includes/custom/navigation.html
<ul>
<li><a href="{{ root_url }}/">Blog</a></li>
<!--li><a href="{{ root_url }}/about">About</a></li-->
<!--li><a href="{{ root_url }}/portfolio">Portfolio</a></li-->
<li><a href="{{ root_url }}/archives">Archive</a></li>
</ul>
再度テーマをインストールする。
$ rake install\[cleanpress\]
(in /Users/kobtea/Programs/octopress)
A theme is already installed, proceeding will overwrite existing files. Are you sure? [y/n] y
## Copying cleanpress theme into ./source and ./sass
mkdir -p source
cp -r .themes/cleanpress/source/. source
mkdir -p sass
cp -r .themes/cleanpress/sass/. sass
mkdir -p source/_posts
mkdir -p public
$ rake generate
(in /Users/kobtea/Programs/octopress)
## Generating Site with Jekyll
unchanged sass/screen.scss
Configuration from /Users/kobtea/Programs/octopress/_config.yml
Building site: source -> public
Successfully generated site: source -> public
ちゃんと消えているね。