Class: Jekyll::AgentMarkdown::MarkdownSiblingPath

Inherits:
Object
  • Object
show all
Defined in:
lib/jekyll/agent_markdown/markdown_sibling_path.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(document_url) ⇒ MarkdownSiblingPath

Returns a new instance of MarkdownSiblingPath.



12
13
14
# File 'lib/jekyll/agent_markdown/markdown_sibling_path.rb', line 12

def initialize(document_url)
  @document_url = document_url.to_s
end

Class Method Details

.for(document_url) ⇒ Object



8
9
10
# File 'lib/jekyll/agent_markdown/markdown_sibling_path.rb', line 8

def self.for(document_url)
  new(document_url).to_s
end

Instance Method Details

#to_sObject



16
17
18
19
20
21
# File 'lib/jekyll/agent_markdown/markdown_sibling_path.rb', line 16

def to_s
  normalized = path_without_output_suffix
  return "/index.md" if normalized.empty?

  "#{normalized}.md"
end