-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add preview image for inscription page #1010
Conversation
src/subcommand/server/templates.rs
Outdated
@@ -49,6 +49,8 @@ pub(crate) trait PageContent: Display + 'static { | |||
{ | |||
PageHtml::new(self, chain, has_satoshi_index) | |||
} | |||
|
|||
fn preview_image(&self) -> Option<String>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fn preview_image(&self) -> Option<String>; | |
fn preview_image(&self) -> Option<String> { | |
None | |
} |
src/subcommand/server/templates.rs
Outdated
@@ -49,6 +49,8 @@ pub(crate) trait PageContent: Display + 'static { | |||
{ | |||
PageHtml::new(self, chain, has_satoshi_index) | |||
} | |||
|
|||
fn preview_image(&self) -> Option<String>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fn preview_image(&self) -> Option<String>; | |
fn preview_image_url(&self) -> Option<String>; |
@@ -11,6 +11,10 @@ impl PageContent for InscriptionHtml { | |||
fn title(&self) -> String { | |||
format!("Inscription {}", self.inscription_id) | |||
} | |||
|
|||
fn preview_image(&self) -> Option<String> { | |||
Some(self.inscription_id.to_string()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some(self.inscription_id.to_string()) | |
Some(format!("/content/{}", self.inscription_id.to_string())) |
templates/page.html
Outdated
@@ -4,6 +4,9 @@ | |||
<meta charset=utf-8> | |||
<meta name=format-detection content='telephone=no'> | |||
<meta name=viewport content='width=device-width,initial-scale=1.0'> | |||
%% if let Some(inscription_id) = self.content.preview_image() { | |||
<meta property='og:image' content='/content/{{ inscription_id }}'> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<meta property='og:image' content='/content/{{ inscription_id }}'> | |
<meta property=og:image content='/content/{{ inscription_id }}'> |
No description provided.