Skip to content

静的な Web サイト生成ツール Nanoc 基本編 - まずは試してみる

Posted on:2010年7月19日 at 12:55

Table of Contents


Open Table of Contents



Nanoc 



Nanoc 使
















Nanoc 


Nanoc  Web  Ruby 


nanoc: a Ruby site compiler that generates static HTML » home


( HTML)



1()

(CMS) CMS Nanoc 
Ruby Nanoc Apache  Web Application  (Nanoc 使 Web )

 Web Application 

Ruby  filterhelper 
使 filterhelper out-of-the-box 

 Mephisto  Ruby On Rails  CMS Nanoc 

Nanoc 使


Ruby Ruby Nanoc  RubyGems RubyGems 
RubyRubyGems 


Ruby 

Ruby Install Guide:: Ruby 

Ruby 


gem 使 Nanoc 
$ sudo gem install nanoc

Nanoc adsf  gem 
$ sudo gem install adsf


$ nanoc -v
nanoc 3.1.3 (c) 2007-2010 Denis Defreyne.
Ruby 1.8.6 (2010-01-11) running on i686-darwin9.8.0 with RubyGems 1.3.7


nanoc  create_site 使
$ nanoc create_site dr_blog
      create  config.yaml
      create  Rakefile
      create  Rules
      create  content/index.html
      create  content/stylesheet.css
      create  layouts/default.html
Created a blank nanoc site at 'dr_blog'. Enjoy!
$ cd dr_blog
$ ll
total 24
-rw-r--r--  1 taka  staff    22  6 15 11:22 Rakefile
-rw-r--r--  1 taka  staff   692  6 15 11:22 Rules
-rw-r--r--  1 taka  staff  2082  6 15 11:22 config.yaml
drwxr-xr-x  4 taka  staff   136  6 15 11:22 content
drwxr-xr-x  3 taka  staff   102  6 15 11:22 layouts
drwxr-xr-x  3 taka  staff   102  6 15 11:22 lib
drwxr-xr-x  2 taka  staff    68  6 15 11:22 output

dr_blog 

content nanoc compile 使

$ nanoc compile
Loading site data...
Compiling site...
      create  [0.00s]  output/style.css
      create  [0.03s]  output/index.html

Site compiled in 0.05s.

content output 


$ nanoc view

localhost  3000  URL http://localhost:3000/ 

調

Nanoc Preview





 (nanoc compile)

 (nanoc view)




1

(Nanoc Item )content/index.html 
---
title: Home
---

<h1>A Brand New nanoc Siteh1>

<p>
  You've just created a new nanoc site. The page you are looking at right now is
  the home page for your site. To get started, consider replacing this default
  homepage with your own customized homepage. Some pointers on how to do so:
p>

<ul>
  <li>
    <p>
      <strong>Change this page's contentstrong> by editing the "index.h%tml"
      file in the "content" directory. This is the actual page content, and
      therefore doesn't include the header, sidebar or style information (those
      are part of the layout).
    p>
  li>
  <li>
    <p>
      <strong>Change the layoutstrong>, which is the "default.html" file in
      the "layouts" directory, and create something unique (and hopefully less
      bland).
    p>
  li>
ul>

<p>
  If you need any help with customizing your nanoc web site, be sure to check
  out the documentation (see sidebar), and be sure to subscribe to the
  discussion group (also see sidebar). Enjoy!
p>

---  --- (Item)() YAML 

content Nanoc  create_item 使

 Item Nanoc 11 Item 

hello-world 
$ nanoc create_item hello-wold
      create  content/hello-wold.html
An item has been created at /hello-wold/.

content  hello-wold.html 
---
title: A New Item
---

Hi, I'm a new item!


---
title: Hello World!!
---

<h2>This is ths first page. "Hello World"h2>


$ nanoc compile
Loading site data...
Compiling site...
      create  [0.02s]  output/hello-wold/index.html
        skip  [0.00s]  output/style.css
        skip  [0.00s]  output/index.html

Site compiled in 0.03s.

 output/hello-wold/index.html URL  http://localhost:3000/hello-world/ 

Nanoc Hello World
Nanoc 便

関連記事

  1. 静的な Web サイト生成ツール Nanoc 基本編 - まずは試してみる
  2. Nanoc のカスタマイズ - 最近の記事一覧の表示
  3. Nanoc のカスタマイズ - タグを管理する
  4. Nanoc のカスタマイズ - 年月毎の記事のアーカイブを用意する