getpelican / pelican

Static site generator that supports Markdown and reST syntax. Powered by Python.
https://getpelican.com
GNU Affero General Public License v3.0
12.56k stars 1.81k forks source link

bug with configure_settings finding theme path #1941

Closed wych42 closed 8 years ago

wych42 commented 8 years ago

When run pelican content, I got an exception with

  File "/Users/xxxx/WorkSpace/python/pelican/lib/python2.7/site-packages/pelican/settings.py", line 220, in configure_settings
    % settings['THEME'])
Exception: Could not find the theme pelican-octopress-theme

Which caused by this line in settings.py: https://github.com/getpelican/pelican/blob/3.6.3/pelican/settings.py#L213

os.path.abspath(__file__) will return absolute path of current file, which is /Users/xxxx/WorkSpace/python/pelican/lib/python2.7/site-packages/pelican/settings.py, so it will never find themes under /Users/xxxx/WorkSpace/python/pelican/lib/python2.7/site-packages/pelican.

Should use os.getcwd() instead?

avaris commented 8 years ago

That's executed if this fails, which in fact checks the path defined by THEME relative to cwd or as an absolute path. To answer your question, it already does that. Most likely, you have a misconfigured THEME setting.

The part you link is related to the themes installed with pelican-themes.

Everything is working as expected/documented.

wych42 commented 8 years ago

Yeah, seems I miss config relative theme path. It works now.