diff options
author | luxagraf <sng@luxagraf.net> | 2020-01-27 20:37:10 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2020-01-27 20:37:10 -0500 |
commit | 6e8b62d8c38f6ca366f240ea45ad738ebfd62943 (patch) | |
tree | b8c695cdd5c7f1f7729fa6750ed49c1eb2eae3e8 /design | |
parent | 09abece4982e8dceabe1dd8d678639205a4a6208 (diff) |
abstracted breadcrumbs into seperate template
Diffstat (limited to 'design')
-rw-r--r-- | design/templates/archives/books.html | 58 | ||||
-rw-r--r-- | design/templates/base.html | 1 | ||||
-rw-r--r-- | design/templates/details/book.html | 66 | ||||
-rw-r--r-- | design/templates/details/note.html | 22 | ||||
-rw-r--r-- | design/templates/details/page.html | 42 | ||||
-rw-r--r-- | design/templates/details/page.txt | 8 | ||||
-rw-r--r-- | design/templates/jrnl/entry_detail.html | 240 | ||||
-rw-r--r-- | design/templates/jrnl/entry_detail.txt | 8 | ||||
-rw-r--r-- | design/templates/jrnl/entry_list.html | 40 | ||||
-rw-r--r-- | design/templates/lib/breadcrumbs.html | 14 | ||||
-rw-r--r-- | design/templates/src/post_detail.html | 104 | ||||
-rw-r--r-- | design/templates/src/post_list.html | 36 | ||||
-rw-r--r-- | design/templates/src/topic_list.html | 35 |
13 files changed, 36 insertions, 638 deletions
diff --git a/design/templates/archives/books.html b/design/templates/archives/books.html deleted file mode 100644 index 1862563..0000000 --- a/design/templates/archives/books.html +++ /dev/null @@ -1,58 +0,0 @@ -{% extends 'base.html' %} -{% load typogrify_tags %} -{% load html5_datetime %} -{% load pagination_tags %} -{% block pagetitle %} Books | luxagraf {% endblock %} -{% block metadescription %}Books I've read and thoughts on them. {% endblock %} -{%block bodyid%}class="archive" id="books-archive"{%endblock%} - -{% block primary %} - <ul class="bl" id="breadcrumbs" itemscope itemtype="http://data-vocabulary.org/Breadcrumb"> - <li><a href="/" title="luxagraf homepage" itemprop="url"><span itemprop="title">Home</span></a> → </li> - <li>Books</li> - </ul> - <main>{% autopaginate object_list 24 %} - <h1 class="hide">Books</h1> - <div class="intro"> - <p>I wear glasses because as a child I would stay up late, covers pulled over my head, reading by the dim light of a dying flashlight. At least that's what an eye doctor told me when I was younger. Probably a load of crap, but I still love reading and I still often do it by poor light far later in the night than is reasonable.</p> - <p>I've always taken notes while reading, usually with a pen and paper, but sometimes as highlights in the Kindle. And of course since I have all this stuff in text files I thought might as well put it online. So here you have it, books I've read and things I've thought about them.</p> - </div> - <nav class="pagination">{% paginate %} - </nav> - <div class="archive-grid book-grid"> {% for object in object_list %} - <article class="archive-card" itemscope itemtype="http://schema.org/Book"> - {% if object.image %}<div class="img-wrapper"><a href="{{object.get_absolute_url}}"><img itemprop="image" src="{{object.get_image_url}}" alt="cover art for {{object.title}} by {{object.author_name}}"/></a></div>{%endif%} - <h2 class="post-title" itemprop="name"><a href="{{object.get_absolute_url}}">{{object.title|amp|smartypants|widont|safe}}</a></h2> - <h4 class="author" itemprop="author">{{object.author_name}}</h4> - <div class="post-summary" itemprop="review" itemscope itemtype="http://schema.org/Review"> - {% if object.rating %}<span class="book-stars" itemprop="reviewRating">{% for i in object.ratings_range %}{% if i <= object.get_rating%}★{%else%}☆{%endif%}{%endfor%}</span>{%endif%} - <span class="hide" itemprop="author">Scott Gilbertson</span> - <meta itemprop="datePublished" content="{{object.read_date|date:'F Y'}}"><span class="read-in">Read in: {{object.read_date|date:"F Y"}}</span></div> - </article> - {% endfor %}</div> - <nav aria-label="page navigation" class="pagination">{% paginate %} - </nav> - </main> -{% endblock %} - - - title = models.CharField(max_length=200) - author_name = models.CharField(max_length=200) - slug = models.CharField(max_length=50) - year_pub = models.CharField(max_length=4, blank=True, null=True) - read_date = models.DateTimeField() - isbn = models.CharField(max_length=100, blank=True, null=True) - body_html = models.TextField(null=True, blank=True) - url = models.CharField(max_length=200, blank=True, null=True) - tags = TaggableManager() - RATINGS = ( - ('1', "1 Star"), - ('2', "2 Stars"), - ('3', "3 Stars"), - ('4', "4 Stars"), - ('5', "5 Stars"), - ) - rating = models.CharField(max_length=1, choices=RATINGS, null=True) - enable_comments = models.BooleanField(default=False) - image = models.FileField(upload_to='book-covers/', null=True, blank=True) - diff --git a/design/templates/base.html b/design/templates/base.html index 67edd7a..2bdd7c0 100644 --- a/design/templates/base.html +++ b/design/templates/base.html @@ -41,6 +41,7 @@ </nav> </header> </div> + {% block breadcrumbs %}{% endblock %} {% block primary %}{% endblock %} {% block extrabody %}{% endblock %} {% block disclaimer %}{% endblock%} diff --git a/design/templates/details/book.html b/design/templates/details/book.html deleted file mode 100644 index 8a87ae5..0000000 --- a/design/templates/details/book.html +++ /dev/null @@ -1,66 +0,0 @@ -{% extends 'base.html' %} -{% load typogrify_tags %} -{%block bodyid%}class="detail"{%endblock%} -{% block primary %}<ul class="bl" id="breadcrumbs" itemscope itemtype="http://data-vocabulary.org/Breadcrumb"> - <li><a href="/" title="luxagraf homepage" itemprop="url"><span itemprop="title">Home</span></a> → </li> - <li><a href="/book-notes/" title="books" itemprop="url"><span itemprop="title">books</span></a> → </li> - <li>{{object.title|smartypants|safe}}</li> - </ul> - <main itemprop="mainEntity" itemscope itemtype="http://schema.org/Book"> - <header class="tight"> - <h1 class="post-title book-title" itemprop="name">{{object.title|smartypants|widont|safe}}</h1> - <h2 class="post-subtitle" itemprop="author" itemscope itemtype="http://schema.org/Person"> - <meta itemprop="name" content="{{object.author_name}}"/>by {{object.author_name}}</h2> - - - </header> - <div class="book-cover-wrapper"> - <img src="{{object.get_image_url}}" alt="{{object.title}} cover" /> - </div> - <div class="meta-cover"> - <dl class="book-metadata"> - - {% if object.rating %}<dt>Rating</dt><dd class="book-stars"> - {% for i in object.ratings_range %}{% if i <= object.get_rating%}★{%else%}☆{%endif%}{%endfor%}</span></dd>{%endif%} - {% if object.read_in %}<dt>Read</dt> - <dd>{{object.read_in}}</dd>{%endif%} - {% if object.pages %}<dt>Pages</dt> - <dd itemprop="numberOfPages">{{object.pages}}</dd>{%endif%} - {% if object.publish_date %}<dt>Published</dt> - <dd>{%if object.publish_place%}{{object.publish_place}}, {%endif%}{{object.publish_date}}</dd>{%endif%} - {% if object.isbn %}<dt>ISBN</dt> - <dd>{{object.isbn}}</dd>{%endif%} - </dl> - <div class="buy-btn-wrapper"> - {% if object.isbn %}<a class="buy-btn" href="http://worldcat.org/isbn/{{object.isbn}}" title="find {{object.title}} in your local library">Borrow</a>{%endif%} - {% if object.afflink %}<a class="buy-btn" href="{{object.afflink}}" title="buy {{object.title}} at Amazon">Buy</a>{%endif%} - </div> - </div>{%if object.body_html%} - <div class="thoughts" itemprop="review" itemscope itemtype="http://schema.org/Review"> - <h5>Notes</h5> - <span class="hide" itemprop="reviewRating">{{object.rating}}</span> - <meta itemprop="author" content="Scott Gilbertson" /> - <meta itemprop="datePublished" content="{{object.read_date|date:"c"}}"> - <div itemprop="reviewBody">{{object.body_html|safe|smartypants|widont}}</div> - </div>{%endif%} - {% if object.bookhighlight_set.all %} - <div class="highlights"> - <h4>Highlights:</h4> - {% for object in object.bookhighlight_set.all %} - <div class="h-entry hentry post--article book"> - <a class="highlink" id="h{{forloop.counter}}-page-{{object.page}}" href="#h{{forloop.counter}}-page-{{object.page}}">¶</a> - <div class="book-highlight"> - {{object.body_html|safe|amp|smartypants}} - </div> - <p class="foot">– Page: {{object.page}} {% if object.location %}(Kindle location: {{object.location|cut:"["|cut:"]"}}){%endif%}</p> - </div> - {% endfor %} - </div> - {%endif%} - </main> -{% endblock %} -{% block disclaimer %} -<div class="highlights"> - <p class="dis"><em>When you buy a book using the link above, I may earn a small affiliate commission.</em></p> -</div> -{% endblock %} diff --git a/design/templates/details/note.html b/design/templates/details/note.html index 583d50b..4b52537 100644 --- a/design/templates/details/note.html +++ b/design/templates/details/note.html @@ -13,7 +13,27 @@ <meta name="geo.region" content="{{object.country.iso2}}{%if object.state.code != '' %}-{{object.state.code}}{%endif%}"> {%endblock%} {% block bodyid %}class="notes--permalin detail" id="archive-{% if month %}{{month|month_number_to_name}}{%endif%}{{year}}"{%endblock%} - +{% block breadcrumbs %}<ul class="bl" id="breadcrumbs" itemscope itemtype="http://schema.org/BreadcrumbList"> + <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"> + <a href="/" title="luxagraf homepage" itemprop="item"> + <span itemprop="title">Home</span> + </a> → + <meta itemprop="position" content="1" /> + </li> + <li itemscope itemtype="http://schema.org/ListItem"> + <a href="/field-notes/" itemprop="item"> + <span itemprop="title">Field Notes</span> + </a> → + <meta itemprop="position" content="2" /> + </li> + <li itemscope itemtype="http://schema.org/ListItem"> + <a href="/field-notes/{{object.pub_date|date:"Y"}}/"> + <span itemprop="title">{{object.pub_date|date:"Y"}}</span> + </a> → + <meta itemprop="position" content="3" /> + </li> + <li itemprop="title">Walks</li> + </ul>{% endblock %} {% block primary %}<ul class="bl crumbs" id="breadcrumbs" itemscope itemtype="http://data-vocabulary.org/Breadcrumb"> <li><a href="/" title="luxagraf homepage" itemprop="url"><span itemprop="title">Home</span></a> → </li> diff --git a/design/templates/details/page.html b/design/templates/details/page.html deleted file mode 100644 index bb80a72..0000000 --- a/design/templates/details/page.html +++ /dev/null @@ -1,42 +0,0 @@ -{% extends 'base.html' %} -{% load typogrify_tags %} -{% load comments %} -{% block pagetitle %}Luxagraf | {{object.title}}{% endblock %} -{% block metadescription %}{{object.meta_description}}{% endblock %} -{%block htmlclass%}class="detail"{%endblock%} -{%block bodyid%}id="{{object.title|slugify}}"{%endblock%} - -{% block primary %}<ul class="bl" id="breadcrumbs" itemscope itemtype="http://data-vocabulary.org/Breadcrumb"> - <li><a href="/" title="luxagraf homepage" itemprop="url"><span itemprop="title">Home</span></a> → </li> - {% if object.path%}<li><a href="/{{object.path|slugify}}/">{{object.path}}</a> → </li>{%endif%} - <li>{{object.title}}</li> - </ul> - <main> - <article> - <header class="post-header"> - <h1 class="post-title">{{object.title}}</h1> - {%if object.sub_title %}<h2 class="post-subtitle">{{object.sub_title}}</h2>{%endif%} - </header> - <div class="post-article"> - {{object.body_html|safe|smartypants|widont}} - </div> - </article> - {% if object.enable_comments %} -{% get_comment_count for object as comment_count %} -{%if comment_count > 0 %} -<p class="comments--header">{{comment_count}} Comment{{ comment_count|pluralize }}</p> -{% render_comment_list for object %} -{%endif%} -<div class="comment--form--wrapper {%if comment_count > 0%}comment-form-border{%endif%}"> -{% render_comment_form for object %} -</div> -{%endif%} - </main> -{% endblock %} -{% block js %} -<script src="/media/js/lightbox.js" type="text/javascript"></script> -<script>var opts={captions:true,onload:function(){var im=document.getElementById("jslghtbx-contentwrapper");var link=im.appendChild(document.createElement('a')) -link.href=im.firstChild.src;link.innerHTML="open ";link.target="_blank";link.setAttribute('class','p-link');im.appendChild(link);}};var lightbox=new Lightbox();lightbox.load(opts);</script> -{% endblock %} - - diff --git a/design/templates/details/page.txt b/design/templates/details/page.txt deleted file mode 100644 index 547ce79..0000000 --- a/design/templates/details/page.txt +++ /dev/null @@ -1,8 +0,0 @@ -{{object.title|safe}} -{% for letter in object.title %}={%endfor%} - - by Scott Gilbertson - <{{SITE_URL}}{{object.get_absolute_url}}> - {{object.pub_date|date:"l, d F Y"}} - -{{object.body_markdown|safe}} diff --git a/design/templates/jrnl/entry_detail.html b/design/templates/jrnl/entry_detail.html deleted file mode 100644 index b676ba5..0000000 --- a/design/templates/jrnl/entry_detail.html +++ /dev/null @@ -1,240 +0,0 @@ -{% extends 'base.html' %} -{% load typogrify_tags %} -{% load comments %} - -{% block pagetitle %}{{object.title|title|smartypants|safe}} - by Scott Gilbertson{% endblock %} - -{% block metadescription %}{% autoescape on %}{{object.meta_description|striptags|safe}}{% endautoescape %}{% endblock %} -{%block extrahead%} - <link rel="canonical" href="https://luxagraf.net{{object.get_absolute_url}}" /> - <meta name="ICBM" content="{{object.latitude}}, {{object.longitude}}" /> - <meta name="geo.position" content="{{object.latitude}}; {{object.longitude}}" /> - <meta name="geo.placename" content="{% if object.location.country_name == "United States" %}{{object.location.name|smartypants|safe}}, {{object.state.name}}{%else%}{{object.location.name|smartypants|safe}}, {{object.location.country_name}}{%endif%}"> - <meta name="geo.region" content="{{object.country.iso2}}{%if object.state.code != '' %}-{{object.state.code}}{%endif%}"> - <meta property="og:type" content="article" /> - <meta property="og:title" content="{{object.title|safe}}" /> - <meta property="og:url" content="https://luxagraf.net{{object.get_absolute_url}}" /> - <meta property="og:description" content="{{object.meta_description}}" /> - <meta property="article:published_time" content="{{object.pub_date|date:'c'}}" /> - <meta property="article:author" content="Scott Gilbertson" /> - <meta property="og:site_name" content="Luxagraf" /> - <meta property="og:image" content="{{object.get_featured_image}}" /> - <meta property="og:locale" content="en_US" /> - <meta name="twitter:card" content="summary_large_image"/> - <meta name="twitter:description" content="{{object.meta_description}}"/> - <meta name="twitter:title" content="{{object.title|safe}}"/> - <meta name="twitter:site" content="@luxagraf"/> - <meta name="twitter:domain" content="luxagraf"/> - <meta name="twitter:image:src" content="{{object.get_featured_image}}"/> - <meta name="twitter:creator" content="@luxagraf"/> -<script type="application/ld+json"> -{ - "@context": "https://schema.org", - "@type": "Article", - "mainEntityOfPage": { - "@type": "WebPage", - "@id": "https://luxagraf.net{{object.get_absolute_url}}" - }, - "headline": "{{object.title}}", - "datePublished": "{{object.pub_date|date:'c'}}+04:00", - "dateModified": "{{object.pub_date|date:'c'}}+04:00", - "author": { - "@type": "Person", - "name": "Scott Gilbertson" - }, - "publisher": { - "@type": "Organization", - "name": "Luxagraf", - "logo": { - "@type": "ImageObject", - "url": "https://luxagraf.net/media/img/logo-white.jpg" - } - }, - "description": "{{object.meta_description}}" -} -</script> -{%endblock%} -{%block htmlclass%}{% with object.template_name as t %} -class="detail {%if t == 1 or t == 3 or t == 5 %}double{%else%}single{%endif%}{%if t == 2 or t == 3 %} dark{%endif%}{%if t == 4 or t == 5 %} black{%endif%}"{%endwith%}{%endblock%} - - -{% block primary %} - <main> - <article class="h-entry hentry entry-content content{% with object.get_template_name_display as t %}{%if t == "double" or t == "double-dark" %} post--article--double{%endif%}{%endwith%}" itemscope itemType="http://schema.org/BlogPosting"> - <header id="header" class="post-header {% with object.get_template_name_display as t %}{%if t == "double" or t == "double-dark" %}post--header--double{%endif%}{%endwith%}"> - <h1 class="p-name entry-title post-title" itemprop="headline">{%if object.template_name == 1 or object.template_name == 3 %}{{object.title|smartypants|safe}}{%else%}{{object.title|smartypants|safe}}{%endif%}</h1> - {% if object.subtitle %}<h2 class="post-subtitle">{{object.subtitle|smartypants|safe}}</h2>{%endif%} - <div class="post-linewrapper"> - {% if object.location %}<div class="p-location h-adr adr post-location" itemprop="contentLocation" itemscope itemtype="http://schema.org/Place"> - <h3 class="h-adr" itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">{% if object.location.country_name == "United States" %}<span class="p-locality locality" itemprop="addressLocality">{{object.location.name|smartypants|safe}}</span>, <a class="p-region region" href="/jrnl/united-states/" title="travel writing from the United States">{{object.location.state_name|safe}}</a>, <span class="p-country-name" itemprop="addressCountry">U.S.</span>{%else%}<span class="p-region" itemprop="addressRegion">{{object.location.name|smartypants|safe}}</span>, <a class="p-country-name country-name" href="/jrnl/{{object.location.country_slug}}/" title="travel writing from {{object.location.country_name}}"><span itemprop="addressCountry">{{object.location.country_name|safe}}</span></a>{%endif%}</h3> - – <a href="" onclick="showMap({{object.latitude}}, {{object.longitude}}, { type:'point', lat:'{{object.latitude}}', lon:'{{object.longitude}}'}); return false;" title="see a map">Map</a> - </div>{%endif%} - <time class="dt-published published dt-updated post-date" datetime="{{object.pub_date|date:'c'}}" itemprop="datePublished">{{object.pub_date|date:"F"}} <span>{{object.pub_date|date:"j, Y"}}</span></time> - <span class="hide" itemprop="author" itemscope itemtype="http://schema.org/Person">by <a class="p-author h-card" href="/about"><span itemprop="name">Scott Gilbertson</span></a></span> - </div> - </header> - <div id="article" class="e-content entry-content post--body post--body--{% with object.template_name as t %}{%if t == 0 or t == 2 %}single{%endif%}{%if t == 1 or t == 3 %}double{%endif%}{%endwith%}" itemprop="articleBody"> - {{object.body_html|safe|smartypants}} - </div> - {%if wildlife or object.field_notes.all or object.books.all %}<div class="entry-footer">{%if wildlife %} - <aside id="wildlife"> - <h3>Fauna and Flora</h3> - {% regroup wildlife by ap.apclass.get_kind_display as wildlife_list %} - <ul> - {% for object_list in wildlife_list %} - <li class="grouper">{{object_list.grouper}}<ul> - {% for object in object_list.list %} - <li>{%if object.ap.body_markdown%}<a href="{% url 'sightings:detail' object.ap.slug %}">{{object}}</a>{%else%}{{object}}{%endif%} </li> - {% endfor %}</ul> - {% endfor %}</ul> - </aside> - {% endif %}{%if object.field_notes.all %} - <aside {% if wildlife %}class="margin-left-none" {%endif%}id="field_notes"> - <h3>Field Notes</h3> - <ul>{% for obj in object.field_notes.all %} - <li><a href="{% url 'fieldnotes:detail' year=obj.pub_date.year month=obj.pub_date|date:"m" slug=obj.slug %}">{{obj}}</a></li> - {% endfor %}</ul> - </aside>{% endif %} - {%if object.books.all %} - <aside id="recommended-reading" {%if object.field_notes.all and wildlife %}class="rr-clear{%endif%}" > - <h3>Recommended Reading</h3> - <ul>{% for obj in object.books.all %} - <li><a href="{% url 'books:detail' slug=obj.slug %}"><img src="{{obj.get_small_image_url}}" /></a></li> - {% endfor %}</ul> - </aside>{% endif %} - </div>{%endif%} - </article> - {% with object.get_next_published as next %} - {% with object.get_previous_published as prev %} - <div class="nav-wrapper"> - <nav id="page-navigation" {%if wildlife or object.field_notes.all or object.books.all %}{%else%}class="page-border-top"{%endif%}> - <ul>{% if prev%} - <li id="prev"><span class="bl">Previous:</span> - <a href="{{ prev.get_absolute_url }}" rel="prev" title=" {{prev.title}}">{{prev.title|safe}}</a> - </li>{%endif%}{% if next%} - <li id="next"><span class="bl">Next:</span> - <a href="{{ next.get_absolute_url }}" rel="next" title=" {{next.title}}">{{next.title|safe}}</a> - </li>{%endif%} - </ul> - </nav>{%endwith%}{%endwith%} - </div> - {% if object.related.all %}<div class="article-afterward related"> - <div class="related-bottom"> - <h6 class="hedtinycaps">You might also enjoy</h6> - <ul class="article-card-list">{% for object in related %} - <li class="article-card-mini"><a href="{{object.get_absolute_url}}" title="{{object.title}}"> - <div class="post-image post-mini-image"> - {% if object.featured_image %} - {% include "lib/img_archive.html" with image=object.featured_image nolightbox=True %} - {% elif object.image %} - {% include "lib/img_archive.html" with image=object.image nolightbox=True %} - {% else %} - <img src="{{object.get_image_url}}" alt="{{ object.title }}" class="u-photo post-image" itemprop="image" />{%endif%} - </div> - <h4 class="p-name entry-title post-title" itemprop="headline">{% if object.title %}{{object.title|safe|smartypants|widont}}{% else %}{{object.common_name}}{%endif%}</h4> - <p class="p-author author hide" itemprop="author"><span class="byline-author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Scott Gilbertson</span></span></p> - <p class="post-summary"> - <span class="p-location h-adr adr post-location" itemprop="contentLocation" itemscope itemtype="http://schema.org/Place"> - {% if object.location.country_name == "United States" %}{{object.location.state_name}}{%else%}{{object.location.country_name}}{%endif%} - </span> - – - <time class="dt-published published dt-updated post-date" datetime="{{object.pub_date|date:'c'}}"><span>{{object.pub_date|date:" Y"}}</span></time> - </p> - </a> - </li> - {% endfor %}</ul> - </div> - </div>{%endif%} - - {% comment %} <div class="mailing-list--wrapper"> - <h5>If you enjoyed this, you should join the mailing list…</h5> - {% include 'mailing_list.html' %} - </div> {% endcomment %} - {% if object.enable_comments %} -{% get_comment_count for object as comment_count %} -{%if comment_count > 0 %} -<p class="comments--header">{{comment_count}} Comment{{ comment_count|pluralize }}</p> -{% render_comment_list for object %} -{%endif%} -<div class="comment--form--wrapper {%if comment_count > 0%}comment-form-border{%endif%}"> -{% render_comment_form for object %} -</div> -{% else %} -<p class="comments--header" style="text-align: center">Sorry, comments have been disabled for this post.</p> -{%endif%} -</main> -{% endblock %} -{% block js %} -<script> -document.addEventListener("DOMContentLoaded", function(event) { - var leaflet = document.createElement('script'); - leaflet.src = "/media/js/leaflet-master/leaflet-mod.js"; - document.body.appendChild(leaflet); - var lightbox = document.createElement('script'); - lightbox.src = "/media/js/lightbox.js"; - document.body.appendChild(lightbox); - leaflet.onload = function(){ - var detail = document.createElement('script'); - detail.src = "/media/js/detail.min.js"; - document.body.appendChild(detail); - {% with object.get_template_name_display as t %}{%if t == "single" or t == "single-dark" %} - detail.onload = function(){ - createMap(); - var open = false; - } - {%endif%}{%endwith%} - } - - lightbox.onload = function() { - var opts= { - //nextOnClick: false, - captions: true, - onload: function(){ - var im = document.getElementById("jslghtbx-contentwrapper"); - var link = im.appendChild(document.createElement('a')) - link.href = im.firstChild.src; - link.innerHTML= "open "; - link.target = "_blank"; - link.setAttribute('class', 'p-link'); - im.appendChild(link); - } - }; - var lightbox = new Lightbox(); - lightbox.load(opts); - } - {% if object.enable_comments %} -{% get_comment_count for object as comment_count %} -{%if comment_count > 0 %} - //delay loading of gravatar images using noscript data-hash attribute - dataattr = document.getElementsByClassName("datahashloader"); - for(var i=0; i<dataattr.length; i++) { - var c = dataattr[i].parentNode; - var img = document.createElement("img"); - img.src = 'https://images.luxagraf.net/gravcache/' + dataattr[i].getAttribute('data-hash') + '.jpg'; - img.className += "gravatar"; - img.alt = "gravatar icon"; - c.insertBefore(img, c.childNodes[3]); - } -{%endif%} -{%endif%} -{% if object.has_video %} -var tester = document.getElementsByClassName("vidauto"); -var wrapper = document.getElementById('wrapper'); -var dist = 100; - -window.onscroll = function() { - for (var i=0; i<tester.length; i++) { - checkVisible(tester[i]) ? tester[i].play() : tester[i].pause(); - } -}; - -function checkVisible(elm) { - var rect = elm.getBoundingClientRect(); - var viewHeight = Math.max(document.documentElement.clientHeight, window.innerHeight); - return !(rect.bottom < 0 || rect.top - viewHeight >= 0); -} -{%endif%} - -}); -</script> -{%endblock%} diff --git a/design/templates/jrnl/entry_detail.txt b/design/templates/jrnl/entry_detail.txt deleted file mode 100644 index 547ce79..0000000 --- a/design/templates/jrnl/entry_detail.txt +++ /dev/null @@ -1,8 +0,0 @@ -{{object.title|safe}} -{% for letter in object.title %}={%endfor%} - - by Scott Gilbertson - <{{SITE_URL}}{{object.get_absolute_url}}> - {{object.pub_date|date:"l, d F Y"}} - -{{object.body_markdown|safe}} diff --git a/design/templates/jrnl/entry_list.html b/design/templates/jrnl/entry_list.html deleted file mode 100644 index 5aef750..0000000 --- a/design/templates/jrnl/entry_list.html +++ /dev/null @@ -1,40 +0,0 @@ -{% extends 'base.html' %} -{% load typogrify_tags %} -{% load pagination_tags %} -{% block pagetitle %}Luxagraf | {% if region %}Travel Writing from {{region.name|title|smartypants|safe}}{%else%}Travel Writing from Around the World {%endif%}{% if page != "1" %} -- Page {{page}}{%endif%}{% endblock %} -{% block metadescription %}{% if region %}Travel writing, essays and dispatches from {{region.name|title|smartypants|safe}}{%else%}Travel writing, essays and dispatches from around the world{%endif%} Page {{page}}{% endblock %} -{%block bodyid%}id="writing" class="archive"{%endblock%} - - -{% block primary %}<ul class="bl" id="breadcrumbs" itemscope itemtype="http://data-vocabulary.org/Breadcrumb"> - <li><a href="/" title="luxagraf homepage" itemprop="url"><span itemprop="title">Home</span></a> → </li> - {% if region %}{%if region.name == 'United States'%} <li><a href="/jrnl/" title="See all Journal Entries" itemprop="url"><span itemprop="title">Jrnl</span></a> →</li> - <li itemprop="title">the United States</li>{%else%}<li><a href="/jrnl/" title="See all Journal Entries" itemprop="url"><span>Jrnl</span></a> →</li> - <li>{{region.name|title|smartypants|safe}}</li>{%endif%}{%else%}<li>Jrnl</li>{%endif%} - </ul> - <main class="archive-grid"> - <h1 class="hide">{% if region %}Journal entries from {%if region.name == 'United States'%}the United States{%else%}{{region.name|title|smartypants|safe}}{%endif%}{%else%}Journal {%endif%}</h1>{% autopaginate object_list 24 %} {% for object in object_list %} - <article class="h-entry hentry archive-card {% cycle 'odd' 'even' %} {% cycle 'first' 'second' 'third' %}" itemscope itemType="http://schema.org/Article"> - <div class="post-image"> - <a href="{{object.get_absolute_url}}" title="{{object.title}}">{% if object.featured_image %} - {% include "lib/img_archive.html" with image=object.featured_image %} - {%else%} - <img src="{{object.get_image_url}}" alt="{{ object.title }}" class="u-photo post-image" itemprop="image" />{%endif%}</a> - </div> - <h2 class="p-name entry-title post-title" itemprop="headline"><a href="{{object.get_absolute_url}}" class="u-url" title="{%if object.title_keywords%}{{object.title_keywords}}{%else%}{{object.title}}{%endif%}">{{object.title|safe|smartypants|widont}}</a></h2> - <p class="p-author author hide" itemprop="author"><span class="byline-author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Scott Gilbertson</span></span></p> - <time class="dt-published published dt-updated post-date" datetime="{{object.pub_date|date:'c'}}">{{object.pub_date|date:"F"}} <span>{{object.pub_date|date:"j, Y"}}</span></time> - <p class="post-summary"> - <span class="p-location h-adr adr post-location" itemprop="contentLocation" itemscope itemtype="http://schema.org/Place"> - {% if object.location.country_name == "United States" %}<span class="p-locality locality">{{object.location.name|smartypants|safe}}</span>, <a class="p-region region" href="/jrnl/united-states/" title="travel writing from the United States">{{object.location.state_name}}</a>, <span class="p-country-name">U.S.</span>{%else%}<span class="p-region">{{object.location.name|smartypants|safe}}</span>, <a class="p-country-name country-name" href="/jrnl/{{object.location.country_slug}}/" title="travel writing from {{object.location.country_name}}">{{object.location.country_name}}</a>{%endif%} - </span> – - <span class="p-summary" itemprop="description"> - {{object.dek|safe}} - </span> - </p> - </article> {% endfor %} - </main> - <nav aria-label="page navigation" class="pagination"> - {% paginate %} - </nav> -{% endblock %} diff --git a/design/templates/lib/breadcrumbs.html b/design/templates/lib/breadcrumbs.html new file mode 100644 index 0000000..ac47d5a --- /dev/null +++ b/design/templates/lib/breadcrumbs.html @@ -0,0 +1,14 @@ +<ol class="bl" id="breadcrumbs" itemscope itemtype="http://schema.org/BreadcrumbList"> + <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a itemprop="item" href="/"><span itemprop="name">Home</span></a> → + <meta itemprop="position" content="1" /> + </li> + {% for crumb in breadcrumbs %}<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"> + {% if crumb_url %} + <a href="{{crumb_url}}" itemprop="item"><span itemprop="name">{{crumb}}</span></a> + <meta itemprop="position" content="{{ forloop.counter|add:"+1" }}" />{% else %} + <span itemprop="item"> + <span itemprop="name">{{crumb}}</span> + </span>{% endif %} + <meta itemprop="position" content="2" /> + </li>{%endfor%} + </ol> diff --git a/design/templates/src/post_detail.html b/design/templates/src/post_detail.html deleted file mode 100644 index fb1bde0..0000000 --- a/design/templates/src/post_detail.html +++ /dev/null @@ -1,104 +0,0 @@ -{% extends 'base.html' %} -{% load typogrify_tags %} -{% load comments %} -{% block pagetitle %}{{object.title|striptags}} - by Scott Gilbertson{% endblock %} -{% block metadescription %}{% autoescape on %}{{object.meta_description|striptags|safe}}{% endautoescape %}{% endblock %} -{%block extrahead%} - <meta property="og:type" content="article" /> - <meta property="og:site_name" content="luxagraf:src"/> - <meta property="og:title" content="{{object.title|safe}}" /> - <meta property="og:url" content="https://luxagraf.net{{object.get_absolute_url}}" /> - <meta property="og:image" content=""> - <meta property="og:description" content="{{object.meta_description}}" /> - <meta property="article:published_time" content="{{object.pub_date|date:'c'}}" /> - <meta property="article:author" content="Luxagraf" /> - <meta property="og:site_name" content="Luxagraf:src" /> - <meta property="og:locale" content="en_US" /> - <meta name="twitter:card" content="summary_large_image"/> - <meta name="twitter:site" content="@luxagraf"/> - <meta name="twitter:creator" content="@luxagraf"/> - -<link rel="stylesheet" href="/media/src/solarized.css" type="text/css" media="screen"/> -{%endblock%} - -{% block bodyid %}class="src detail single"{% endblock %} -{%block sitesubtitle %}Code Slowly{% endblock%} - -{% block primary %}<ul class="bl" id="breadcrumbs" itemscope itemtype="http://data-vocabulary.org/Breadcrumb"> - <li><a href="/" title="luxagraf homepage" itemprop="url"><span itemprop="title">Home</span></a> → </li> - <li><a href="/src/"><code>src</code></a></li> - </ul> - <main role="main"> - <article class="hentry post-article{% with object.get_template_name_display as t %}{%if t == "double" or t == "double-dark" %} post--article--double{%endif%}{%endwith%}" itemscope itemType="http://schema.org/Article"> - <header id="header" class="post-header {% with object.get_template_name_display as t %}{%if t == "double" or t == "double-dark" %}post--header--double{%endif%}{%endwith%}"> - <h1 class="p-name entry-title post--title" itemprop="headline">{%if object.template_name == 1 or object.template_name == 3 %}{{object.title|safe|smartypants}}{%else%}{{object.title|safe|smartypants|widont}}{%endif%}</h1> - <h2 class="post-subtitle">{{object.meta_description|smartypants|safe}}</h2> - <div class="post-linewrapper"> - {% if object.originally_published_by %}<h4 class="post-source">Originally Published By: <a href="{{object.originally_published_by_url}}" title="View {{object.title}} on {{object.originally_published_by}}">{{object.originally_published_by}}</a></h4>{%endif%} - {% if object.topics.all %}<h4 class="post-source">Topics: {% for topic in object.topics.all%} <a href="/src/topic/{{topic.slug}}">{{topic.name}}</a>{%if forloop.last%}{%else%}, {%endif%}{%endfor%}</h4>{%endif%} - <time class="dt-published published dt-updated post-date" datetime="{{object.pub_date|date:'c'}}" itemprop="datePublished">{{object.pub_date|date:"F"}} <span>{{object.pub_date|date:"j, Y"}}</span></time> - <span class="hide" itemprop="author" itemscope itemtype="http://schema.org/Person">by <a class="p-author h-card" href="/about"><span itemprop="name">Scott Gilbertson</span></a></span> - </div> - </header> - - - <div id="article" class="e-content entry-content post-body post-body-{% with object.template_name as t %}{%if t == 0 or t == 2 %}single{%endif%}{%if t == 1 or t == 3 %}double{%endif%}{%endwith%}" itemprop="articleBody"> - {{object.body_html|safe|smartypants|widont}} - </div> - </article> - {% if object.slug != 'about' %} - {% with object.get_next_published as next %} - {% with object.get_previous_published as prev %} - <nav id="page-navigation"> - <ul>{% if prev%} - <li id="prev"><span class="bl">Previous:</span> - <a href="{{ prev.get_absolute_url }}" rel="prev" title=" {{prev.title}}">{{prev.title|safe}}</a> - </li>{%endif%}{% if next%} - <li id="next"><span class="bl">Next:</span> - <a href="{{ next.get_absolute_url }}" rel="next" title=" {{next.title}}">{{next.title|safe}}</a> - </li>{%endif%} - </ul> - </nav>{%endwith%}{%endwith%} - {%endif%} - </main> - {% if object.slug != 'about' %} - {% if object.enable_comments %} -{% get_comment_count for object as comment_count %} -{%if comment_count > 0 %} -<p class="comments--header">{{comment_count}} Comment{{ comment_count|pluralize }}</p> -{% render_comment_list for object %} -{%endif%} -<div class="comment--form--wrapper {%if comment_count > 0%}comment-form-border{%endif%}"> -{% render_comment_form for object %} -</div> -{% else %} -<p class="comments--header" style="text-align: center">Sorry, comments have been disabled for this post.</p> -{%endif%} -{%endif%} -{% endblock %} -{% block js %} -<script type="text/javascript"> -window.onload = function() { - {% if object.enable_comments %} -{% get_comment_count for object as comment_count %} -{%if comment_count > 0 %} - //delay loading of gravatar images using noscript data-hash attribute - dataattr = document.getElementsByClassName("datahashloader"); - for(var i=0; i<dataattr.length; i++) { - var c = dataattr[i].parentNode; - var img = document.createElement("img"); - img.src = 'https://images.luxagraf.net/gravcache/' + dataattr[i].getAttribute('data-hash') + '.jpg'; - img.className += "gravatar"; - c.insertBefore(img, c.childNodes[3]); - } -{%endif%} -{%endif%} - {% with object.get_template_name_display as t %}{%if t == "single" or t == "single-dark" %} - createMap(); - var open = false; - {%endif%}{%endwith%} -} -</script> -{% if object.has_code %} -{%endif %} -{% endblock %} diff --git a/design/templates/src/post_list.html b/design/templates/src/post_list.html deleted file mode 100644 index af65ea7..0000000 --- a/design/templates/src/post_list.html +++ /dev/null @@ -1,36 +0,0 @@ -{% extends 'base.html' %} -{% load typogrify_tags %} -{% load comments %} - -{% block pagetitle %}Tutorials and tools for building great things{% endblock %} -{% block metadescription %}Tutorials and tools for building great things on the web - by Scott Gilbertson.{% endblock %} - -{%block sitesubtitle %}Code Slowly{% endblock%} -{% block primary %}<ul class="bl" id="breadcrumbs" itemscope itemtype="http://data-vocabulary.org/Breadcrumb"> - <li><a href="/" title="luxagraf homepage" itemprop="url"><span itemprop="title">Home</span></a> → </li>{% if topic %} - <li><a href="/src/" title="luxagraf:src homepage" itemprop="url"><span itemprop="title"><code>src</code></span></a> → </li> - <li>{{topic}}</li>{%else%} - <li><code>src</code></li>{%endif%} - </ul> - <main role="main" id="essay-archive" class="essay-archive archive-list"> - <div class="essay-intro"> - <h2>Tutorials and tools for building great things on the web.</h2> - <p>The indie web is an amazing democratic publishing platform unlike anything in history. The catch is, to avoid serving at the pleasure of the corporate king, you need to know <em>how</em> to publish. That's what these articles are here for, to help you learn how to use independent, community supported open source tools. The web won't last forever, let's build something cool while we can.</p> - <p>Topics include HTML, CSS, Django, Linux, Nginx, Python, Postgresql, free software, and, once, the evil that is Google AMP.</p> - <p>A few of the articles below were previously published in: <em><a href="https://arstechnica.com/">Ars Technica</a></em>, <em><a href="https://www.wired.com/author/scott-gilbertson/">Wired</a></em>, and <em><a href="https://www.theregister.co.uk/Author/Scott-Gilbertson/">The Register</a></em></p> - </div> - <h1 class="topic-hed">Articles</h1> - <ul class="fancy-archive-list">{% for object in object_list %}{% if object.slug != 'about' %} - <li class="h-entry hentry" itemscope itemType="http://schema.org/Article"> - <span class="date dt-published">{{object.pub_date|date:"F Y"}}</span> - <a href="{{object.get_absolute_url}}"> - <h2>{{object.title|safe|smartypants|widont}}</h2> - <p class="p-summary">{{object.meta_description|safe|smartypants|widont}}</p> - </a> - </li> - {%endif%}{%endfor%}</ul> - - - - </main> -{%endblock%} diff --git a/design/templates/src/topic_list.html b/design/templates/src/topic_list.html deleted file mode 100644 index 7149823..0000000 --- a/design/templates/src/topic_list.html +++ /dev/null @@ -1,35 +0,0 @@ -{% extends 'base.html' %} -{% load typogrify_tags %} -{% load comments %} - -{% block pagetitle %}Tutorials and tools for building great things{% endblock %} - -{% block metadescription %}Tutorials about {{topic}} - by Scott Gilbertson.{% endblock %} -{%block sitesubtitle %}Code Slowly{% endblock%} -{% block primary %}<ul class="bl" id="breadcrumbs" itemscope itemtype="http://data-vocabulary.org/Breadcrumb"> - <li><a href="/" title="luxagraf homepage" itemprop="url"><span itemprop="title">Home</span></a> → </li>{% if topic %} - <li><a href="/src/" title="luxagraf:src homepage" itemprop="url"><span itemprop="title"><code>src</code></span></a> → </li> - <li>{{topic}}</li>{%else%} - <li><code>src</code></li>{%endif%} - </ul> - <main role="main" id="essay-archive" class="essay-archive archive-list"> - <div class="essay-intro"> - <h2>Tutorials and tools for building great things on the web.</h2> - <p>The indie web is an amazing democratic publishing platform unlike anything in history. The catch is, to avoid serving at the pleasure of the corporate king, you need to know <em>how</em> to publish. That's what these articles are here for, to help you learn how to use independent, community supported open source tools. The web won't last forever, let's build something cool while we can.</p> - <p>A few of the articles below were previously published in: <em><a href="https://arstechnica.com/">Ars Technica</a></em>, <em><a href="https://www.wired.com/author/scott-gilbertson/">Wired</a></em>, and <em><a href="https://www.theregister.co.uk/Author/Scott-Gilbertson/">The Register</a></em></p> - </div> - <h1 class="topic-hed">Tutorials about {{topic}}</h1> - <ul class="fancy-archive-list">{% for object in object_list %}{% if object.slug != 'about' %} - <li class="h-entry hentry" itemscope itemType="http://schema.org/Article"> - <span class="date dt-published">{{object.pub_date|date:"F Y"}}</span> - <a href="{{object.get_absolute_url}}"> - <h2>{{object.title|safe|smartypants|widont}}</h2> - <p class="p-summary">{{object.meta_description|safe|smartypants|widont}}</p> - </a> - </li> - {%endif%}{%endfor%}</ul> - - - - </main> -{%endblock%} |