#pragma once #include #include #include "blankie/serializer.h" struct Post; // forward declaration from models.h struct Emoji; // forward declaration from models.h using Element = blankie::html::Element; using Node = blankie::html::Node; using Nodes = std::vector; void serve(const httplib::Request& req, httplib::Response& res, std::string title, Element element, Nodes extra_head = {}); void serve_error(const httplib::Request& req, httplib::Response& res, std::string title, std::optional subtitle = std::nullopt, std::optional info = std::nullopt); void serve_redirect(const httplib::Request& req, httplib::Response& res, std::string url, bool permanent = false); std::string get_origin(const httplib::Request& req); std::string proxy_mastodon_url(const httplib::Request& req, const std::string& url_str); bool should_send_304(const httplib::Request& req, uint64_t hash); Element serialize_post(const httplib::Request& req, const std::string& server, const Post& post); blankie::html::HTMLString preprocess_html(const httplib::Request& req, const std::string& domain_name, const std::vector& emojis, const blankie::html::HTMLString& str); blankie::html::HTMLString preprocess_html(const httplib::Request& req, const std::vector& emojis, const std::string& str);