Class: Blogit::Configuration
- Inherits:
-
Object
- Object
- Blogit::Configuration
- Defined in:
- lib/blogit/configuration.rb
Constant Summary
- REDCARPET_OPTIONS =
When using redcarpet as content parser, pass these options as defaults.
{ hard_wrap: true, filter_html: true, autolink: true, no_intra_emphasis: true, fenced_code_blocks: true, gh_blockcode: true, }
Instance Attribute Summary (collapse)
-
- (Object) ajax_comments
If set to true, the comments form will POST and DELETE to the comments controller using AJAX calls.
-
- (Object) authentication_method
The name of the before filter we'll call to authenticate the current user.
-
- (Object) author_edits_only
If set to true, only the user who authored the post may, edit or destroy.
-
- (Object) blogger_display_name_method
what method do we call on blogger to return their display name? Defaults to :username.
-
- (Object) cache_pages
Should the controllers cache the blog pages as HTML? Defaults to false.
-
- (Object) current_blogger_method
The name of the controller method we'll call to return the current blogger.
-
- (Object) datetime_format
Which DateTime::FORMATS format do we use to display blog and comment publish time Defaults to :short.
-
- (Object) default_parser
The default format for parsing the blog content.
-
- (Object) disqus_shortname
When using disqus comments, what is the shortname of your forum ?.
-
- (Object) highlight_code_syntax
Should text within ""`" or "`" be highlighted as code? Defaults to true.
-
- (Object) include_admin_actions
If set to true, the create, edit, update and destroy actions will be included.
-
- (Object) include_admin_links
If set to true, links for new posts, editing posts and deleting comments will be available.
-
- (Object) include_comments
What kind of comments do you want to add to your blog ? (:active_record, :disqus or :no).
-
- (Object) include_share_bar
Should there be a share bar on every post ?.
-
- (Object) inline_main_app_named_routes
Should the routes of the main app be accessible without the "main_app." prefix ?.
-
- (Object) posts_per_page
Number of posts to show per page.
-
- (Object) redcarpet_options
When using redcarpet as content parser, pass these options as defaults Defaults to REDCARPET_OPTIONS.
-
- (Object) rss_feed_description
The description of the RSS feed for the blog posts Defaults to "[Application Name] Blog Posts".
-
- (Object) rss_feed_title
The title of the RSS feed for the blog posts Defaults to "[Application Name] Blog Posts".
-
- (Object) twitter_username
Twitter username used in the share bar.
Instance Method Summary (collapse)
- - (Object) default_parser_class
-
- (Configuration) initialize
constructor
A new instance of Configuration.
Constructor Details
- (Configuration) initialize
A new instance of Configuration
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/blogit/configuration.rb', line 96 def initialize @include_comments = :active_record @disqus_shortname = "" @include_share_bar = false @twitter_username = "" @current_blogger_method = :current_user @blogger_display_name_method = :username @datetime_format = :short @posts_per_page = 5 @authentication_method = :login_required @author_edits_only = false @ajax_comments = true @include_admin_actions = true @include_admin_links = true @cache_pages = false @default_parser = :markdown @highlight_code_syntax = true @rss_feed_title = "#{Rails.application.engine_name.titleize} Blog Posts" @rss_feed_description = "#{Rails.application.engine_name.titleize} Blog Posts" @redcarpet_options = REDCARPET_OPTIONS end |
Instance Attribute Details
- (Object) ajax_comments
If set to true, the comments form will POST and DELETE to the comments controller using AJAX calls. Defaults to true
50 51 52 |
# File 'lib/blogit/configuration.rb', line 50 def ajax_comments @ajax_comments end |
- (Object) authentication_method
The name of the before filter we'll call to authenticate the current user. Defaults to :login_required
41 42 43 |
# File 'lib/blogit/configuration.rb', line 41 def authentication_method @authentication_method end |
- (Object) author_edits_only
If set to true, only the user who authored the post may, edit or destroy. Defaults to false
45 46 47 |
# File 'lib/blogit/configuration.rb', line 45 def @author_edits_only end |
- (Object) blogger_display_name_method
what method do we call on blogger to return their display name? Defaults to :username
21 22 23 |
# File 'lib/blogit/configuration.rb', line 21 def blogger_display_name_method @blogger_display_name_method end |
- (Object) cache_pages
Should the controllers cache the blog pages as HTML? Defaults to false
72 73 74 |
# File 'lib/blogit/configuration.rb', line 72 def cache_pages @cache_pages end |
- (Object) current_blogger_method
The name of the controller method we'll call to return the current blogger.
17 18 19 |
# File 'lib/blogit/configuration.rb', line 17 def current_blogger_method @current_blogger_method end |
- (Object) datetime_format
Which DateTime::FORMATS format do we use to display blog and comment publish time Defaults to :short
26 27 28 |
# File 'lib/blogit/configuration.rb', line 26 def datetime_format @datetime_format end |
- (Object) default_parser
The default format for parsing the blog content. Defaults to :markdown
64 65 66 |
# File 'lib/blogit/configuration.rb', line 64 def default_parser @default_parser end |
- (Object) disqus_shortname
When using disqus comments, what is the shortname of your forum ?
8 9 10 |
# File 'lib/blogit/configuration.rb', line 8 def disqus_shortname @disqus_shortname end |
- (Object) highlight_code_syntax
-
At the moment this only works when default_parser
is :markdown
Should text within ""`" or "`" be highlighted as code? Defaults to true
37 38 39 |
# File 'lib/blogit/configuration.rb', line 37 def highlight_code_syntax @highlight_code_syntax end |
- (Object) include_admin_actions
If set to true, the create, edit, update and destroy actions will be included. If set to false, you'll have to set these yourself elsewhere in the app
55 56 57 |
# File 'lib/blogit/configuration.rb', line 55 def include_admin_actions @include_admin_actions end |
- (Object) include_admin_links
If set to true, links for new posts, editing posts and deleting comments will be available. If set to false, you'll have to set these yourself in the templates.
60 61 62 |
# File 'lib/blogit/configuration.rb', line 60 def include_admin_links @include_admin_links end |
- (Object) include_comments
What kind of comments do you want to add to your blog ? (:active_record, :disqus or :no)
5 6 7 |
# File 'lib/blogit/configuration.rb', line 5 def include_comments @include_comments end |
- (Object) include_share_bar
Should there be a share bar on every post ?
11 12 13 |
# File 'lib/blogit/configuration.rb', line 11 def @include_share_bar end |
- (Object) inline_main_app_named_routes
Should the routes of the main app be accessible without the "main_app." prefix ?
84 85 86 |
# File 'lib/blogit/configuration.rb', line 84 def inline_main_app_named_routes @inline_main_app_named_routes end |
- (Object) posts_per_page
Number of posts to show per page
31 32 33 |
# File 'lib/blogit/configuration.rb', line 31 def posts_per_page @posts_per_page end |
- (Object) redcarpet_options
When using redcarpet as content parser, pass these options as defaults Defaults to REDCARPET_OPTIONS
68 69 70 |
# File 'lib/blogit/configuration.rb', line 68 def @redcarpet_options end |
- (Object) rss_feed_description
The description of the RSS feed for the blog posts Defaults to "[Application Name] Blog Posts"
80 81 82 |
# File 'lib/blogit/configuration.rb', line 80 def rss_feed_description @rss_feed_description end |
- (Object) rss_feed_title
The title of the RSS feed for the blog posts Defaults to "[Application Name] Blog Posts"
76 77 78 |
# File 'lib/blogit/configuration.rb', line 76 def rss_feed_title @rss_feed_title end |
- (Object) twitter_username
Twitter username used in the share bar
14 15 16 |
# File 'lib/blogit/configuration.rb', line 14 def twitter_username @twitter_username end |
Instance Method Details
- (Object) default_parser_class
118 119 120 |
# File 'lib/blogit/configuration.rb', line 118 def default_parser_class "Blogit::Parsers::#{@default_parser.to_s.classify}Parser".constantize end |