32 query = resp.search_params[
"query"].lower()
33 json_results = loads(resp.text[5:])
35 outlined =
not re.findall(filled_regex, query)
36 query = re.sub(filled_regex,
"", query).strip()
37 svg_type =
"fill1" if not outlined
else "default"
39 query_parts = query.split(
" ")
41 for result
in json_results[
"icons"]:
42 for part
in query_parts:
43 if part
in result[
"name"]
or part
in result[
"tags"]
or part
in result[
"categories"]:
48 tags = [tag.title()
for tag
in result[
"tags"]]
49 categories = [category.title()
for category
in result[
"categories"]]
53 'template':
'images.html',
54 'url': result_url.format(icon_name=result[
"name"], query=result[
"name"], fill=0
if outlined
else 1),
55 'img_src': img_src_url.format(icon_name=result[
"name"], svg_type=svg_type),
56 'title': result[
"name"].replace(
"_",
"").title(),
57 'content':
", ".join(tags) +
" / " +
", ".join(categories),