Add link to tags
This commit is contained in:
parent
fd946d1336
commit
71994b234b
|
@ -11,7 +11,7 @@ static inline Element generate_images(const httplib::Request& req, const Config&
|
||||||
static inline Element generate_preview_images(const httplib::Request& req, const Config& config, const Illust& illust);
|
static inline Element generate_preview_images(const httplib::Request& req, const Config& config, const Illust& illust);
|
||||||
static inline std::vector<blankie::html::Node> parse_description_line(const httplib::Request& req, const Config& config, std::string str);
|
static inline std::vector<blankie::html::Node> parse_description_line(const httplib::Request& req, const Config& config, std::string str);
|
||||||
static inline Element generate_description(const httplib::Request& req, const Config& config, const std::string& description);
|
static inline Element generate_description(const httplib::Request& req, const Config& config, const std::string& description);
|
||||||
static inline Element generate_illust_tags(const Illust& illust);
|
static inline Element generate_illust_tags(const httplib::Request& req, const Config& config, const Illust& illust);
|
||||||
|
|
||||||
static inline bool is_true(const std::string& str);
|
static inline bool is_true(const std::string& str);
|
||||||
static inline std::string time_to_string(time_t time);
|
static inline std::string time_to_string(time_t time);
|
||||||
|
@ -49,7 +49,7 @@ void artworks_route(const httplib::Request& req, httplib::Response& res, const C
|
||||||
if (illust.comment) {
|
if (illust.comment) {
|
||||||
body.nodes.push_back(generate_description(req, config, *illust.comment));
|
body.nodes.push_back(generate_description(req, config, *illust.comment));
|
||||||
}
|
}
|
||||||
body.nodes.push_back(generate_illust_tags(illust));
|
body.nodes.push_back(generate_illust_tags(req, config, illust));
|
||||||
body.nodes.push_back(Element("p", {time_to_string(illust.upload_time)}));
|
body.nodes.push_back(Element("p", {time_to_string(illust.upload_time)}));
|
||||||
serve(req, res, config, std::move(illust.title), std::move(body));
|
serve(req, res, config, std::move(illust.title), std::move(body));
|
||||||
}
|
}
|
||||||
|
@ -161,7 +161,7 @@ static inline Element generate_description(const httplib::Request& req, const Co
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline Element generate_illust_tags(const Illust& illust) {
|
static inline Element generate_illust_tags(const httplib::Request& req, const Config& config, const Illust& illust) {
|
||||||
Element div("div", {{"class", "illusttags"}}, {});
|
Element div("div", {{"class", "illusttags"}}, {});
|
||||||
|
|
||||||
if (illust.ai_generated) {
|
if (illust.ai_generated) {
|
||||||
|
@ -174,7 +174,9 @@ static inline Element generate_illust_tags(const Illust& illust) {
|
||||||
return i.japanese;
|
return i.japanese;
|
||||||
}();
|
}();
|
||||||
|
|
||||||
div.nodes.push_back(Element("span", {"#", std::move(tag)}));
|
div.nodes.push_back(Element("a", {{"href", get_origin(req, config) + "/tags/" + blankie::murl::escape(i.japanese)}}, {
|
||||||
|
"#", std::move(tag)
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
return div;
|
return div;
|
||||||
|
|
Loading…
Reference in New Issue