all repos — nasg @ 4d1ec2278986a734c78099f037644bc3c52cfb05

reorganised Search results
Peter Molnar hello@petermolnar.eu
Thu, 05 Oct 2017 16:47:16 +0200
commit

4d1ec2278986a734c78099f037644bc3c52cfb05

parent

4a0982d3e2bb94c610cc10e1fa77a24c50e26d3a

7 files changed, 63 insertions(+), 191 deletions(-)

jump to
A Search.html

@@ -0,0 +1,53 @@

+<!DOCTYPE html> +<html> +<head> + <meta charset="UTF-8" /> + <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1" /> + <style media="all"> + {% include 'style-dark.css' %} + </style> + <title>Search results for "{{ term }}"</title> +</head> + +<body> + +<header class="content-header" id="main-header"> + <nav class="content-navigation"> + <ul> + <li> + <a title="back to site" href="/"> + « back to the site + </a> + </li> + </ul> + </nav> + + <form role="search" method="get" class="search-form" action="/search"> + <label for="search" class="hide">Search</label> + <input type="search" class="search-field" placeholder="search..." value="{{ term }}" name="s" id="s" title="Search for:"> + <input type="submit" class="search-submit" value="Go ➡"> + </form> + + <br class="clear" /> +</header> + +<section class="content-body"> + <h1 class="p-name hide">Search results for "{{ term }}"</h1> + +{% for category, posts in results.items() %} + <details open="open" class="search-section"> + <summary>{{ category }} [{{ posts|length }}]</summary> + <ol> + {% for fname, post in posts.items() %} + <li> + <p><a href="{{ post.url }}">{{ post.url }}</a></p> + <p>{% if post.title|e %}{{ post.txt }}{% else %}{{ post.title }}{% endif %}</p> + </li> + {% endfor %} + </ol> + </details> +{% endfor %} +</section> + +</body> +</html>
D block_exif.html

@@ -1,46 +0,0 @@

-<aside class="exif"> - <dl> -{% if post.exif.camera %} - <dt>Camera</dt> - <dd> - <svg class="icon"><use xlink:href="#icon-camera" /></svg> - {{ post.exif.camera }} - </dd> -{% endif %} -{% if post.exif.aperture %} - <dt>Aperture</dt> - <dd> - <svg class="icon"><use xlink:href="#icon-aperture" /></svg> - f/{{ post.exif.aperture }} - </dd> -{% endif %} -{% if post.exif.shutter_speed %} - <dt>Shutter speed</dt> - <dd> - <svg class="icon"><use xlink:href="#icon-clock" /></svg> - {{ post.exif.shutter_speed }} sec - </dd> -{% endif %} -{% if post.exif.focal_length %} - <dt>Focal length (as set)</dt> - <dd> - <svg class="icon"><use xlink:href="#icon-focallength" /></svg> - {{ post.exif.focal_length }}{% if not post.exif.focal_length|search( 'mm' ) %} mm{% endif %} - </dd> -{% endif %} -{% if post.exif.iso %} - <dt>Sensitivity</dt> - <dd> - <svg class="icon"><use xlink:href="#icon-sensitivity" /></svg> - ISO {{ post.exif.iso }} - </dd> -{% endif %} -{% if post.exif.lens %} - <dt>Lens</dt> - <dd> - <svg class="icon"><use xlink:href="#icon-lens" /></svg> - {{ post.exif.lens }} - </dd> -{% endif %} - </dl> -</aside>
D block_photo.html

@@ -1,7 +0,0 @@

-<section class="photo"> - <p> - <a href="{{ post.photo.target }}" class="{{ post.photo.cl }}"> - <img src="{{ post.photo.fallback }}" title="{{ post.photo.title }}" alt="{{ post.photo.alt }}" class="adaptimg" /> - </a> - </p> -</section>
M magic.phpMagicPHP.html

@@ -58,13 +58,13 @@

$redirects = array( {% for (from, to) in redirects %} "{{ from }}" => "{{ to }}", -{%- endfor -%} +{% endfor %} ); $gone = array( {% for gone in gones %} "{{ gone }}" => true, -{%- endfor -%} +{% endfor %} ); $uri = filter_var($_SERVER['REQUEST_URI'], FILTER_SANITIZE_URL);
D rss.html

@@ -1,55 +0,0 @@

