Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crotal broken after update from 0.6.0 to 0.9.7 #18

Closed
crsqq opened this issue Dec 7, 2015 · 2 comments
Closed

Crotal broken after update from 0.6.0 to 0.9.7 #18

crsqq opened this issue Dec 7, 2015 · 2 comments

Comments

@crsqq
Copy link

crsqq commented Dec 7, 2015

Updated crotal, now it doesn't work anymore.
Why:
There are not "tags: " entries in my post source files. That wasn't a problem in version 0.6.
But with the most recent version, site generation doesn't work any more.
If I run the generate command, the I get an attribute error:

Traceback (most recent call last):
  File "/home/user/venvs/blog/bin/crotal", line 9, in <module>
    load_entry_point('crotal==0.9.7', 'console_scripts', 'crotal')()
  File "/home/user/venvs/blog/local/lib/python2.7/site-packages/crotal/main.py", line 66, in main
    func(**vars(args))
  File "/home/user/venvs/blog/local/lib/python2.7/site-packages/crotal/command.py", line 74, in generate
    site = Site(path=utils.locate_base_dir(), full=full, output=output)
  File "/home/user/venvs/blog/local/lib/python2.7/site-packages/crotal/site.py", line 33, in __init__
    model.load(self.database, self.config, self.update_data)
  File "/home/user/venvs/blog/local/lib/python2.7/site-packages/crotal/models/base.py", line 110, in load
    cls.load_main_items(config)
  File "/home/user/venvs/blog/local/lib/python2.7/site-packages/crotal/models/base.py", line 130, in load_main_items
    obj = cls.load_single_file(file_path, config)
  File "/home/user/venvs/blog/local/lib/python2.7/site-packages/crotal/models/base.py", line 152, in load_single_file
    item = cls.from_file(file_path, config)
  File "/home/user/venvs/blog/local/lib/python2.7/site-packages/crotal/models/base.py", line 164, in from_file
    return cls.parse_content(file_path, content, config)
  File "/home/user/venvs/blog/local/lib/python2.7/site-packages/crotal/models/base.py", line 186, in parse_content
    return cls(**attributes)
  File "/home/user/venvs/blog/local/lib/python2.7/site-packages/crotal/models/base.py", line 86, in __init__
    self.create()
  File "/home/user/venvs/blog/local/lib/python2.7/site-packages/crotal/models/post.py", line 106, in create
    self.tags = [Tag.add(item, self) for item in self.raw_tags]
AttributeError: 'Post' object has no attribute 'raw_tags'
@dinever
Copy link
Owner

dinever commented Dec 8, 2015

Hi Chris,

Sorry for the bug. Now I have fixed the attribute error and published a newer version 0.9.8. Please update crotal and try again.

Please notice that crotal has changed the template engine from Jinja2 to Mako due to performance. So the template you used in 0.6.0 may not be working anymore.

However, you can create a new site using the newer version crotal, and move your posts into the newer site folder.

crotal init new_site

Move the posts into the newer site folder.

cp -rf old_site/source/* new_site/source/

Generate the site.

cd new_site
crotal generate -f
crotal server

Also, please notice that the port number has changed from 8000 to 1124 due to conflicts with other service. However, you can change the port manually by this:

crotal server -p 8088

Thank you for your interest in this project and wish you a pleasant day!

Ding

@crsqq
Copy link
Author

crsqq commented Dec 9, 2015

Dear Ding,

site generation works fine with the new version (0.98). Thank you so much for the quick response and the bug fix!
But as you supposed: my old template is broken. However, the new default template looks fine, too! Gotta adjust this over the weekend.. :)

Regards,
Chris.

@crsqq crsqq closed this as completed Dec 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants