Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
21bdb1e
commit 8dd6aab
Showing
6 changed files
with
23 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,21 @@ | ||
raise 'Post not loaded' unless defined?(Jekyll::Post) | ||
class Jekyll::Post | ||
|
||
# dates in filenames are now optional | ||
# if omitted, dates must be set in the metadata for published posts | ||
|
||
remove_const :MATCHER | ||
MATCHER = /^(.+\/)*(?:(\d+-\d+-\d+)-)?(.*)(\.[^.]+)$/ | ||
|
||
def process(name) | ||
m, cats, date, slug, ext = *name.match(MATCHER) | ||
self.date = date && Time.parse(date) | ||
self.slug = slug | ||
self.ext = ext | ||
end | ||
|
||
def initialize_with_timeless(site, source, dir, name) | ||
initialize_without_timeless(site, source, dir, name) | ||
self.published = false if self.date.nil? | ||
end | ||
alias_method_chain :initialize, :timeless | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters