Skip to content

Commit

Permalink
fix canonical tags
Browse files Browse the repository at this point in the history
  • Loading branch information
ezrizhu committed Feb 6, 2024
1 parent 7b58a50 commit f7e4d23
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/site/projects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ pub async fn project_index(State(state): State<super::SiteState>) -> Markup {
};
let extra_headers = html! {
link rel="stylesheet" href="/assets/css/post-index.css";
link rel="canonical" href="https://ezrizhu.com/projects";
};
base("Projects", "A list of projects I've worked on", extra_headers, content, Some(state))
}
2 changes: 2 additions & 0 deletions src/site/tags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ fn tags_index(State(state): State<super::SiteState>, page_type: PageType, tags:

let extra_headers = html! {
link rel="stylesheet" href="/assets/css/post-index.css";
link rel="canonical" href=(format!("https://ezrizhu.com/{}/tags", page_name));
};

base("Tags", &format!("List of tags in my {}.", page_name), extra_headers, content, Some(state))
Expand Down Expand Up @@ -95,6 +96,7 @@ async fn tags_get(Path(tag): Path<String>, State(state): State<super::SiteState>

let extra_headers = html! {
link rel="stylesheet" href="/assets/css/post-index.css";
link rel="canonical" href=(format!("https://ezrizhu.com/{}/tags/{}", page_name, tag));
};

(StatusCode::OK, base(&tag, &format!("Posts tagged with {}.", tag), extra_headers, content, Some(state)))
Expand Down

0 comments on commit f7e4d23

Please sign in to comment.