mirror of
https://github.com/discourse/discourse.git
synced 2025-04-02 14:26:40 +08:00
make site setting for read time word count per minute
This commit is contained in:
parent
736cbf3d2d
commit
51ced7aeae
@ -228,8 +228,7 @@ const Topic = RestModel.extend({
|
|||||||
const wordCount = this.get('word_count');
|
const wordCount = this.get('word_count');
|
||||||
if (!wordCount) return;
|
if (!wordCount) return;
|
||||||
|
|
||||||
// Avg for 500 words per minute when you account for skimming
|
return Math.floor(wordCount / Discourse.SiteSettings.read_time_word_count);
|
||||||
return Math.floor(wordCount / 500.0);
|
|
||||||
}.property('word_count'),
|
}.property('word_count'),
|
||||||
|
|
||||||
toggleBookmark() {
|
toggleBookmark() {
|
||||||
|
@ -1169,6 +1169,8 @@ en:
|
|||||||
|
|
||||||
automatically_unpin_topics: "Automatically unpin topics when the user reaches the bottom."
|
automatically_unpin_topics: "Automatically unpin topics when the user reaches the bottom."
|
||||||
|
|
||||||
|
read_time_word_count: "Word count per minute for calculating estimated reading time."
|
||||||
|
|
||||||
full_name_required: "Full name is a required field of a user's profile."
|
full_name_required: "Full name is a required field of a user's profile."
|
||||||
enable_names: "Show the user's full name on their profile, user card, and emails. Disable to hide full name everywhere."
|
enable_names: "Show the user's full name on their profile, user card, and emails. Disable to hide full name everywhere."
|
||||||
display_name_on_posts: "Show a user's full name on their posts in addition to their @username."
|
display_name_on_posts: "Show a user's full name on their posts in addition to their @username."
|
||||||
|
@ -1029,6 +1029,10 @@ uncategorized:
|
|||||||
default: true
|
default: true
|
||||||
client: true
|
client: true
|
||||||
|
|
||||||
|
read_time_word_count:
|
||||||
|
default: 500
|
||||||
|
client: true
|
||||||
|
|
||||||
user_preferences:
|
user_preferences:
|
||||||
default_email_digest_frequency:
|
default_email_digest_frequency:
|
||||||
enum: 'DigestEmailSiteSetting'
|
enum: 'DigestEmailSiteSetting'
|
||||||
|
@ -161,7 +161,7 @@ class TopicView
|
|||||||
|
|
||||||
def read_time
|
def read_time
|
||||||
return nil if @post_number.present? && @post_number.to_i != 1 # only show for topic URLs
|
return nil if @post_number.present? && @post_number.to_i != 1 # only show for topic URLs
|
||||||
(@topic.word_count/500).floor if @topic.word_count
|
(@topic.word_count/SiteSetting.read_time_word_count).floor if @topic.word_count
|
||||||
end
|
end
|
||||||
|
|
||||||
def like_count
|
def like_count
|
||||||
|
Loading…
x
Reference in New Issue
Block a user