Skip to content
Snippets Groups Projects
Commit e8deac42 authored by Nikos Roussos's avatar Nikos Roussos
Browse files

Generalize files functionality

parent 8e0ff9d7
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -20,6 +20,7 @@ import sys
import yaml
import time
from glob import glob
from shutil import copy2
 
from markdown import Markdown
from jinja2 import Environment, FileSystemLoader
Loading
Loading
@@ -82,11 +83,10 @@ def generate_posts():
except OSError:
pass
 
if 'images' in headers:
import shutil
images = headers['images'].split(', ')
for image in images:
shutil.copy2(path.join('posts', image), postpath)
if 'files' in headers:
files = headers['files'].split(', ')
for file in files:
copy2(path.join('posts/files/', file), postpath)
 
filename = '{0}/{1}.html'.format(postpath, headers['slug'])
 
Loading
Loading
File moved
Loading
Loading
@@ -2,7 +2,7 @@ title: Hello World
slug: hello-world
date: 2015-04-13 18:00:00
tags: opensource, python
images: tor-people.jpg
files: tor-people.jpg
---
 
_Welcome to monopati!_
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment