From a04e0da2b8907d2aed6e98919a68f7ae2cb35eec Mon Sep 17 00:00:00 2001 From: luxagraf Date: Thu, 7 Mar 2019 11:41:22 -0600 Subject: added src to main site --- app/src/views.py | 14 ++-- design/sass/_header.scss | 11 +++- design/templates/archives/src_home.html | 35 ---------- design/templates/base.html | 9 +-- design/templates/details/src_entry.html | 100 ----------------------------- design/templates/essays/essay_detail.html | 4 +- design/templates/src/post_detail.html | 102 ++++++++++++++++++++++++++++++ design/templates/src/post_list.html | 36 +++++++++++ design/templates/src/topic_list.html | 35 ++++++++++ 9 files changed, 198 insertions(+), 148 deletions(-) delete mode 100644 design/templates/archives/src_home.html delete mode 100644 design/templates/details/src_entry.html create mode 100644 design/templates/src/post_detail.html create mode 100644 design/templates/src/post_list.html create mode 100644 design/templates/src/topic_list.html diff --git a/app/src/views.py b/app/src/views.py index 876f99e..f501637 100644 --- a/app/src/views.py +++ b/app/src/views.py @@ -45,15 +45,19 @@ class BookDetailView(DetailView): class SrcListView(ListView): - template_name = "archives/src_home.html" - def queryset(self): + def get_queryset(self): return Post.objects.filter(status__exact=1) + def get_context_data(self, **kwargs): + # Call the base implementation first to get a context + context = super(SrcListView, self).get_context_data(**kwargs) + context['topics'] = Topic.objects.all() + return context + class EntryDetailView(DetailView): model = Post - template_name = "details/src_entry.html" slug_field = "slug" @@ -62,9 +66,9 @@ class EntryDetailViewTXT(EntryDetailView): class TopicListView(ListView): - template_name = 'archives/src_home.html' + template_name = 'src/topic_list.html' - def queryset(self): + def get_queryset(self): return Post.objects.filter(topics__slug=self.kwargs['slug']) def get_context_data(self, **kwargs): diff --git a/design/sass/_header.scss b/design/sass/_header.scss index a4f0386..d578e21 100644 --- a/design/sass/_header.scss +++ b/design/sass/_header.scss @@ -142,7 +142,7 @@ nav[role="navigation"] { @extend %clearfix; margin-bottom: 1em; @include breakpoint(beta) { - border-bottom: 1px #e4e4e4 solid; + border-bottom: 1px #f3efef solid; position: relative; } @include breakpoint(gamma) { @@ -159,6 +159,15 @@ nav[role="navigation"] { max-width: $max_width; } } +.detail .header-wrapper, .detail #breadcrumbs { + transition: opacity .5s; + @include breakpoint(epsilon) { + opacity: .8; + &:hover { + opacity: 1; + } + } +} .black .header-wrapper, .dark .header-wrapper { @include breakpoint(beta) { diff --git a/design/templates/archives/src_home.html b/design/templates/archives/src_home.html deleted file mode 100644 index 173596d..0000000 --- a/design/templates/archives/src_home.html +++ /dev/null @@ -1,35 +0,0 @@ -{% extends 'src_base.html' %} -{% load typogrify_tags %} -{% load comments %} - -{% block pagetitle %}luxagraf:src - archive{% endblock %} - -{% block metadescription %}luxagraf:src - thoughts on code, the web, servers, tools and things that might be useful to a couple of people somewhere in the future.{% endblock %} -{% block primary %} -
-
-

Tutorials and how-tos for web developers.

-

Topics include Linux, Nginx, Python, Postgresql, free software, HTML, and once, Google AMP.

-

These tutorials are most often things I needed to do, and then I needed to do them again, but didnt remembered how. If you want to commit something to memory, write it down. Write it on the web and not only does your memory improve, but you have a URL you can consult later as well.

-

A few of the articles below were previously published in: Ars Technica, Wired, and The Register

-
-

Articles

- - - - -
-{%endblock%} diff --git a/design/templates/base.html b/design/templates/base.html index 3777d6c..355a100 100644 --- a/design/templates/base.html +++ b/design/templates/base.html @@ -33,17 +33,18 @@

-

Walk Slowly

+

{%block sitesubtitle %}Walk Slowly{% endblock%}

diff --git a/design/templates/details/src_entry.html b/design/templates/details/src_entry.html deleted file mode 100644 index 91532dc..0000000 --- a/design/templates/details/src_entry.html +++ /dev/null @@ -1,100 +0,0 @@ -{% extends 'src_base.html' %} -{% load typogrify_tags %} -{% load comments %} - -{% block pagetitle %}{{object.title|striptags}} | luxagraf:src{% endblock %} - -{% block bodyid %}class="src detail single"{% endblock %} -{% block metadescription %}{% autoescape on %}{{object.meta_description|striptags|safe}}{% endautoescape %}{% endblock %} -{%block extrahead%} - - - - - - - - - - - - - - - -{%endblock%} -{% block primary %} -
-
-
-

{%if object.template_name == 1 or object.template_name == 3 %}{{object.title|safe|smartypants}}{%else%}{{object.title|safe|smartypants|widont}}{%endif%}

-

{{object.meta_description|smartypants|safe}}

- -
- - -
- {{object.body_html|safe|smartypants|widont}} -
-
- {% if object.slug != 'about' %} - {% with object.get_next_published as next %} - {% with object.get_previous_published as prev %} - {%endwith%}{%endwith%} - {%endif%} -
- {% if object.slug != 'about' %} - {% if object.enable_comments %} -{% get_comment_count for object as comment_count %} -{%if comment_count > 0 %} -

{{comment_count}} Comment{{ comment_count|pluralize }}

-{% render_comment_list for object %} -{%endif%} -{% render_comment_form for object %} -{% else %} -

Sorry, comments have been disabled for this post.

-{%endif%} -{%endif%} -{% endblock %} -{% block js %} - -{% if object.has_code %} -{%endif %} -{% endblock %} diff --git a/design/templates/essays/essay_detail.html b/design/templates/essays/essay_detail.html index bdf502c..436004a 100644 --- a/design/templates/essays/essay_detail.html +++ b/design/templates/essays/essay_detail.html @@ -1,7 +1,7 @@ {% extends 'base.html' %} {% load typogrify_tags %} {% load comments %} - +{%block htmlclass%}class="detail single"{%endblock%} {% block pagetitle %}{{object.title|title|smartypants|safe}} - by Scott Gilbertson{% endblock %} {% block metadescription %}{% autoescape on %}{{object.meta_description|striptags|safe}}{% endautoescape %}{% endblock %} @@ -27,8 +27,6 @@ {%endif%} {%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 bodyid %}{% if object.get_post_type_display == 'tools' %}class="src"{% endif %}{%endblock%} diff --git a/design/templates/src/post_detail.html b/design/templates/src/post_detail.html new file mode 100644 index 0000000..0b80635 --- /dev/null +++ b/design/templates/src/post_detail.html @@ -0,0 +1,102 @@ +{% 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%} + + + + + + + + + + + + + + + +{%endblock%} + +{% block bodyid %}class="src detail single"{% endblock %} +{%block sitesubtitle %}Code Slowly{% endblock%} + +{% block primary %} +
+
+
+

{%if object.template_name == 1 or object.template_name == 3 %}{{object.title|safe|smartypants}}{%else%}{{object.title|safe|smartypants|widont}}{%endif%}

+

{{object.meta_description|smartypants|safe}}

+
+ {% if object.originally_published_by %}

Originally Published By: {{object.originally_published_by}}

{%endif%} + {% if object.topics.all %}

Topics: {% for topic in object.topics.all%} {{topic.name}}{%if forloop.last%}{%else%}, {%endif%}{%endfor%}

{%endif%} + + +
+
+ + +
+ {{object.body_html|safe|smartypants|widont}} +
+
+ {% if object.slug != 'about' %} + {% with object.get_next_published as next %} + {% with object.get_previous_published as prev %} + {%endwith%}{%endwith%} + {%endif%} +
+ {% if object.slug != 'about' %} + {% if object.enable_comments %} +{% get_comment_count for object as comment_count %} +{%if comment_count > 0 %} +

{{comment_count}} Comment{{ comment_count|pluralize }}

+{% render_comment_list for object %} +{%endif%} +{% render_comment_form for object %} +{% else %} +

Sorry, comments have been disabled for this post.

+{%endif%} +{%endif%} +{% endblock %} +{% block js %} + +{% if object.has_code %} +{%endif %} +{% endblock %} diff --git a/design/templates/src/post_list.html b/design/templates/src/post_list.html new file mode 100644 index 0000000..af65ea7 --- /dev/null +++ b/design/templates/src/post_list.html @@ -0,0 +1,36 @@ +{% 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 %} +
+
+

Tutorials and tools for building great things on the web.

+

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 how 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.

+

Topics include HTML, CSS, Django, Linux, Nginx, Python, Postgresql, free software, and, once, the evil that is Google AMP.

+

A few of the articles below were previously published in: Ars Technica, Wired, and The Register

+
+

Articles

+ + + + +
+{%endblock%} diff --git a/design/templates/src/topic_list.html b/design/templates/src/topic_list.html new file mode 100644 index 0000000..7149823 --- /dev/null +++ b/design/templates/src/topic_list.html @@ -0,0 +1,35 @@ +{% 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 %} +
+
+

Tutorials and tools for building great things on the web.

+

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 how 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.

+

A few of the articles below were previously published in: Ars Technica, Wired, and The Register

+
+

Tutorials about {{topic}}

+ + + + +
+{%endblock%} -- cgit v1.2.3