Class: Jekyll::Spaceship::Type

Inherits:
Object
  • Object
show all
Defined in:
lib/jekyll-spaceship/cores/type.rb

Constant Summary collapse

HTML_EXTENSIONS =
%w(
  .html
  .xhtml
  .htm
).freeze
CSS_EXTENSIONS =
%w(
  .css
  .scss
).freeze
MD_EXTENSIONS =
%w(
  .md
  .markdown
).freeze
HTML_BLOCK_TYPE_MAP =
{
  'text/markdown'  => 'markdown',
}.freeze

Class Method Summary collapse

Class Method Details

.css?(_ext) ⇒ Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/jekyll-spaceship/cores/type.rb', line 29

def self.css?(_ext)
  CSS_EXTENSIONS.include?(_ext)
end

.html?(_ext) ⇒ Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/jekyll-spaceship/cores/type.rb', line 25

def self.html?(_ext)
  HTML_EXTENSIONS.include?(_ext)
end

.html_block_type(type) ⇒ Object



37
38
39
# File 'lib/jekyll-spaceship/cores/type.rb', line 37

def self.html_block_type(type)
  HTML_BLOCK_TYPE_MAP[type]
end

.markdown?(_ext) ⇒ Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/jekyll-spaceship/cores/type.rb', line 33

def self.markdown?(_ext)
  MD_EXTENSIONS.include?(_ext)
end