Skip to content

Commit

Permalink
upload changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kjaymiller committed Oct 7, 2019
1 parent 71e3449 commit a95aede
Show file tree
Hide file tree
Showing 5 changed files with 213 additions and 83 deletions.
2 changes: 2 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jinja2 = "*"
pyyaml = "*"
markdown = "*"
wheel = "*"
twine = "*"
render-engine = {path = "./../render_engine/dist/render_engine-2019.10.dev5.tar.gz"}

[requires]

Expand Down
222 changes: 165 additions & 57 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 16 additions & 6 deletions render_engine/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from render_engine.page import Page
from pathlib import Path
import json

import logging

PathString = Union[str, Type[Path]]

Expand Down Expand Up @@ -51,7 +51,7 @@ def __init__(
index_template: Optional[PathString]=None,
index_page: bool=True,
content_path: Optional[PathString]=None,
default_content_type: Type[Page]=Page,
page_content_type: Type[Page]=Page,
template_vars: dict={},
index_template_vars: dict={},
pages: Sequence=[],
Expand All @@ -61,22 +61,32 @@ def __init__(

self.template = template
self.template_vars = template_vars
self.pages = pages

if index_page:
self.index_template = template
self.index_template = index_template
self.index_template_vars = index_template_vars


self.pages = pages

if content_path:
if exclude:
include = list(map(lambda x: f'!{x}', exclude))

glob_start = '**' if recursive else ''
logging.debug(f'filetypes - {include}')

for extension in include:
Path(content_path).glob(f'{glob_start}{x}')
content_pages= list(
Path(content_path)\
.glob(f'{glob_start}{extension}')
)
logging.info(content_pages)
for page in content_pages:
p = page_content_type(
content_path=page,
template=template
)
self.pages.append(p)

def __iter__(self):
return self.pages
Expand Down

0 comments on commit a95aede

Please sign in to comment.