Example #1
0
def generate_atom_entry_dict(contents, meta):
    entry = {
        u"title": meta["title"],
        u"link": generate_entry_link(meta["filename"], meta["path"]),
        u"published": create_timestamp(meta["date"]),
        u"updated": create_timestamp(meta["date"]),
        u"name": u"Matt",
        u"content": contents[:100] + "...",
    }

    return entry
Example #2
0
TARGET_DIR = "./site"
TAG_DIR = "tags"
OUTPUT_ENCODING = "utf-8-sig"

EXCLUDED_DIRS = [TEMPLATE_DIR, "./media", STATIC_DIR, "./tests", TARGET_DIR, "./wintersun", ".git"]

PostItem = namedtuple("PostItem", "filename, title, date, tags")
TRANSFORMER = CachingTransformer(MarkdownTransformer)

FEED = Feed(
    [
        {"name": "title", "value": "mattscodecave.com"},
        {"name": "link", "attributes": {"rel": "self", "href": SITE_URL + "/"}},
        {"name": "link", "attributes": {"rel": "alternate", "href": SITE_URL}},
        {"name": "id", "value": SITE_URL + "/"},
        {"name": "updated", "value": create_timestamp()},
    ]
)

env = Environment(loader=PackageLoader("wintersun"))
logger = logging.getLogger(__name__)
logger.addHandler(logging.StreamHandler(stdout))
logger.setLevel(logging.INFO)


def build_tree(path):
    directories, input_files = get_files_and_directories_from(path)

    for md_file in input_files:
        logger.info(u"input file: %s", md_file)
        transform_into_output(md_file, path)