Backlink component
This commit is contained in:
@@ -15,3 +15,23 @@ impl<T: Render> Render for FarLink<'_, T> {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub struct Backlinks(
|
||||||
|
pub &'static [(&'static str, &'static str)],
|
||||||
|
pub &'static str,
|
||||||
|
);
|
||||||
|
|
||||||
|
impl Render for Backlinks {
|
||||||
|
fn render(&self) -> Markup {
|
||||||
|
html! {
|
||||||
|
div {
|
||||||
|
@for (url, text) in self.0 {
|
||||||
|
a href=(url) style="padding-left:5pt;padding-right:5pt;" { (text) }
|
||||||
|
"/"
|
||||||
|
}
|
||||||
|
|
||||||
|
span style="color:var(--metaColor);padding-left:5pt;padding-right:5pt;" { (self.1) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ use crate::{
|
|||||||
components::{
|
components::{
|
||||||
base::{BasePage, PageMetadata},
|
base::{BasePage, PageMetadata},
|
||||||
md::Markdown,
|
md::Markdown,
|
||||||
|
misc::Backlinks,
|
||||||
},
|
},
|
||||||
routes::assets::{Image_Betalupi, Image_Icon},
|
routes::assets::{Image_Betalupi, Image_Icon},
|
||||||
};
|
};
|
||||||
@@ -21,12 +22,7 @@ pub async fn betalupi() -> Markup {
|
|||||||
(BasePage(
|
(BasePage(
|
||||||
meta,
|
meta,
|
||||||
html!(
|
html!(
|
||||||
// TODO: no metadata class, generate backlink array
|
(Backlinks(&[("/", "home")], "whats-a-betalupi"))
|
||||||
div {
|
|
||||||
a href="/" style="padding-left:4pt;padding-right:4pt;" {"home"}
|
|
||||||
"/"
|
|
||||||
span class="metaData" style="padding-left:4pt;padding-right:4pt;" { "whats-a-betalupi" }
|
|
||||||
}
|
|
||||||
|
|
||||||
(Markdown(MD_A))
|
(Markdown(MD_A))
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ use crate::{
|
|||||||
components::{
|
components::{
|
||||||
base::{BasePage, PageMetadata},
|
base::{BasePage, PageMetadata},
|
||||||
md::Markdown,
|
md::Markdown,
|
||||||
|
misc::Backlinks,
|
||||||
},
|
},
|
||||||
routes::assets::Image_Icon,
|
routes::assets::Image_Icon,
|
||||||
};
|
};
|
||||||
@@ -21,12 +22,7 @@ pub async fn links() -> Markup {
|
|||||||
(BasePage(
|
(BasePage(
|
||||||
meta,
|
meta,
|
||||||
html!(
|
html!(
|
||||||
// TODO: no metadata class, generate backlink array
|
(Backlinks(&[("/", "home")], "links"))
|
||||||
div {
|
|
||||||
a href="/" style="padding-left:4pt;padding-right:4pt;" {"home"}
|
|
||||||
"/"
|
|
||||||
span class="metaData" style="padding-left:4pt;padding-right:4pt;" { "links" }
|
|
||||||
}
|
|
||||||
|
|
||||||
(Markdown(MD_A))
|
(Markdown(MD_A))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user