svg preview renderer
This commit is contained in:
parent
43a8412f06
commit
faa9599849
29 changed files with 1027 additions and 254 deletions
|
|
@ -1,5 +1,5 @@
|
|||
<.header>
|
||||
Gist <%= @gist.id %>
|
||||
<%= @gist.title || "Gist: #{@gist.id}" %>
|
||||
<:subtitle>This is a gist record from your database.</:subtitle>
|
||||
<:actions>
|
||||
<.link patch={~p"/gists/#{@gist}/show/edit"} phx-click={JS.push_focus()}>
|
||||
|
|
@ -8,10 +8,21 @@
|
|||
</:actions>
|
||||
</.header>
|
||||
|
||||
<.list>
|
||||
<:item title="Code"><%= @gist.code %></:item>
|
||||
<:item title="Lang"><%= @gist.lang %></:item>
|
||||
</.list>
|
||||
<meta property="og:title" content={@gist.title || "Gist: #{@gist.id}"} />
|
||||
<meta property="og:description" content={@gist.desc} />
|
||||
<meta property="og:image" content={url(~p"/gists/#{@gist.id}/preview")} />
|
||||
<meta property="og:image:width" content="1200" />
|
||||
<meta property="og:image:height" content="630" />
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
|
||||
<.code_block
|
||||
class="mt-4"
|
||||
code={@gist.code}
|
||||
language={@gist.lang}
|
||||
title={@gist.title}
|
||||
line_numbers={true}
|
||||
highlighted_lines={[118, 119, 120]}
|
||||
/>
|
||||
|
||||
<.back navigate={~p"/gists"}>Back to gists</.back>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue