diff options
| author | Xe Iaso <me@christine.website> | 2022-06-14 15:04:17 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-14 15:04:17 -0400 |
| commit | ad6fba4c79e8b5ab08e2f0db8bc4087f03151f7f (patch) | |
| tree | 9888fe24eb3ea35ea0f9b54af8723b4a000e6ad9 /src/app/markdown.rs | |
| parent | 7541df778165b5a96da714256d011685b476abc0 (diff) | |
| download | xesite-ad6fba4c79e8b5ab08e2f0db8bc4087f03151f7f.tar.xz xesite-ad6fba4c79e8b5ab08e2f0db8bc4087f03151f7f.zip | |
Add salary transparency page (#492)
* Move dhall data and types into `/dhall` folder
* Reformat salary transparency data into Dhall
* Wire up the old salary transparency page with a custom element
* Wire up a new salary transparency page
* Expose raw data as JSON
* Make dhall types more portable
* Remove gallery from the navbar
* Make signal boost page point to the new data location
* Add salary transparency page to the footer of the site
* Add site update post for this
Signed-off-by: Xe <me@xeiaso.net>
Diffstat (limited to 'src/app/markdown.rs')
| -rw-r--r-- | src/app/markdown.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/app/markdown.rs b/src/app/markdown.rs index f6ae342..d73a5c5 100644 --- a/src/app/markdown.rs +++ b/src/app/markdown.rs @@ -1,3 +1,4 @@ +use crate::app::Config; use crate::templates::Html; use color_eyre::eyre::{Result, WrapErr}; use comrak::nodes::{Ast, AstNode, NodeValue}; @@ -9,13 +10,14 @@ use comrak::{ use lazy_static::lazy_static; use lol_html::{element, html_content::ContentType, rewrite_str, RewriteStrSettings}; use std::cell::RefCell; +use std::sync::Arc; use url::Url; lazy_static! { static ref SYNTECT_ADAPTER: SyntectAdapter<'static> = SyntectAdapter::new("base16-mocha.dark"); } -pub fn render(inp: &str) -> Result<String> { +pub fn render(cfg: Arc<Config>, inp: &str) -> Result<String> { let mut options = ComrakOptions::default(); options.extension.autolink = true; @@ -100,6 +102,11 @@ pub fn render(inp: &str) -> Result<String> { let file = el.get_attribute("file").expect("wanted xeblog-hero to contain file"); el.replace(&crate::tmpl::xeblog_hero(file, el.get_attribute("prompt")).0, ContentType::Html); Ok(()) + }), + element!("xeblog-salary-history", |el| { + el.replace(&crate::tmpl::xeblog_salary_history(cfg.clone()).0, ContentType::Html); + + Ok(()) }) ], ..RewriteStrSettings::default() |
