ngokevin / ngokevin.com

Personal blog
http://ngokevin.com
3 stars 3 forks source link

error: 'dict object' has no attribute 'albums' #7

Closed luckypoem closed 8 years ago

luckypoem commented 10 years ago

hi. i clone ur site,but in the cloned dir,i run "wok",i met error: 'dict object' has no attribute 'albums'. how to fix it ? tks

ngokevin commented 10 years ago

Try commenting out some hooks in hooks/hooks.py if you don't need the gallery stuff.

hooks = {

'site.start': [thumbnail.create_thumbnails],

# 'page.meta.post': [gallery.get_images],
# 'page.template.pre': [gallery.get_albums, gallery.set_images],
'site.output.post': [compile_sass],

}

luckypoem commented 10 years ago

hi.

as3:~/ngokevin-site# cd content as3:~/ngokevin-site/content# ls about.mkd blog blog.mkd contact.mkd gallery gallery.mkd resume.mkd as3:~/ngokevin-site/content# rm -rf gallery gallery.mkd as3:~/ngokevin-site/content# ls about.mkd blog blog.mkd contact.mkd resume.mkd as3:~/ngokevin-site/content# cd .. as3:~/ngokevin-site# wok as3:~/ngokevin-site#

i published a post: http://as3.brite.biz:34762/blog/test1/,but why the post's superlink didn't appear in the homepage?

luckypoem commented 10 years ago

sorry,it does.maybe this is caused by browser's cache.

ngokevin commented 10 years ago

So everything's okay?

I'm actually migrating my blog to Octopress (with the same theme) right now, if you don't run to run Wok (sort of an inactive project now).

luckypoem commented 10 years ago

hi.

why cannot publish chinese post?

as3:~/ngokevin-site# nano content/blog/20140114_test-chinese.mkd as3:~/ngokevin-site# wok Traceback (most recent call last): File "/usr/local/bin/wok", line 4, in Engine() File "/usr/local/lib/python2.7/site-packages/wok/engine.py", line 104, in init self.load_pages() File "/usr/local/lib/python2.7/site-packages/wok/engine.py", line 238, in load_pages p = Page.from_file(os.path.join(root, f), self.options, self, renderer) File "/usr/local/lib/python2.7/site-packages/wok/page.py", line 111, in from_file page.meta['content'] = page.renderer.render(page.original) File "/usr/local/lib/python2.7/site-packages/wok/renderers.py", line 46, in render return markdown(plain, Markdown.plugins) File "/usr/local/lib/python2.7/site-packages/markdown/init.py", line 419, in markdown return md.convert(text) File "/usr/local/lib/python2.7/site-packages/markdown/init.py", line 281, in convert source = unicode(source) UnicodeDecodeError: 'ascii' codec can't decode byte 0xe8 in position 1: ordinal not in range(128). -- Note: Markdown only accepts unicode input! as3:~/ngokevin-site#

how to fix it?

ngokevin commented 10 years ago

You may have to convert your Chinese input for web publishing. Try looking for a tool.

http://sourceforge.net/projects/chincon/

luckypoem commented 10 years ago

it seems useless.can u try to publish a chinese post in ur site?(u are a chinese?)

ngokevin commented 10 years ago

Not Chinese, but it sounds difficult since Markdown might not support it.

I'm actually converting my site to Octopress right now, it probably has better support for Chinese. You should hold off on using Wok or start off with Octopress (or wait for me to release my current theme as an Octopress theme).

luckypoem commented 10 years ago

hi. it's really a headache.can u try to use ur native language to publish a post in ur site to check wether u will also meet the error? i asked the question here: http://stackoverflow.com/questions/21129020/how-to-fix-unicodedecodeerror-ascii-codec-cant-decode-byte,but i still can't grasp the solution.

luckypoem commented 10 years ago

hi. as per this: http://shirley-ren.iteye.com/blog/1018750,i solved it