You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
845B

  1. use std::collections::HashMap;
  2. use tera::Tera;
  3. use front_matter::InsertAnchor;
  4. use config::Config;
  5. /// All the information from the gutenberg site that is needed to render HTML from markdown
  6. #[derive(Debug)]
  7. pub struct RenderContext<'a> {
  8. pub tera: &'a Tera,
  9. pub config: &'a Config,
  10. pub current_page_permalink: &'a str,
  11. pub permalinks: &'a HashMap<String, String>,
  12. pub insert_anchor: InsertAnchor,
  13. }
  14. impl<'a> RenderContext<'a> {
  15. pub fn new(
  16. tera: &'a Tera,
  17. config: &'a Config,
  18. current_page_permalink: &'a str,
  19. permalinks: &'a HashMap<String, String>,
  20. insert_anchor: InsertAnchor,
  21. ) -> RenderContext<'a> {
  22. RenderContext {
  23. tera,
  24. current_page_permalink,
  25. permalinks,
  26. insert_anchor,
  27. config,
  28. }
  29. }
  30. }