Example #1
0
std::string Stencil::page(void) const {
	// Get base document
	Html::Document doc = Component_page_doc<Stencil>(*this);
	Html::Node head = doc.find("head");
	Html::Node body = doc.find("body");

	// Extra metadata
	head.append("meta",{
		{"itemprop","mode"},
		{"content",mode()}
	});
	head.append("meta",{
		{"itemprop","contexts"},
		{"content",join(contexts(),",")}
	});

	// Add stencil content to the main element and give #content id
	auto main = body.select("main");
	main.attr("id","content");
	main.append(*this);

	return doc.dump(false);
}
Example #2
0
std::string Stencil::page(void) const {
	// Get base document
	Html::Document doc = Component_page_doc<Stencil>(*this);
	Html::Node head = doc.find("head");
	Html::Node body = doc.find("body");

	// Extra metadata
	head.append("meta",{
		{"itemprop","contexts"},
		{"content",join(contexts(),",")}
	});

	// Add stencil content to the #main element
	auto main = body.select("#main");
	auto content = main.append("div",{
		{"id","content"}
	}," ");
	content.append(*this);

	return doc.dump();
}