<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    李順利
    隨筆-50  評論-170  文章-0  trackbacks-0

    程序員的第一篇博客,一般都是Hello World,我也習俗下。

    以下用幾種方式(Octopress)來貼HelloWorld的代碼

    • Backtick Code Blocks
    HelloWorld.java
    1
    2
    3
    4
    5
    6
    7
    8
    9
    
    /**
     *
     * @author ShunLi
     */
      public class HelloWorld {
      public static void main(String[] args) {
          System.out.println("Hello World!");
      }
    }
    
    • Include Code Snippets
    (HelloWorld.java)download
    1
    2
    3
    4
    5
    6
    7
    8
    9
    
    /**
     *
     * @author ShunLi
     */
    public class HelloWorld {
        public static void main(String[] args) {
            System.out.println("Hello World!");
        }
    }
    
    • Gist Embedding
    • Inline Code Blocks
    1
    2
    3
    4
    5
    6
    7
    8
    9
    
    /**
     *
     * @author ShunLi
     */
      public class HelloWorld {
      public static void main(String[] args) {
          System.out.println("Hello World!");
      }
    }
    

    B.T.W. 我以后應該比較常用Backtick code blocks 和 Include code sinipets.

    P.S. 悲催地體驗——在Windows下安裝Octopress

    在Windows下體驗Ruby,真的是一件很痛苦的事情,有打算遷移到Ubuntu環境了。 這里記錄下載Windows下安裝Octopress的步驟,有些真是很痛苦。

    • 安裝 ruby 
      如果你不怕麻煩的話,可以選擇裝ruby+Devkit(Devkit也要安裝不然在bundle install這步附近應該會有問題),Windows下安裝ruby可以通過RubyInstaller(不過好像經常需要翻Wall過去才能打開),更方便地方法是直接通過
      railsinstaller 來安裝,里面包括很多需要的工具。

    • 安裝 python 這個真的需要,ruby核心部分有用到。如果沒有安裝Python的話,在Octopress的代碼高亮(include_code 等)部分可能會出現問題: 
      比如:

    1
    2
    3
    
    Liquid error: No such file or directory - python -c import sys; print sys.executable
    # or
    Liquid error: undefined method `Py_IsInitialized’ for RubyPython::Python:Module
    

    請先安裝 python-xxx.msi,然后把python home(e.g. C:\Python27)加到windows環境變量下 
    請注意,一定要把python home加到windows環境變量下。

    如果還不行的話,請參考這個issue,應該能夠解決。

    • 安裝octopress 
      這個官網已經有介紹了,應該比較簡單。

    • 中文問題
      Windows下如果有中文的話,在generate步驟就會失敗,網上給出的解決方法也很簡單,就是設置自己本機的環境變量 
       
      具體的就是這樣設置的

    1
    2
    
    set LC_ALL=zh_CN.UTF-8
    set LANG=zh_CN.UTF-8
    
    • 還有一個問題 
      對有序序列支持不好,我已經提了一個
      bug了。

    • 就請歡樂地擁抱Octopress/Jekyll吧。

    后記

    Octopress 重裝記

    1. 參考本文 ,安裝ROR,Python并配置好環境配置(中文編碼、python)
    2. git clone git@github.com:lishunli/lishunli.github.com.git (change it by yourself)
    3. git checkout source
    4. bundle install or bundle update
    5. rake setup_github_pages
    6. rake generate, rake preview, rake deploy
    7. rake new_post[“title”] 新建的文章默認是ANSI編碼的,這會導致generate步驟失敗,請轉換為UTF-8格式的文件后重新來過,如果還有問題,嘗試其它的解決辦法。

    順利更新于2012年12月17日



    博客中的一些下載已經放到了百度云了,請根據需要下載。【點我去百度云下載】

    最后弱弱地說一下,如果可以的話,轉載請提供出處( ),謝謝。
    posted on 2012-03-18 00:04 李順利 閱讀(7963) 評論(3)  編輯  收藏

    評論:
    # re: 試用Octopress 2012-03-18 11:43 | 李順利
    @tb
    我知道,我只是寫一些我自己使用過程中的一些問題,在Windows下,有太多問題了。  回復  更多評論
      
    # re: 試用Octopress 2012-03-18 13:57 | liang
    不錯  回復  更多評論
      
    # rake deploy 錯誤 2013-07-30 11:44 | abdong
    d:\GitHub>git clone git://github.com/imathis/octopress.git abdong.github.com
    Cloning into 'abdong.github.com'...
    remote: Counting objects: 10661, done.
    remote: Compressing objects: 100% (5052/5052), done.
    remote: Total 10661 (delta 5434), reused 9941 (delta 4748)
    Receiving objects: 100% (10661/10661), 2.58 MiB | 39.00 KiB/s, done.
    Resolving deltas: 100% (5434/5434), done.

    d:\GitHub>cd abdong.github.com


    d:\GitHub\abdong.github.com>gem install bundler
    Successfully installed bundler-1.3.5
    1 gem installed
    Installing ri documentation for bundler-1.3.5...
    Installing RDoc documentation for bundler-1.3.5...

    d:\GitHub\abdong.github.com>bundle install
    Fetching source index from http://ruby.taobao.org/


    d:\GitHub\abdong.github.com>rake setup_github_pages
    Enter the read/write url for your repository
    (For example, 'git@github.com:your_username/your_username.github.io)
    or 'https://github.com/your_username/your_username.github.io')
    Repository url: git@github.com:abdong/abdong.github.com.git
    Added remote git@github.com:abdong/abdong.github.com.git as origin

    d:\GitHub\abdong.github.com>rake install

    d:\GitHub\abdong.github.com>rake new_post["第一篇博客"]

    d:\GitHub\abdong.github.com>rake generate


    d:\GitHub\abdong.github.com>rake preview


    d:\GitHub\abdong.github.com>rake deploy
    ## Deploying branch to Github Pages
    ## Pulling any updates from Github Pages
    cd _deploy
    ERROR: Repository not found.
    fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.
    cd -
    rm -rf _deploy/index.html

    ## Copying public to _deploy
    cp -r public/. _deploy
    cd _deploy

    ## Commiting: Site updated at 2013-07-30 02:49:26 UTC
    [master 37e047c] Site updated at 2013-07-30 02:49:26 UTC
    61 files changed, 1118 insertions(+)
    .................................................
    create mode 100644 stylesheets/screen.css

    ## Pushing generated _deploy website
    ERROR: Repository not found.
    fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.

    ## Github Pages deploy complete
    cd -


    請問是什么原因,多謝!~  回復  更多評論
      

    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: 亚洲AV无码XXX麻豆艾秋| 免费av片在线观看网站| 亚洲免费无码在线| 黄色网址在线免费| 亚洲婷婷在线视频| jizzjizz亚洲| 日韩版码免费福利视频| 亚洲大尺度无码无码专线一区| 免费很黄很色裸乳在线观看| 国产免费一区二区视频| 亚洲www77777| 亚洲伊人久久精品影院| 免费看男女下面日出水来| 美女扒开尿口给男人爽免费视频 | 亚洲国产二区三区久久| 久久综合AV免费观看| 国产精品成人69XXX免费视频| 亚洲网址在线观看| 在线观看亚洲天天一三视| 99在线视频免费观看视频| 黄色网站软件app在线观看免费 | 无码日韩精品一区二区三区免费| 亚洲乱色伦图片区小说| 久久精品亚洲中文字幕无码网站 | 国产亚洲AV无码AV男人的天堂| 国产人在线成免费视频| 两性色午夜视频免费播放| 亚洲熟妇少妇任你躁在线观看| 亚洲精品无码久久一线| 国产女高清在线看免费观看| 99热这里有免费国产精品| 免费人成大片在线观看播放| 亚洲一级免费视频| 亚洲av中文无码乱人伦在线咪咕| 日韩黄色免费观看| 亚洲精品免费在线| 久久一本岛在免费线观看2020| 新最免费影视大全在线播放| 亚洲老熟女五十路老熟女bbw| 91情国产l精品国产亚洲区| 亚洲人色婷婷成人网站在线观看|