-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Discover: show full post excerpt in stream #9410
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -238,21 +238,21 @@ $reader-post-card-breakpoint-small: "( max-width: 550px )"; | |
} | ||
|
||
.reader-post-card__tag { | ||
overflow: hidden; | ||
position: relative; | ||
height: 20px; | ||
width: 100%; | ||
overflow: hidden; | ||
position: relative; | ||
height: 20px; | ||
width: 100%; | ||
|
||
&::after { | ||
@include long-content-fade( $size: 10% ); | ||
} | ||
} | ||
|
||
.reader-post-card__tag .gridicons-tag { | ||
height: 18px; | ||
margin: -4px 5px 0 0; | ||
position: relative; | ||
top: 5px; | ||
height: 18px; | ||
margin: -4px 5px 0 0; | ||
position: relative; | ||
top: 5px; | ||
width: 15px; | ||
fill: lighten( $gray, 10% ); | ||
} | ||
|
@@ -350,14 +350,20 @@ $reader-post-card-breakpoint-small: "( max-width: 550px )"; | |
font-weight: 100; | ||
margin-top: 9px; | ||
word-break: break-word; | ||
overflow: hidden; | ||
max-height: 15px * 1.6 * 3; | ||
position: relative; | ||
} | ||
|
||
// If we're not showing the entire excerpt, clamp to 3 lines | ||
.reader-post-card.card:not(.is-showing-entire-excerpt) { | ||
.reader-post-card__excerpt { | ||
overflow: hidden; | ||
max-height: 15px * 1.6 * 3; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm curious what the advantage is of using this since it isn't relative and we end up with a fixed value anyway? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like it just because it's explanatory and less magical. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My question then is why If we need the context here then maybe we could use some variables?
|
||
|
||
&::before { | ||
@include long-content-fade( $size: 15px * 1.6 * 5 ); | ||
top: inherit; | ||
height: 15px * 1.6; | ||
&::before { | ||
@include long-content-fade( $size: 15px * 1.6 * 5 ); | ||
top: inherit; | ||
height: 15px * 1.6; | ||
} | ||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,6 +43,10 @@ export default function createBetterExcerpt( post ) { | |
return post; | ||
} | ||
|
||
// Create standard excerpt for Discover | ||
post.excerpt_no_html = formatExcerpt( post.excerpt ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i thought the intent was to not mess with the excerpt at all? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ^ That's correct (not messing with the excerpt). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The excerpt sometimes comes wrapped in a If we don't remove this wrapping paragraph, we'd have to display the excerpt using |
||
|
||
// Create better excerpt from the main post content | ||
post.better_excerpt_no_html = post.better_excerpt = formatExcerpt( post.content ); | ||
|
||
// also make a shorter excerpt... | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,11 @@ const debug = Debug( 'calypso:reader:discover' ); // eslint-disable-line | |
import userUtils from 'lib/user/utils'; | ||
import { getSiteUrl as readerRouteGetSiteUrl } from 'reader/route'; | ||
|
||
function hasDiscoverSlug( post, searchSlug ) { | ||
const metaData = get( post, 'discover_metadata.discover_fp_post_formats' ); | ||
return !! ( metaData && find( metaData, { slug: searchSlug } ) ); | ||
} | ||
|
||
export function isDiscoverEnabled() { | ||
return userUtils.getLocaleSlug() === 'en'; | ||
} | ||
|
@@ -22,8 +27,7 @@ export function isDiscoverPost( post ) { | |
} | ||
|
||
export function isDiscoverSitePick( post ) { | ||
const metaData = get( post, 'discover_metadata.discover_fp_post_formats' ); | ||
return !! ( metaData && find( metaData, { slug: 'site-pick' } ) ); | ||
return hasDiscoverSlug( post, 'site-pick' ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nice |
||
} | ||
|
||
export function isInternalDiscoverPost( post ) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indented too far?