-
-
Notifications
You must be signed in to change notification settings - Fork 10k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added post categories based on directories containing _posts
- Loading branch information
Mark Reid
committed
Dec 16, 2008
1 parent
b094b93
commit 3a8f7a8
Showing
7 changed files
with
67 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
# core | ||
require 'fileutils' | ||
require 'time' | ||
require 'yaml' | ||
|
||
# stdlib | ||
|
||
|
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 |
---|---|---|
|
@@ -15,7 +15,6 @@ def xml_escape(input) | |
|
||
def number_of_words(input) | ||
input.split.length | ||
end | ||
end | ||
|
||
end | ||
end | ||
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
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
3a8f7a8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn’t it be better to specify the categories that a post should belong to in an array in the yaml header for the post? This would seem to be a much more flexible way to add a post to multiple categories (and easily change your mind later). The dir structure approach would seem to lead to arbitrarily deep dir structures. And would be much more labor intensive to change. Taking it to the logical extreme, if I have 100 categories, and I have a post that I want to show in all 100 cats, do I have to create a dir structure 100 levels deep? Or do I have 100 dirs and symlink the post file into each of those dirs? (Caveat : I have not tried to use this feature yet so I could be full of crap.)