Skip to content

Commit

Permalink
get it working on twitter
Browse files Browse the repository at this point in the history
  • Loading branch information
jb55 committed Dec 21, 2023
1 parent 328c746 commit 5904d4d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
24 changes: 10 additions & 14 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,25 +166,21 @@ fn serve_note_html(
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="UTF-8">
<meta property="og:title" content="{0}"/>
<meta property="og:description" content="{1}"/>
<meta property="og:description" content="{1}" />
<meta property="og:image" content="{2}/{3}.png"/>
<meta property="og:image:alt" content="{0}: {1}" />
<meta property="og:image:height" content="600" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:type" content="image/png" />
<meta property="og:site_name" content="Damus" />
<meta property="og:title" content="{0}: {1}" />
<meta property="og:url" content="{2}/{3}"/>
<meta name="og:type" content="website"/>
<meta name="twitter:card" content="summary"/>
<meta name="twitter:image:src" content="{2}/{3}.png" />
<meta name="twitter:site" content="@damusapp" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="{0}: {1}" />
<meta name="twitter:description" content="{4}" />
<meta property="og:image:alt" content="{0}: {1}" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:site_name" content="Damus" />
<meta property="og:type" content="object" />
<meta property="og:title" content="{0}: {1}" />
<meta property="og:url" content="{2}/{3}" />
<meta property="og:description" content="{4}" />
<meta name="twitter:description" content="{1}" />
</head>
<body>
Expand Down Expand Up @@ -292,11 +288,11 @@ fn get_default_pfp() -> egui::ColorImage {
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
env_logger::init();

let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
let addr = SocketAddr::from(([0, 0, 0, 0], 3000));

// We create a TcpListener and bind it to 127.0.0.1:3000
let listener = TcpListener::bind(addr).await?;
info!("Listening on 127.0.0.1:3000");
info!("Listening on 0.0.0.0:3000");

// Since ndk-sdk will verify for us, we don't need to do it on the db side
let mut cfg = Config::new();
Expand Down
6 changes: 3 additions & 3 deletions src/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ fn note_ui(app: &Notecrumbs, ctx: &egui::Context, note: &NoteRenderData) {
let outer_margin = 40.0;
let inner_margin = 60.0;
let canvas_width = 1200.0;
let canvas_height = 630.0;
let canvas_height = 600.0;
//let canvas_size = Vec2::new(canvas_width, canvas_height);

let total_margin = outer_margin + inner_margin;
Expand Down Expand Up @@ -436,13 +436,13 @@ pub fn render_note(app: &Notecrumbs, render_data: &RenderData) -> Vec<u8> {

let mut surface = match render_data {
RenderData::Note(note_render_data) => rasterize(
(1200, 630),
(1200, 600),
|ctx| note_ui(app, ctx, note_render_data),
Some(options),
),

RenderData::Profile(profile_render_data) => rasterize(
(1200, 630),
(1200, 600),
|ctx| profile_ui(app, ctx, profile_render_data),
Some(options),
),
Expand Down

0 comments on commit 5904d4d

Please sign in to comment.