#include #include #include #include int templating_handler(UrlParams *params) { TemplateContext ctx = new_context(); context_set(&ctx, "title", "Beaker Example"); context_set(&ctx, "page_heading", "Dynamic Content with Beaker Templates"); context_set(&ctx, "username", "John Doe"); context_set(&ctx, "favourite_colour", "blue"); time_t t = time(NULL); struct tm *tm = localtime(&t); char current_year_str[5]; snprintf(current_year_str, sizeof(current_year_str), "%d", tm->tm_year + 1900); context_set(&ctx, "current_year", current_year_str); char timestamp_str[64]; strftime(timestamp_str, sizeof(timestamp_str), "%Y-%m-%d %H:%M:%S", tm); context_set(&ctx, "timestamp", timestamp_str); context_set(&ctx, "safe_html", "This is bold and italic HTML."); context_set(&ctx, "unsafe_html", "