2012-09-29 2 views

답변

5

마크 업 파일 맨 위에있는 메타 데이터에 published: false을 추가하십시오.

일부 이전 버전의 Octopress는 여전히 미리보기 모드에서 게시물을 표시합니다. 그러나 사이트를 생성하고 배포 할 때 published: false의 게시물은 게시되지 않습니다.

1

rake new_post 페이지를 게시하지 않습니다. 아래와 같은 소스 코드가 있습니다. 당신이 당신의 파일의 변경 내용을했으면

# usage rake new_post[my-new-post] or rake new_post['my new post'] or rake new_post (defaults to "new-post") 
desc "Begin a new post in #{source_dir}/#{posts_dir}" 
task :new_post, :title do |t, args| 
    raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." unless File.directory?(source_dir) 
    mkdir_p "#{source_dir}/#{posts_dir}" 
    args.with_defaults(:title => 'new-post') 
    title = args.title 
    filename = "#{source_dir}/#{posts_dir}/#{Time.now.strftime('%Y-%m-%d')}-#{title.to_url}.#{new_post_ext}" 
    if File.exist?(filename) 
    abort("rake aborted!") if ask("#{filename} already exists. Do you want to overwrite?", ['y', 'n']) == 'n' 
    end 
    puts "Creating new post: #{filename}" 
    open(filename, 'w') do |post| 
    post.puts "---" 
    post.puts "layout: post" 
    post.puts "title: \"#{title.gsub(/&/,'&')}\"" 
    post.puts "date: #{Time.now.strftime('%Y-%m-%d %H:%M')}" 
    post.puts "comments: true" 
    post.puts "categories: " 
    post.puts "---" 
    end 
end 

, 당신은 rake generate이 (공개 디렉토리에 게시물과 페이지를 생성)을 호출 할 수 있습니다.

+0

@unionx 내 게시물에 귀하의 질문에 대한 답변을 했습니까?. 그렇다면 그것을 수락하는 것을 고려하십시오. –