Move image anchors to the image itself instead of the link
This commit is contained in:
parent
50e20b2c43
commit
d272caa8f2
|
@ -8,7 +8,7 @@
|
||||||
"connection": {
|
"connection": {
|
||||||
"type": "ip",
|
"type": "ip",
|
||||||
"address": "127.0.0.1",
|
"address": "127.0.0.1",
|
||||||
"port": 6389,
|
"port": 6379,
|
||||||
"unix": "/path/to/redis.sock"
|
"unix": "/path/to/redis.sock"
|
||||||
},
|
},
|
||||||
"username": null,
|
"username": null,
|
||||||
|
|
|
@ -80,13 +80,13 @@ static inline Element generate_images(const httplib::Request& req, const Config&
|
||||||
const Images& images = illust.images[i];
|
const Images& images = illust.images[i];
|
||||||
const Image& thumbnail = images.thumbnail_or_original();
|
const Image& thumbnail = images.thumbnail_or_original();
|
||||||
const Image& original = images.original_or_thumbnail();
|
const Image& original = images.original_or_thumbnail();
|
||||||
|
std::string id = std::to_string(i + 1);
|
||||||
|
|
||||||
if (show_pages) {
|
if (show_pages) {
|
||||||
std::string id = std::to_string(i + 1);
|
div.nodes.push_back(Element("a", {{"class", "landmark"}, {"href", "#"s + id}}, {id, "/", std::to_string(illust.images.size())}));
|
||||||
div.nodes.push_back(Element("a", {{"class", "landmark"}, {"id", id}, {"href", "#"s + id}}, {id, "/", std::to_string(illust.images.size())}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Element img("img", {{"loading", "lazy"}, {"src", proxy_image_url(req, config, thumbnail.url)}}, {});
|
Element img("img", {{"loading", "lazy"}, {"id", std::move(id)}, {"src", proxy_image_url(req, config, thumbnail.url)}}, {});
|
||||||
if (thumbnail.size) {
|
if (thumbnail.size) {
|
||||||
img.attributes.push_back({"width", std::to_string(thumbnail.size->first)});
|
img.attributes.push_back({"width", std::to_string(thumbnail.size->first)});
|
||||||
img.attributes.push_back({"height", std::to_string(thumbnail.size->second)});
|
img.attributes.push_back({"height", std::to_string(thumbnail.size->second)});
|
||||||
|
|
Loading…
Reference in New Issue