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 default value of og:description in open_graph #578

Merged
merged 1 commit into from
Apr 7, 2014
Merged

Fix default value of og:description in open_graph #578

merged 1 commit into from
Apr 7, 2014

Conversation

sun-zheng-an
Copy link
Contributor

By default, og:description should be page.excerpt or first 200 characters of page.content.

However, in the current implementation, page.excerpt will always be overwritten by page.content.

@@ -18,7 +18,7 @@ module.exports = function(options){

if (!description){
if (page.excerpt) description = format.strip_html(page.excerpt);
if (page.content) description = format.strip_html(content);
else if (page.content) description = format.strip_html(content);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should wrap this line with curly braces when there're more than one condition.

if (page.excerpt){
  description = format.strip_html(page.excerpt);
} else if (page.content){
  description = format.strip_html(content);
}

By default, `og:description` should be `page.excerpt` or first 200 characters of `page.content`.

However, in the current implementation, `page.excerpt` will always be overwritten by `page.content`.
@sun-zheng-an
Copy link
Contributor Author

OK, adapted to your style.

tommy351 added a commit that referenced this pull request Apr 7, 2014
Fix default value of `og:description` in `open_graph`
@tommy351 tommy351 merged commit 2f90b77 into hexojs:dev Apr 7, 2014
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

Successfully merging this pull request may close these issues.

2 participants