BlendedSiteGenerator/Blended

"blended build" encounter error

luckypoem opened this issue · 14 comments

hi.

root@AR:/usr/local/blended-site# cat content/test-3.md

测试3

这是测试3.
root@AR:/usr/local/blended-site#
root@AR:/usr/local/blended-site# blended build
Building your Blended files into a website!
Traceback (most recent call last):
File "/usr/local/bin/blended", line 11, in
sys.exit(cli())
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 664, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 644, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 991, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 837, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 464, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/blended/main.py", line 559, in build
build_files()
File "/usr/local/lib/python2.7/dist-packages/blended/main.py", line 397, in build_files
text_cont1 = convert_text(os.path.join(root, filename))
File "/usr/local/lib/python2.7/dist-packages/blended/main.py", line 251, in convert_text
text_cont1 = "\n"+markdown.markdown(text_content.read())+"\n"
File "/usr/local/lib/python2.7/dist-packages/markdown/init.py", line 494, in markdown
return md.convert(text)
File "/usr/local/lib/python2.7/dist-packages/markdown/init.py", line 359, in convert
source = util.text_type(source)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 2: ordinal not in range(128). -- Note: Markdown only accepts unicode input!
root@AR:/usr/local/blended-site#

test-3.md is written in chinese.how to fix the error?

I just pushed a system update. Run pip install -U blended and then try to build again.

now the chinese post can be published successfully: http://bd.bright.biz.st/test-3.html ,
but i have other issues:
in the site: http://bd.bright.biz.st/index.html ,the post: http://bd.bright.biz.st/test-3.html is published after the post: http://bd.bright.biz.st/bcoz-i-love-u.html,so the post http://bd.bright.biz.st/test-3.html should appear above the post http://bd.bright.biz.st/bcoz-i-love-u.html,right? how to correct the order?

how to paginate?

i ran "pip install blended_html_comment_box" successfully,but in the post such as http://bd.bright.biz.st/test-3.html ,The comment box doesn't show at all.why?

thank you!

First you have to add ["html_comment_box"] to the plugins variable in config.py.
For example, plugins = [["html_comment_box"]]

Then, you need to replace {comment_box} with {html_comment_box} in content_page.html

I am working on the listing issue.

Ok, I updated Blended with the new fixes. Also, I updated the Blended-Blog theme so you will want to update that (from its GitHub) as well.

actually the listing order is not fixed.see http://bd.bright.biz.st/

root@AR:/usr/local/blended-site# ls
build config.py.oldbak content templates-bak
config.py config.pyc templates
root@AR:/usr/local/blended-site#

i rename the old templates to be templates-bak,and in root@AR:/usr/local/blended-site# ,
i ran "git clone https://github.com/johnroper100/Blended-blog templates",then
root@AR:/usr/local/blended-site# blended build
Building your Blended files into a website!
The files are built! You can find them in the build/ directory. Run the view command to see what you have created in a web browser.
root@AR:/usr/local/blended-site#

so ,actually the listing order is not fixed

Currently the list is based on most recently edited so that may be causing some problems. I am looking into it. Also, I dd fix some issues for the page list including giving it support for posts in sub-directories.

hello.

could u pls kindly tell me how did u fix the error: "UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 2: ordinal not in range(128). "?
thank u!

just wondering,could u pls kindly tell me how did u fix the error?

Oh, I had to force set the default encoding on build. sys.setdefaultencoding('utf8')

It is main.py. What would you like to know?

root@localhost:/usr/local/blended-site# ls
blended blended.egg-info build-send.bat LICENSE README.md setup.py
blended-blog build dist logo setup.cfg
root@localhost:/usr/local/blended-site# find . -name main.py
root@localhost:/usr/local/blended-site#

there is no main.py .where is main.py?

In the main source code of Blended (here on GitHub).