···582582 }
583583 }
584584}
585585+586586+pub fn pronoun_page(pronouns: &Vec<PronounSet>) -> Markup {
587587+ base(
588588+ Some("Pronouns"),
589589+ None,
590590+ html! {
591591+ h1 {"Pronouns"}
592592+ p {"This page lists the pronouns you should use for me. Please try to use one of these sets:"}
593593+ .grid {
594594+ @for ps in pronouns {
595595+ .card.cell."-4of12" {
596596+ (ps)
597597+ }
598598+ }
599599+ }
600600+601601+ (xesite_templates::conv("Mara".to_string(), "happy".to_string(), html!{
602602+ "You can access this data with "
603603+ a href="/api/pronouns" {"an API call"}
604604+ " too!"
605605+ }))
606606+ },
607607+ )
608608+}
+20-5
src/tmpl/nag.rs
···5566lazy_static! {
77 static ref LOBSTERS: Regex = Regex::new(r#"^https?://lobste.rs"#).unwrap();
88+ static ref HACKER_NEWS: Regex = Regex::new(r#"^https?://news.ycombinator.com"#).unwrap();
89}
9101011#[cfg(debug_assertions)]
1112pub fn referer(_: Option<String>) -> Markup {
1213 html! {
1314 .warning {
1414- "This is a development instance of xesite. Things here are probably unfinished or in drafting. Don't take anything here super seriously. If you want to share this to an online aggregator, please don't. Drafts are not finalized yet for a reason."
1515+ "This is a development instance of xesite. Things here are probably unfinished or in drafting. Don't take anything here super seriously. If you want to share this to an online aggregator, please don't. Drafts are not finalized yet for a reason. Please don't be the reason I need to implement more advanced security than just obscurity."
1516 }
1617 br;
1718 }
···27282829 let referer = referer.unwrap();
29303131+ if HACKER_NEWS.is_match(&referer) {
3232+ return xeblog_conv(
3333+ "Mara".into(),
3434+ "hacker".into(),
3535+ html! {
3636+ "Hello. Before commenting about the author, please read "
3737+ a href="/pronouns" {"this page"}
3838+ " that explains the pronouns that you should be using. tl;dr: the author of this website is NOT male. Please do not use \"he\" or \"him\" when referring to the author."
3939+ },
4040+ );
4141+ }
4242+3043 if LOBSTERS.is_match(&referer) {
3131- return html! {
3232- (xeblog_conv("Mara".into(), "happy".into(), html!{
4444+ return xeblog_conv(
4545+ "Mara".into(),
4646+ "happy".into(),
4747+ html! {
3348 "Hey, thanks for reading Lobsters! We've disabled the ads to thank you for choosing to use a more ethical aggregator."
3434- }))
3535- };
4949+ },
5050+ );
3651 }
37523853 xesite_templates::advertiser_nag()