Read more link plugin #120

Merged
merged 3 commits into from Jan 31, 2014

Conversation

Projects
None yet
5 participants
@VuongN
Contributor

VuongN commented Dec 16, 2013

I made this as a pull request to the original pelican project when pelican-plugins wasn't created yet. I was told to convert and move it to the plugin repository. This is a simple plugin that I use on my own blog. Just thought I'd share. Here is an extended read more on this: http://vuongnguyen.com/creating-inline-read-more-link-python-pelican-lxml.html

@justinmayer

This comment has been minimized.

Show comment
Hide comment
@justinmayer

justinmayer Dec 21, 2013

Member

Thanks for the contribution, Vuong. Would you please take a look at the existing Summary plugin and let us know how this plugin differs from it?

Member

justinmayer commented Dec 21, 2013

Thanks for the contribution, Vuong. Would you please take a look at the existing Summary plugin and let us know how this plugin differs from it?

@VuongN

This comment has been minimized.

Show comment
Hide comment
@VuongN

VuongN Dec 22, 2013

Contributor

@justinmayer: https://github.com/getpelican/pelican-plugins/tree/master/summary provides an alternative way to create article's summary. This plugin provides a way to insert an "inline" link to the full article (from the summary) as a DOM child element instead of sibling. For more information, please don't hesitate to skim my blog article (referenced in my pull request). In any case, to answer your question, this plugin serves an entirely different use-case than Summary plugin.

Contributor

VuongN commented Dec 22, 2013

@justinmayer: https://github.com/getpelican/pelican-plugins/tree/master/summary provides an alternative way to create article's summary. This plugin provides a way to insert an "inline" link to the full article (from the summary) as a DOM child element instead of sibling. For more information, please don't hesitate to skim my blog article (referenced in my pull request). In any case, to answer your question, this plugin serves an entirely different use-case than Summary plugin.

@kylef

This comment has been minimized.

Show comment
Hide comment
@kylef

kylef Dec 22, 2013

Member

@VuongN Currently this is the responsibility of the theme.

For example, in the default theme notmyidea:

{{ article.summary }}
<a class="readmore" href="{{ SITEURL }}/{{ article.url }}">read more</a>

Which provides benefits because the theme can choose to style it differently, like in the case of notmyidea where it adds a readmore class.

Member

kylef commented Dec 22, 2013

@VuongN Currently this is the responsibility of the theme.

For example, in the default theme notmyidea:

{{ article.summary }}
<a class="readmore" href="{{ SITEURL }}/{{ article.url }}">read more</a>

Which provides benefits because the theme can choose to style it differently, like in the case of notmyidea where it adds a readmore class.

@VuongN

This comment has been minimized.

Show comment
Hide comment
@VuongN

VuongN Dec 22, 2013

Contributor

@kylef: I'm not sure if you have a chance to read my code or the description of my use-case or my previous comment to @justinmayer. As I described clearly, I had a need to have an INLINE "read more" link, in other words, a child element of the last element in article.summary not a sibling, which is what everyone is doing, including notmyidea theme.

Contributor

VuongN commented Dec 22, 2013

@kylef: I'm not sure if you have a chance to read my code or the description of my use-case or my previous comment to @justinmayer. As I described clearly, I had a need to have an INLINE "read more" link, in other words, a child element of the last element in article.summary not a sibling, which is what everyone is doing, including notmyidea theme.

@VuongN

This comment has been minimized.

Show comment
Hide comment
@VuongN

VuongN Dec 22, 2013

Contributor

For what it's worth, here was the old pull request for this in the pelican core: getpelican/pelican#673 where @ametaireau & @ahmetalpbalkan thought it may add value to pelican community. It solves my problem, I use it for my current site and I thought it might be useful for others.

Contributor

VuongN commented Dec 22, 2013

For what it's worth, here was the old pull request for this in the pelican core: getpelican/pelican#673 where @ametaireau & @ahmetalpbalkan thought it may add value to pelican community. It solves my problem, I use it for my current site and I thought it might be useful for others.

@ahmetb

This comment has been minimized.

Show comment
Hide comment
@ahmetb

ahmetb Dec 24, 2013

@VuongN is right. {{article.summary}} puts a <p/> tag around itself and Read More links go to the next line by default. We want them inline.

ahmetb commented Dec 24, 2013

@VuongN is right. {{article.summary}} puts a <p/> tag around itself and Read More links go to the next line by default. We want them inline.

@drewrockshard

This comment has been minimized.

Show comment
Hide comment
@drewrockshard

drewrockshard Jan 20, 2014

I confirm @VuongN on this as well. While handling from the theme does work well, sometimes you want it inline so that it doesn't create a new line with the link.

I confirm @VuongN on this as well. While handling from the theme does work well, sometimes you want it inline so that it doesn't create a new line with the link.

justinmayer added a commit that referenced this pull request Jan 31, 2014

@justinmayer justinmayer merged commit 2ca0710 into getpelican:master Jan 31, 2014

@ahmetb

This comment has been minimized.

Show comment
Hide comment
@ahmetb

ahmetb Jan 31, 2014

Thanks for merging. Which pelican version will have this?

ahmetb commented Jan 31, 2014

Thanks for merging. Which pelican version will have this?

@justinmayer

This comment has been minimized.

Show comment
Hide comment
@justinmayer

justinmayer Jan 31, 2014

Member

Plugins aren't bundled with Pelican, so this can be used right away.

Member

justinmayer commented Jan 31, 2014

Plugins aren't bundled with Pelican, so this can be used right away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment