Class: Blogit::Configuration
- Inherits:
-
Object
- Object
- Blogit::Configuration
- Defined in:
- lib/blogit/configuration.rb
Constant Summary
- REDCARPET_OPTIONS =
{ 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?.
-
- (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) 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
Should we include comments for blog posts?.
-
- (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.
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
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/blogit/configuration.rb', line 73 def initialize @include_comments = true @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 @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
41 42 43 |
# File 'lib/blogit/configuration.rb', line 41 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
32 33 34 |
# File 'lib/blogit/configuration.rb', line 32 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
36 37 38 |
# File 'lib/blogit/configuration.rb', line 36 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
12 13 14 |
# File 'lib/blogit/configuration.rb', line 12 def blogger_display_name_method @blogger_display_name_method end |
- (Object) cache_pages
Should the controllers cache the blog pages as HTML?
62 63 64 |
# File 'lib/blogit/configuration.rb', line 62 def cache_pages @cache_pages end |
- (Object) current_blogger_method
The name of the controller method we’ll call to return the current blogger.
8 9 10 |
# File 'lib/blogit/configuration.rb', line 8 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
17 18 19 |
# File 'lib/blogit/configuration.rb', line 17 def datetime_format @datetime_format end |
- (Object) default_parser
The default format for parsing the blog content. Defaults to :markdown
55 56 57 |
# File 'lib/blogit/configuration.rb', line 55 def default_parser @default_parser 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
28 29 30 |
# File 'lib/blogit/configuration.rb', line 28 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
46 47 48 |
# File 'lib/blogit/configuration.rb', line 46 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.
51 52 53 |
# File 'lib/blogit/configuration.rb', line 51 def include_admin_links @include_admin_links end |
- (Object) include_comments
Should we include comments for blog posts?
5 6 7 |
# File 'lib/blogit/configuration.rb', line 5 def include_comments @include_comments end |
- (Object) posts_per_page
Number of posts to show per page
22 23 24 |
# File 'lib/blogit/configuration.rb', line 22 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
59 60 61 |
# File 'lib/blogit/configuration.rb', line 59 def @redcarpet_options end |
Instance Method Details
- (Object) default_parser_class
90 91 92 |
# File 'lib/blogit/configuration.rb', line 90 def default_parser_class "Blogit::Parsers::#{@default_parser.to_s.classify}Parser".constantize end |