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
Add the option to configure TEASER_REGEXP #1946
Add the option to configure TEASER_REGEXP #1946
Conversation
Changing this to a regexp makes me nervous :-) |
Hi! I tried to make as few changes as possible. But I can change it, or sure. If I understood this correctly, you want something like: TEASER_ENDS = '|'.join(['TEASER_END', 'more']) and use this within the regular expression. Is that what you meant? Thanks for the interest!! :D |
Ah, no, I was just wrong :-) Your change is totally ok, let's merge it! Can you add yourself to AUTHORS.txt and write a one-liner for CHANGES.txt? |
Ok! In a moment I'll push -f :D #yay |
ed4ce53
to
fad190e
Compare
Here you are the changes 👍 |
Checking the code a bit more, you are setting TEASER_REGEXP in conf.py but the code in post.py will still use the one defined in post.py line 75. You will also need to remove that line 75 and use self.config['TEASER_REGEXP'] instead of TEASER_REGEXP in Post.text() so you use the one you configured. |
Not sure if I understand what you mean, sorry. In nikola/post.py I've added:
with this line, I choose the conf.py value (if exists) or set the default value (line 75). From this point minimun changes to use the new teaser_regexp variable. Where is still used the original TEASER_REGEXP? |
You are right... not my best day to review code :-) Merging... |
…_customizable Add the option to configure TEASER_REGEXP
hahahaha, better to be sure!! 💃 |
You're welcome, and thank you for helping the project :-) |
For those who migrate from wordpress (thanks for the importer!), we have the "" tag for the "Read more" link. But the new posts will have ".. TEASER_END" as recommended.
So I'll end with two different "strings" to detect as TEASER_REGEXP.
For that reason, I suggest those changes: