Octopress Note

新建日志

  • rake new_post\["title"\] 注意转义符号
  • 打开新建 markdown 文件,包含以下

     ---
     layout: post
     title: "Zombie Ninjas Attack: A survivor's retrospective"
     date: 2011-07-03 5:59
     comments: true
     external-url:
     categories:
     --- 
    
  • 如果文章有多个作者,可以加上 author: Your Name

  • 如果该文章正在起草还不需要发布,则加上 published:false
  • 如果直接链接到其他网站的文章,可以加上 external-url:http://note.chenqiwei.com
  • 文章分类如下:

      # One category
      categories: Sass
      # Multiple categories example 1
      categories: [CSS3, Sass, Media Queries]
      # Multiple categories example 2
      categories:
      - CSS3
      - Sass
      - Media Queries 
    

新建页面

  • 新建页面的 URL 与 它的 file path 相同,比如about.markdown的 URL 则是 note.chenqiwei.com/about.html

      rake new_page[super-awesome]
      # creates /source/super-awesome/index.markdown
      rake new_page[super-awesome/page.html]
      # creates /source/super-awesome/page.html 
    

生成 与 预览

    rake generate # Generates posts and pages into the public directory
    rake watch # Watches source/ and sass/ for changes and regenerates
    rake preview # Watches, and mounts a webserver at http://localhost:4000 

用 Rsync 与 VPS 同步

    rake generate # If you haven't generated your blog yet
    rake deploy # Syncs your blog via ssh 
  • public文件夹将会与服务器上的 document root 同步
Aug 21st, 2014

Comments