Skip to content

Commit

Permalink
Merge branch 'release/1.1.0-alpha.30'
Browse files Browse the repository at this point in the history
  • Loading branch information
nekofar committed Sep 26, 2024
2 parents 77e3c32 + c5a12e6 commit 751fdef
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 22 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to this project will be documented in this file.

## [1.1.0-alpha.30] - 2024-09-26

### Bug Fixes

- Update Farcaster Composer URL generation

## [1.1.0-alpha.29] - 2024-09-26

### Features
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lilnouns-click"
version = "1.1.0-alpha.29"
version = "1.1.0-alpha.30"
authors = ["Milad Nekofar <milad@nekofar.com>"]
edition = "2021"
description = "A Nounish URL shortener for LilNouns DAO."
Expand Down
46 changes: 26 additions & 20 deletions src/routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ pub async fn handle_redirect<D>(req: Request, ctx: RouteContext<D>) -> worker::R
_ => (String::new(), String::new(), String::new(), String::new()),
};

let mini_app_url = req
.url()
.unwrap()
.as_str()
.replace(sqid, format!("app/{}", sqid).as_str());

let html_doc = format!(
r#"
<!DOCTYPE html>
Expand Down Expand Up @@ -179,26 +185,26 @@ pub async fn handle_redirect<D>(req: Request, ctx: RouteContext<D>) -> worker::R
</body>
</html>
"#,
url, // OpenGraph URL
encode_safe(&title), // OpenGraph Title
encode_safe(&description), // OpenGraph Description
image, // OpenGraph Image URL
image, // OpenGraph Image Secure URL
encode_safe(&title), // OpenGraph Image Alt
url, // Twitter URL
encode_safe(&title), // Twitter Title
encode_safe(&description), // Twitter Description
image, // Twitter Image
image, // Farcaster Image
"Read", // Farcaster Button #1
req.url().unwrap().as_str(), // Farcaster Composer URL
url, // Page Refresh URL
encode_safe(&title), // Page Title
encode_safe(&description), // Page Description
ga_id, // Google Analytics ID
ga_id, // Google Analytics ID
url, // Page Content Link URL
encode_safe(&title), // Page Content Link Title
url, // OpenGraph URL
encode_safe(&title), // OpenGraph Title
encode_safe(&description), // OpenGraph Description
image, // OpenGraph Image URL
image, // OpenGraph Image Secure URL
encode_safe(&title), // OpenGraph Image Alt
url, // Twitter URL
encode_safe(&title), // Twitter Title
encode_safe(&description), // Twitter Description
image, // Twitter Image
image, // Farcaster Image
"Read", // Farcaster Button #1
mini_app_url, // Farcaster Composer URL
url, // Page Refresh URL
encode_safe(&title), // Page Title
encode_safe(&description), // Page Description
ga_id, // Google Analytics ID
ga_id, // Google Analytics ID
url, // Page Content Link URL
encode_safe(&title), // Page Content Link Title
);

let minified_html = minify(html_doc).expect("Failed to minify HTML");
Expand Down

0 comments on commit 751fdef

Please sign in to comment.