-<?xml version="1.0" encoding="UTF-8"?> - <rss version="2.0" - xmlns:content="http://purl.org/rss/1.0/modules/content/" - xmlns:dc="http://purl.org/dc/elements/1.1/" - > - -{%- if taxonomy.name -%} -{%- set title = taxonomy.name ~ ' | ' ~ site.title -%} -{%- else -%} -{%- set title = site.title -%} -{%- endif -%} - -<channel> - <title>{{ title }}</title> - <link>{{ site.url }}{{ taxonomy.url }}feed/</link> - <description></description> - <webMaster>{{ site.author.email }} ({{ site.author.name }})</webMaster> - <managingEditor>{{ site.author.email }} ({{ site.author.name }})</managingEditor> - <lastBuildDate>{{ taxonomy.lastmod|date("%a, %d %b %Y %T %z") }}</lastBuildDate> - <copyright>Copyright {{ taxonomy.lastmod|date("%Y") }} {{ site.author.name }}</copyright> -{% if taxonomy.url|length > 0 -%} - <!-- PubSubHubbub Discovery --> - <link rel="hub" href="{{ site.websuburl }}" xmlns="http://www.w3.org/2005/Atom" /> - <link rel="self" href="{{ site.url }}{{ taxonomy.url }}feed/" xmlns="http://www.w3.org/2005/Atom" /> - <!-- End Of PubSubHubbub Discovery --> -{%- endif %} - -{% for post in posts %} - <item> - <title>{% if post.title %}{{ post.title }}{% endif%}</title> - <link>{{ site.url }}/{{ post.slug }}/</link> -{%- if post.summary|length > 0 %} - <description><![CDATA[{{ post.sumhtml }}]]></description> - <content:encoded><![CDATA[{{ post.html }}]]></content:encoded> -{%- else %} - <description><![CDATA[{{ post.html }}]]></description> -{% endif -%} - <author>{{ site.author.email }} ({{ site.author.name }})</author> - <pubDate>{{ post.published|date("%a, %d %b %Y %T %z") }}</pubDate> - <guid>{{ site.url }}/{{ post.slug }}</guid> - <dc:language>{{ post.lang }}</dc:language> -{%- if post.tags %}{% for tname in post.tags %} - <category>{{ tname }}></category> -{% endfor %}{% endif -%} -{%- if post.rssenclosure %} - <enclosure - url="{{ post.rssenclosure.url }}" - type="{{ post.rssenclosure.mime }}" - length="{{ post.rssenclosure.size }}" - /> -{% endif -%} - </item> -{% endfor %} -</channel> -</rss>
D searchresults.html

@@ -1,66 +0,0 @@

-<!DOCTYPE html> -<html> -<head> - <meta charset="UTF-8" /> - <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1" /> - <style media="all"> - {% include 'style.css' %} - </style> - <title>Search results for "{{ term }}"</title> -</head> - -<body> - -<header class="content-header" id="main-header"> - <nav class="content-navigation"> - <ul> - <li> - <a title="back to site" href="/"> - « back to the site - </a> - </li> - </ul> - </nav> - - <form role="search" method="get" class="search-form" action="/search"> - <label for="search" class="hide">Search</label> - <input type="search" class="search-field" placeholder="search..." value="{{ term }}" name="s" id="s" title="Search for:"> - <input type="submit" class="search-submit" value="Go ➡"> - </form> - - <br class="clear" /> -</header> - -<section class="content-body"> - <h1 class="p-name hide">Search results for "{{ term }}"</h1> - {% if posts|length %} - {% for url, post in posts.items() %} - <article class="searchresult"> - <header> - <h2> - <a href="{{ url }}"> - <span class="p-name"> - {% if post.title|length %} - {{ post.title }} - {% else %} - {{ url }} - {% endif %} - </span> - </a> - </h2> - <h3>{{ url }}</h3> - </header> - - <div class="highlight">… {{ post.highlight }} …</div> - {% if post.img and 'None' != post.img %} - <p>{{ post.img }}</p> - {% endif %} - </article> - {% endfor %} - {% else %} - <h2>No results for search term "{{ term }}"</h2> - {% endif %} -</section> - -</body> -</html>
M style-dark.cssstyle-dark.css

@@ -677,26 +677,19 @@ margin-right: 0.3rem;

font-weight: bold; } -.searchresult { - margin-bottom: 3rem; +.search-section { + margin-bottom: 1rem; } -.searchresult h3 { - font-weight: normal; - font-family: mono, monospace; - font-size: 0.9rem; - margin: 0 0 1rem 0; - border: none; +.search-section summary { + border-bottom: 2px solid #999; + padding: 0.3rem 0; + font-weight: bold; } -.searchresult h3:before { - content: "\2937"; +.search-section li { + margin: 1rem 0.6rem; } - -.searchresult .highlight { - font-size: 0.9rem; -} - @media print { * {