Skip to content
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

Merged
merged 6 commits into from
Dec 19, 2022
Merged

Conversation

raphjaph
Copy link
Collaborator

No description provided.

@raphjaph raphjaph requested a review from casey December 19, 2022 21:30
@@ -49,6 +49,8 @@ pub(crate) trait PageContent: Display + 'static {
{
PageHtml::new(self, chain, has_satoshi_index)
}

fn preview_image(&self) -> Option<String>;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fn preview_image(&self) -> Option<String>;
fn preview_image(&self) -> Option<String> {
None
}

@@ -49,6 +49,8 @@ pub(crate) trait PageContent: Display + 'static {
{
PageHtml::new(self, chain, has_satoshi_index)
}

fn preview_image(&self) -> Option<String>;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Some(self.inscription_id.to_string())
Some(format!("/content/{}", self.inscription_id.to_string()))

@@ -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 }}'>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<meta property='og:image' content='/content/{{ inscription_id }}'>
<meta property=og:image content='/content/{{ inscription_id }}'>

@casey casey enabled auto-merge (squash) December 19, 2022 21:43
@casey casey merged commit d47005f into ordinals:master Dec 19, 2022
@raphjaph raphjaph deleted the preview-image branch May 1, 2023 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants