Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable creating posts within container and setting up default layout
- Loading branch information
1 parent
d1c9579
commit 4e876b5
Showing
4 changed files
with
31 additions
and
2 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 |
---|---|---|
@@ -1,10 +1,15 @@ | ||
|
||
from .JekyllPost import * | ||
import os | ||
import os.path | ||
|
||
class JekyllPostContainer: | ||
def __init__(self, dir_path): | ||
self.dir_path = dir_path | ||
self.posts = list([JekyllPost(dir_path + "/" + filename) for filename in os.listdir(dir_path)]) | ||
|
||
def get_posts(self): | ||
return self.posts | ||
return self.posts | ||
|
||
def get_post(self, name): | ||
return JekyllPost(os.path.join(self.dir_path, name + ".md")) |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from .JekyllPostContainer import * | ||
import os | ||
import os.path | ||
class JekyllSite: | ||
|
||
def __init__(self, site_path): | ||
self.site_path = site_path | ||
|
||
def get_post_container(self): | ||
return JekyllPostContainer(os.path.join(self.site_path, "_posts")) | ||
|
||
|
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,2 +1,3 @@ | ||
from .JekyllPost import * | ||
from .JekyllPostContainer import * | ||
from .JekyllPostContainer import * | ||
from .JekyllSite import * |