-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmain.py
More file actions
36 lines (30 loc) · 1.21 KB
/
Copy pathmain.py
File metadata and controls
36 lines (30 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from staticjinja import Site
from jinja2 import Environment
import gettext
import sys
from os import listdir
from os.path import isfile, join
import os
cwd = os.getcwd()
import feedparser
from os import listdir
from os.path import isfile, join
if __name__ == "__main__":
# d = 'locale'
# dirs = [os.path.join(d, o) for o in os.listdir(d) if os.path.isdir(os.path.join(d,o))]
# for loc in dirs:
# locale = loc.replace('locale/', '')
# if locale == 'ja_JP':
# loc_name = '/jp'
# else:
# loc_name = '/' + locale
# site = Site.make_site(searchpath='./src', env_globals={"locale": loc_name},locale=locale, extensions=['jinja2.ext.i18n','jinja_markdown.MarkdownExtension'])
#
# # enable automatic reloading
# site.render(use_reloader=False)
###Grabbing blogposts and converting them to
# feed = feedparser.parse('https://blog.storychief.io/rss?skip=1&limit=3').entries
site = Site.make_site(searchpath='src/', #env_globals={"feed":feed},
extensions=['jinja2.ext.i18n', 'jinja2.ext.autoescape', 'jinja2.ext.with_','jinja_markdown.MarkdownExtension'])
# enable automatic reloading
site.render(use_reloader=True)