Skip to content

Commit 425251b

Browse files
committed
style: sticky navbar
1 parent 7d85efb commit 425251b

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/core/post.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ impl<'a> OrgPost<'a> {
3232
fn from_orgize_obj(org: Org, filename: &'a str) -> Option<Self> {
3333
let properties = org.document().properties()?;
3434

35+
// NOTE: required
3536
let title = properties.get("TITLE")?.to_string();
3637
let description = properties.get("DESCRIPTION")?.to_string();
3738
let created = DateTime::from_naive_utc_and_offset(
@@ -40,6 +41,7 @@ impl<'a> OrgPost<'a> {
4041
Utc,
4142
);
4243

44+
// NOTE: optional
4345
let thumbnail = match properties.get("THUMBNAIL") {
4446
Some(token) => token.to_string(),
4547
None => format!("{IMAGES_CDN}{DEFAULT_THUMBNAIL}"),

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub static POSTS_DIR: Dir = include_dir!("$CARGO_MANIFEST_DIR/assets/posts");
1717
pub fn App() -> impl IntoView {
1818
view! {
1919
<Router base="/blog">
20-
<nav>
20+
<nav class="sticky top-0 z-50">
2121
<div class="navbar bg-base-100 shadow-sm">
2222
<div class="flex-1">
2323
<A href="posts">
@@ -38,7 +38,7 @@ pub fn App() -> impl IntoView {
3838
</div>
3939
</nav>
4040

41-
<main class="w-full">
41+
<main class="w-full relative">
4242
<div class="flex justify-center">
4343
<div class="w-full max-w-3xl flex-grow p-4 pb-10">
4444
<Routes fallback=|| "Not found.">

0 commit comments

Comments
 (0)