Skip to content

Commit ff0b7bb

Browse files
committed
Update page search index rendering
1 parent c438fe9 commit ff0b7bb

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

app/models/page.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,15 @@ def body
4343
end
4444

4545
def body_html
46-
ApplicationController.render(inline: body, type: resource.handler, layout: false)
46+
ApplicationController.render(
47+
inline: body,
48+
type: (resource.handler.to_sym == :mdrb) ? :"mdrb-atom" : resource.handler,
49+
layout: false,
50+
content_type: "application/atom+xml",
51+
assigns: {
52+
format: :atom
53+
}
54+
)
4755
end
4856

4957
def body_text

app/views/components/markdown/application.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ def default_commonmarker_options
1212
}
1313
end
1414

15-
def code_block(source, language = "", **attributes)
15+
def code_block(source, metadata = "", **attributes)
16+
language, _ = metadata.split(":", 2)
1617
render CodeBlock::Code.new(source, language: language, **attributes)
1718
end
1819

1920
def image(src, alt: "", title: "")
21+
title, _ = title.split("|", 2)
2022
figure do
2123
image_tag(src, alt: alt, title: title)
2224
figcaption { title }

0 commit comments

Comments
 (0)