Pelicanのインストール

GithubPage作成にをPelicanを使う

Creating A Pelican-Powered Site on GitHub Pages

Pelican + Markdown + GitHub Pagesで管理するブログの作り方

  1. Run workon your_username.github.com to activate the project’s virtualenv.
  2. Run python new_post.py to create a new post.
  3. Edit the post in your favorite text editor.
  4. Examine the post in context of your website with make devserver. Shut the server down with ./develop_server.sh stop
  5. When satisfied with the post, run git commit -am “Message describing the post”
  6. Push the source changes with git push origin source
  7. Push compiled files to your website with make github

Pelican + Markdown + GitHub Pagesで管理するブログの作り方 Pelican ブログのインストール方法

pelicanのインストール

$ sudo pip install pelican
Password:
Downloading/unpacking pelican
  Downloading pelican-3.3.tar.gz (195kB): 195kB downloaded
  Running setup.py egg_info for package pelican

Downloading/unpacking feedgenerator>=1.6 (from pelican)
  Downloading feedgenerator-1.7.tar.gz
  Running setup.py egg_info for package feedgenerator

warning: no files found matching '*' under directory 'tests'
warning: no previously-included files matching '*.pyc' found under directory 'tests'
Requirement already satisfied (use --upgrade to upgrade): jinja2>=2.7 in /Users/takeda/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages (from pelican)
Requirement already satisfied (use --upgrade to upgrade): pygments in /Users/takeda/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages (from pelican)
Requirement already satisfied (use --upgrade to upgrade): docutils in /Users/takeda/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages (from pelican)
Requirement already satisfied (use --upgrade to upgrade): pytz>=0a in /Users/takeda/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages (from pelican)
Downloading/unpacking blinker (from pelican)
  Downloading blinker-1.3.tar.gz (91kB): 91kB downloaded
  Running setup.py egg_info for package blinker

Downloading/unpacking unidecode (from pelican)
  Downloading Unidecode-0.04.14.tar.gz (200kB): 200kB downloaded
  Running setup.py egg_info for package unidecode

Requirement already satisfied (use --upgrade to upgrade): six in /Users/takeda/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages (from pelican)
Installing collected packages: pelican, feedgenerator, blinker, unidecode
  Running setup.py install for pelican

Installing pelican script to /Users/takeda/Library/Enthought/Canopy_64bit/User/bin
Installing pelican-import script to /Users/takeda/Library/Enthought/Canopy_64bit/User/bin
Installing pelican-quickstart script to /Users/takeda/Library/Enthought/Canopy_64bit/User/bin
Installing pelican-themes script to /Users/takeda/Library/Enthought/Canopy_64bit/User/bin
Running setup.py install for feedgenerator

warning: no files found matching '*' under directory 'tests'
warning: no previously-included files matching '*.pyc' found under directory 'tests'
  Running setup.py install for blinker

  Running setup.py install for unidecode

Successfully installed pelican feedgenerator blinker unidecode
Cleaning up...

GitHub Pagesへの公開のためのghp-importをインストールする。

$ sudo pip install ghp-import
Downloading/unpacking ghp-import
  Downloading ghp-import-0.4.0.tar.gz
  Running setup.py egg_info for package ghp-import

Installing collected packages: ghp-import
  Running setup.py install for ghp-import
changing mode of build/scripts-2.7/ghp-import from 644 to 755

changing mode of /Users/takeda/Library/Enthought/Canopy_64bit/User/bin/ghp-import to 755
Successfully installed ghp-import
Cleaning up...

##pelican-quickstart」でひな形を作る

$ pelican-quickstart
Welcome to pelican-quickstart v3.3.0.

This script will help you create a new Pelican-based website.

Please answer the following questions so this script can generate the files needed by Pelican.


> Where do you want to create your new web site? [.]
> What will be the title of this web site? Toshiyuki Takeda
> Who will be the author of this web site? toshiukii
> What will be the default language of this web site? [en] ja
> Do you want to specify a URL prefix? e.g., http://example.com   (Y/n) y
> What is your URL prefix? (see above example; no trailing slash) http://toshiukii.github.io
> Do you want to enable article pagination? (Y/n)
> How many articles per page do you want? [10]
> Do you want to generate a Fabfile/Makefile to automate generation and publishing? (Y/n)
> Do you want an auto-reload & simpleHTTP script to assist with theme and site development? (Y/n)
> Do you want to upload your website using FTP? (y/N)
> Do you want to upload your website using SSH? (y/N)
> Do you want to upload your website using Dropbox? (y/N)
> Do you want to upload your website using S3? (y/N)
> Do you want to upload your website using Rackspace Cloud Files? (y/N)
Done. Your new project is available at toshiukii.github.io

ブログの作成と公開

静的ページをホームにする

content/pages/home.mdを以下のようなファイルにする。

Title: Welcome to My Site
URL:
save_as: index.html

Thank you for visiting. Welcome!

http://docs.getpelican.com/en/3.3.0/tips.html

GitHub Pages

https://pages.github.com/

大きすぎるファイル

https://help.github.com/articles/working-with-large-files

独自ドメインの設定

https://help.github.com/articles/setting-up-a-custom-domain-with-github-pages#subdomains

https://github.com/blog/1715-faster-more-awesome-github-pages

543 git clone https://github.com/daigomi-learning/daigomi-learning.github.io.git output 544 cd output/ 545 ls 546 git rm 547 git rm -rf * 548 rsync -a ../oooutput/* . 549 ls 550 rmdir ../oooutput/ 551 ls -la ../oooutput/ 552 ls 553 ls -l 554 ls -la 555 cat ../.gitignore 556 cat ../.gitignore | grep DS 557 ls -la .. 558 ls -l 559 git add –all 560 git status 561 git commit -am “remove old and add new” 562 git push origin master 563 cd .. 564 open . 565 ~/Applications/bin/convert_video.py /Users/takeda/Dropbox/Current/DAIGOMI/daigomi-learning.github.io/lclj2013/content/unit2_files/2013_Dear_Editor_Presen.mp4 566 ls 567 open 2013-06-04_075939_081841.mp4 568 which ffmpeg 569 export proxy=http://proxy.kwansei.ac.jp:8080/ 570 ls /usr/local/Cellar/ 571 sudo brew install ffmpeg 572 pwd 573 ls 574 vi CNAME 575 vi pelicanconf.py 576 mkdir extra 577 echo www.daigomi.org > extra/CNAME 578 vi pelicanconf.py 579 git remote -v 580 make html 581 ls output/ 582 ls output/ 583 find output/ -name CNAME 584 ls extra 585 ls 586 ls -l 587 open 2013-06-04_075939_081841.mp4 588 rm 2013-06-04_075939_081841.mp4 589 ls 590 git status 591 mv extra/ content/ 592 make html 593 ls content/ 594 ls output/ 595 cd output/ 596 git push origin master 597 git status 598 git add CNAME 599 git push origin master 600 git commit -am “add CNAME” 601 git push origin master 602 cat CNAME 603 dig 604 dig daigomi-learning.github.io.git 605 vi CNAME 606 dig github.map.fastly.net. 607 nslookup 192.30.252.153 608 dig www.daigomi.org