From 69724cd743d5fdbdf0736d4a87af3056fa166052 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Thu, 22 Feb 2024 11:06:47 +0000 Subject: [PATCH] Add Open Graph metadata to HTML pages --- src/report_generator.cpp | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/src/report_generator.cpp b/src/report_generator.cpp index 0b0daadb5d..743804ff89 100644 --- a/src/report_generator.cpp +++ b/src/report_generator.cpp @@ -167,13 +167,26 @@ void print_list(std::ostream & out, Container const & source, char const * separ -void print_file_header(std::ostream& out, std::string const & title) { +void print_file_header(std::ostream& out, std::string const & title, std::string const & url_filename = {}, std::string const & desc = {}) { out << R"( -)" << title << R"( +)" << title << R"()"; + + if (url_filename.size()) { + // Open Graph metadata + out << R"( + + + + + +)"; + } + + out << R"(