Commits

David Larlet  committed 4be6bcb

Store the external link in link's `external` attribute, will be useful if an extension wants to add direct links to source

  • Participants
  • Parent commits fef2dc4

Comments (0)

Files changed (2)

File src/document.py

             if attribute == "src":  # Do not proxy images' URLs
                 element.attrib[attribute] = link
             else:
+                # Store the original external link
+                element.attrib["external"] = link
+
                 # Deal with relative anchors
                 if link.startswith(current_url + "#"):
                     link = u"#{anchor}".format(anchor=link.split("#")[1])

File src/templates/render_results.html

 {% extends "layout.html" %}
 {% block title %}Looking for {{ terms }}{% endblock %}
 {% block body %}
-  <h1 class="backhome"><a href="{{ base_url }}">← <img src="/static/home.png" alt="Home" /></a></h1>
+  <h1 class="backhome"><a href="/">← <img src="/static/home.png" alt="Home" /></a></h1>
   {% for hit in results %}
       <h3 class="result-title"><a href="{{ hit.url|proxify }}">{{ hit.title }}</a> ({{ hit.url|hostname }})</h3>
       {{ hit|highlights("content")|safe }}