mirror of
https://github.com/jekyll/jekyll.git
synced 2026-01-31 09:48:30 -05:00
implement and use Draft.valid?
This commit is contained in:
@@ -5,6 +5,14 @@ module Jekyll
|
||||
# Valid post name regex (no date)
|
||||
MATCHER = /^(.*)(\.[^.]+)$/
|
||||
|
||||
# Draft name validator. Draft filenames must be like:
|
||||
# my-awesome-post.textile
|
||||
#
|
||||
# Returns true if valid, false if not.
|
||||
def self.valid?(name)
|
||||
name =~ MATCHER
|
||||
end
|
||||
|
||||
# Extract information from the post filename.
|
||||
#
|
||||
# name - The String filename of the post file.
|
||||
|
||||
@@ -212,7 +212,7 @@ module Jekyll
|
||||
|
||||
# first pass processes, but does not yet render post content
|
||||
entries.each do |f|
|
||||
if Post.valid?(f)
|
||||
if Draft.valid?(f)
|
||||
post = Draft.new(self, self.source, dir, f)
|
||||
|
||||
if post.published && (self.future || post.date <= self.time)
|
||||
|
||||
Reference in New Issue
Block a user