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

Fix 2798 #2799

Merged
merged 2 commits into from May 25, 2017
Merged

Fix 2798 #2799

merged 2 commits into from May 25, 2017

Conversation

@ralsina
Copy link
Member

@ralsina ralsina commented May 25, 2017

Guess content format from path or imported file on nikola new_post

Fixes #2798

content_format = get_default_compiler(
is_post,
self.site.config['COMPILERS'],
self.site.config['post_pages'])

if content_format not in compiler_names:
elif content_format not in compiler_names:

This comment has been minimized.

@Kwpolska

Kwpolska May 25, 2017
Member

Perhaps that if was there for a reason? (I can’t see it though.)

This comment has been minimized.

@ralsina

ralsina May 25, 2017
Author Member

I checked, this seems to work just as well :)

if extension in extensions:
content_format = compiler

elif not content_format and import_file:

This comment has been minimized.

@Kwpolska

Kwpolska May 25, 2017
Member

Perhaps we could merge that and the first if into one?

This comment has been minimized.

@ralsina

ralsina May 25, 2017
Author Member

Perhaps, but it saves 3 lines of code at the cost of a non-stupid condition. I like stupid conditions.

@Kwpolska Kwpolska merged commit 001fdc2 into master May 25, 2017
4 of 5 checks passed
4 of 5 checks passed
continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
codacy/pr Good work! A positive pull request.
Details
continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@Kwpolska Kwpolska deleted the fix-2798 branch May 25, 2017
@Kwpolska
Copy link
Member

@Kwpolska Kwpolska commented May 25, 2017

Thanks for fixing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.