diff options
-rw-r--r-- | app/builder/views.py | 4 | ||||
-rw-r--r-- | app/essays/admin.py | 8 | ||||
-rw-r--r-- | app/essays/build.py | 50 | ||||
-rw-r--r-- | app/essays/migrations/0005_auto_20190208_0946.py | 25 | ||||
-rw-r--r-- | app/essays/models.py | 13 | ||||
-rw-r--r-- | app/essays/urls.py | 2 | ||||
-rw-r--r-- | app/essays/views.py | 13 | ||||
-rw-r--r-- | app/jrnl/views.py | 2 | ||||
-rw-r--r-- | config/base_urls.py | 1 | ||||
-rw-r--r-- | design/sass/_archives.scss | 35 | ||||
-rw-r--r-- | design/sass/_comments.scss | 2 | ||||
-rw-r--r-- | design/sass/_details.scss | 6 | ||||
-rw-r--r-- | design/sass/_fonts.scss | 14 | ||||
-rw-r--r-- | design/sass/_footer.scss | 2 | ||||
-rw-r--r-- | design/sass/_global.scss | 13 | ||||
-rw-r--r-- | design/sass/_mixins.scss | 9 | ||||
-rw-r--r-- | design/templates/admin/buttons.html | 1 | ||||
-rw-r--r-- | design/templates/archives/homepage-light.html | 2 | ||||
-rw-r--r-- | design/templates/essays/essay_list.html | 15 |
19 files changed, 110 insertions, 107 deletions
diff --git a/app/builder/views.py b/app/builder/views.py index 3bab64e..7949a35 100644 --- a/app/builder/views.py +++ b/app/builder/views.py @@ -12,6 +12,7 @@ from notes.build import builder as notes_builder from pages.build import builder as page_builder from sketches.build import builder as sketches_builder from photos.build import dailybuilder +from essays.build import essaybuilder options = { 'writing': BuildWriting, @@ -76,6 +77,9 @@ def do_build(request): elif section == 'sketches': context = {'message': 'Writing Notes to Disk'} sketches_builder() + elif section == 'essays': + context = {'message': 'Writing Essays to Disk'} + essaybuilder() else: options[section]().build() context = {'message': 'Writing %s to Disk' % section} diff --git a/app/essays/admin.py b/app/essays/admin.py index f326092..35a9997 100644 --- a/app/essays/admin.py +++ b/app/essays/admin.py @@ -1,12 +1,8 @@ from django.contrib import admin -from .models import Essay, PostType -from utils.widgets import LGEntryForm - -@admin.register(PostType) -class PostTypeAdmin(admin.ModelAdmin): - prepopulated_fields = {"slug": ('name',)} +from utils.widgets import LGEntryForm +from .models import Essay @admin.register(Essay) class EssayAdmin(admin.ModelAdmin): diff --git a/app/essays/build.py b/app/essays/build.py index cd6cc28..62370d0 100644 --- a/app/essays/build.py +++ b/app/essays/build.py @@ -4,56 +4,16 @@ from django.urls import reverse from . import models -class BuildSrc(BuildNew): +class BuildEssays(BuildNew): def build(self): - self.build_list_view( - base_path=reverse("src:list"), - paginate_by=99999 - ) - self.build_list_view( - base_path=reverse("src:list_books"), - paginate_by=99999 - ) + self.build_list_view() self.build_detail_view() # These are the unique classes for this model: - # self.build_books_view() - self.build_topic_view() - self.build_feed("src:feed") + #self.build_feed("src:feed") - def build_topic_view(self): - for topic in models.Topic.objects.all(): - url = reverse("src:list_topics", kwargs={'slug': topic.slug, }) - path, slug = os.path.split(url) - response = self.client.get(url, HTTP_HOST='127.0.0.1') - self.write_file('%s/' % path, response.content, filename=slug) - def build_books_view(self): - for obj in models.Book.objects.all(): - url = reverse("src:detail_book", kwargs={'slug': obj.slug, }) - path, slug = os.path.split(url) - response = self.client.get(url, HTTP_HOST='127.0.0.1') - self.write_file('%s/' % path, response.content, filename=slug) - -def builder(): - j = BuildSrc("src", "post") +def essaybuilder(): + j = BuildEssays("essays", "essay") j.build() - - -""" - - - - - def build_books(self): - path = 'src/books/' - c = Context({ - 'object_list': Book.objects.filter(status__exact=1), - 'MEDIA_URL': settings.BAKED_MEDIA_URL, - 'IMAGES_URL': settings.BAKED_IMAGES_URL - }) - t = render_to_string('archives/src_books.html', c).encode('utf-8') - self.write_file(path, t) - -""" diff --git a/app/essays/migrations/0005_auto_20190208_0946.py b/app/essays/migrations/0005_auto_20190208_0946.py new file mode 100644 index 0000000..5b68bb4 --- /dev/null +++ b/app/essays/migrations/0005_auto_20190208_0946.py @@ -0,0 +1,25 @@ +# Generated by Django 2.1.5 on 2019-02-08 09:46 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('essays', '0004_auto_20190205_0830'), + ] + + operations = [ + migrations.DeleteModel( + name='PostType', + ), + migrations.RemoveField( + model_name='essay', + name='post_type', + ), + migrations.AddField( + model_name='essay', + name='preamble', + field=models.TextField(blank=True), + ), + ] diff --git a/app/essays/models.py b/app/essays/models.py index 23a4cce..6160165 100644 --- a/app/essays/models.py +++ b/app/essays/models.py @@ -20,19 +20,11 @@ POST_TYPE = ( ) -class PostType(models.Model): - name = models.CharField(max_length=200) - dek = models.TextField(blank=True) - slug = models.SlugField() - - def __str__(self): - return self.name - - class Essay(models.Model): title = models.CharField(max_length=200) sub_title = models.CharField(max_length=200, blank=True) dek = models.TextField(blank=True) + preamble = models.TextField(blank=True) slug = models.SlugField(unique_for_date='pub_date') body_html = models.TextField(blank=True) body_markdown = models.TextField() @@ -46,7 +38,6 @@ class Essay(models.Model): ) status = models.IntegerField(choices=PUB_STATUS, default=0) meta_description = models.CharField(max_length=256, null=True, blank=True) - post_type = models.IntegerField(choices=POST_TYPE, default=0) tags = TaggableManager(through=TaggedItems, blank=True, help_text='Topics Covered') originally_published_by = models.CharField(max_length=400, blank=True) originally_published_by_url = models.CharField(max_length=400, blank=True) @@ -66,7 +57,7 @@ class Essay(models.Model): return self.title def get_absolute_url(self): - return "/%s/%s" % (self.get_post_type_display(), self.slug) + return reverse('essays:detail', kwargs={"slug": self.slug}) def comment_period_open(self): return self.enable_comments and datetime.datetime.today() - datetime.timedelta(30) <= self.pub_date diff --git a/app/essays/urls.py b/app/essays/urls.py index 408e959..8216f06 100644 --- a/app/essays/urls.py +++ b/app/essays/urls.py @@ -16,7 +16,7 @@ urlpatterns = [ name="detail" ), path( - r'<str:slug>.txt', + r'<str:slug>', views.EntryDetailViewTXT.as_view(), name="detail-txt" ), diff --git a/app/essays/views.py b/app/essays/views.py index 0fdaa63..f8c68c7 100644 --- a/app/essays/views.py +++ b/app/essays/views.py @@ -3,25 +3,16 @@ from django.views.generic.detail import DetailView from django.contrib.syndication.views import Feed -from .models import Essay, PostType, POST_TYPE +from .models import Essay class EssayListView(ListView): model = Essay def get_queryset(self, **kwargs): - t = self.request.path.split('/')[1] - type_reverse = dict((v, k) for k, v in POST_TYPE) - self.essay_type = t - qs = Essay.objects.filter(post_type=type_reverse[t]) + qs = Essay.objects.filter(status=1) return qs - def get_context_data(self, **kwargs): - # Call the base implementation first to get a context - context = super(EssayListView, self).get_context_data(**kwargs) - context['essay_type'] = PostType.objects.get(slug=self.essay_type) - return context - class EntryDetailView(DetailView): model = Essay diff --git a/app/jrnl/views.py b/app/jrnl/views.py index b2b0316..70b6bf0 100644 --- a/app/jrnl/views.py +++ b/app/jrnl/views.py @@ -109,7 +109,7 @@ class HomepageList(ListView): def get_queryset(self): queryset = super(HomepageList, self).get_queryset() self.home = self.get_home() - return queryset.filter(status__exact=1).order_by('-pub_date').exclude().select_related('location').select_related('featured_image')[:8] + return queryset.filter(status__exact=1).order_by('-pub_date').exclude().select_related('location').select_related('featured_image')[1:9] def get_template_names(self): return ['%s' % self.home.template_name] diff --git a/config/base_urls.py b/config/base_urls.py index 6f2f1e6..195bc55 100644 --- a/config/base_urls.py +++ b/config/base_urls.py @@ -38,6 +38,7 @@ urlpatterns = [ path(r'luximages/insert/', utils.views.insert_image), path(r'sitemap.xml', sitemap, {'sitemaps': sitemaps}), path(r'links/', include('links.urls')), + path(r'lttr/', include('newsletter.urls')), path(r'jrnl/', include('jrnl.urls')), path(r'projects/', include('projects.urls')), path(r'locations/', include('locations.urls')), diff --git a/design/sass/_archives.scss b/design/sass/_archives.scss index a2caba9..215ff29 100644 --- a/design/sass/_archives.scss +++ b/design/sass/_archives.scss @@ -22,6 +22,26 @@ text-align: left; } } +.essay-intro { + font-family: $fancy_serif; + border-bottom: 3px double #efefef; + padding-bottom: 3rem; + margin-bottom: 4rem; + p { + font-style: normal !important; + @include fontsize(18); + line-height: 1.3; + margin-top: 1.2rem !important; + &:first-of-type { + margin-top: 2rem !important; + } + } + a { + text-decoration: underline !important; + text-decoration-color: $orange !important; + + } +} // container for archive grid items .archive-grid { @@ -39,7 +59,8 @@ } // body class archive, article header (usually inherits h2) .archive .post-title { - @include fontsize(24); + font-family: $fancy_serif; + @include fontsize(26); line-height: 1.3; font-style: italic; margin: .25rem 0 .5rem; @@ -50,14 +71,17 @@ // the date and location are small caps .post-date, .post-location { @include smcaps; - @include fontsize(12); + @include fontsize(14); + font-weight: bold; + color: $secondary-link-color; line-height: 1.2; text-align: left; margin: 0; } // slightly larger summary than a p in this context .post-summary { - @include fontsize(15); + font-family: $fancy_serif; + @include fontsize(16); line-height: $archive_p_line_height; margin-top: .25rem; text-align: left; @@ -92,7 +116,7 @@ } } h2 { - font-family: $fancy_headline_font_serif; + font-family: $fancy_serif; @include fontsize(32); margin: 0; line-height: 1.1; @@ -100,7 +124,7 @@ p { margin: 0; @include fontsize(20); - font-family: $fancy_italic; + font-style: italic; } } // Specific pages vary slightly @@ -263,6 +287,7 @@ display: block; margin-top: .75rem; @include fontsize(20); + } } .post-location { diff --git a/design/sass/_comments.scss b/design/sass/_comments.scss index 45c81dc..1e254d6 100644 --- a/design/sass/_comments.scss +++ b/design/sass/_comments.scss @@ -60,7 +60,7 @@ .comment--form--wrapper { @include constrain_narrow(); p { - font-family: $fancy_headline_font_serif; + font-family: $fancy_serif; } } .comment--form--header { diff --git a/design/sass/_details.scss b/design/sass/_details.scss index ffc32f5..3659c26 100644 --- a/design/sass/_details.scss +++ b/design/sass/_details.scss @@ -21,7 +21,7 @@ } } .post-subtitle { - font-family: $fancy_italic; + font-style: italic; font-size: 1.5rem; line-height: 1; margin-top: .5rem; @@ -60,7 +60,7 @@ margin: 0 } .afterward { - font-family: $fancy_italic; + font-style: italic; h4 { margin-bottom: 0; } @@ -173,7 +173,7 @@ h4.post-source { a { display: block; float: left; - font-family: $fancy_headline_font_serif; + font-family: $fancy_serif; text-align: left; font-style: italic; color: $brown; diff --git a/design/sass/_fonts.scss b/design/sass/_fonts.scss index ed4a212..95fe2e2 100644 --- a/design/sass/_fonts.scss +++ b/design/sass/_fonts.scss @@ -16,6 +16,13 @@ font-weight: 400; font-style: normal; } +@font-face { + font-family: 'mffweb'; + src: url('/media/fonts/ffmbi.woff2') format('woff2'); + src: url('/media/fonts/ffmbi.woff') format('woff'); + font-weight: 400; + font-style: italic; +} @font-face { font-family: 'mffnweb'; @@ -25,10 +32,3 @@ font-style: normal; } -@font-face { - font-family: 'mffmbi'; - src: url('/media/fonts/ffmbi.woff2') format('woff2'); - src: url('/media/fonts/ffmbi.woff') format('woff'); - font-weight: 400; - font-style: normal; -} diff --git a/design/sass/_footer.scss b/design/sass/_footer.scss index 5d72eae..b0470ce 100644 --- a/design/sass/_footer.scss +++ b/design/sass/_footer.scss @@ -26,7 +26,7 @@ footer[role="contentinfo"] { padding-left: 0.75em; } a { - color: $brown; + color: $secondary-link-color; text-decoration: none; } ul { display:inline;} diff --git a/design/sass/_global.scss b/design/sass/_global.scss index 20f9056..bfbb50e 100644 --- a/design/sass/_global.scss +++ b/design/sass/_global.scss @@ -19,16 +19,17 @@ a, button, input, select, textarea, label, summary { touch-action: manipulation; } a { - color: $orange; + color: $body_font_color; -webkit-transition: all 0.1s ease; -moz-transition: all 0.1s ease; -ms-transition: all 0.1s ease; transition: all 0.1s ease; + text-decoration-color: $orange; &:hover { text-decoration: none; } &:visited { - color: $orange; + color: $body_font_color; } } p { @@ -198,7 +199,9 @@ h5 { } .bl { @include smcaps; - @include fontsize(11); + @include fontsize(12); + font-weight: 600; + color: $secondary-link-color; } .italic { font-style: italic; @@ -223,7 +226,9 @@ h5 { li { display: inline; } - a { color: $brown;} + a { + color: $secondary-link-color; + } @include breakpoint(gamma) { text-align: left; } diff --git a/design/sass/_mixins.scss b/design/sass/_mixins.scss index 2de8000..b7fc66d 100644 --- a/design/sass/_mixins.scss +++ b/design/sass/_mixins.scss @@ -5,12 +5,12 @@ $orange: #b53a04; $link_color: #b53a04; $headline_font_serif: Georgia, 'Times New Roman', serif; -$fancy_headline_font_serif: mffweb, Georgia, 'Times New Roman', serif; -$fancy_italic: mffmbi, Georgia, 'Times New Roman', serif; +$fancy_serif: mffweb, Georgia, 'Times New Roman', serif; $body_p_font: normal 100% / 1.5 Georgia, Cambria, "Times New Roman", Times, serif; $body_font_color: $brown; $body_font_light: #b3aeae; +$secondary-link-color: #838383; $archive_p_line_height: 1.6; //$light; @@ -19,8 +19,9 @@ $narrow-max-width: 750px; $max_width: 1440px; @mixin smcaps { - text-transform: uppercase; - letter-spacing: 1px; + @include fancy_sans; + text-transform: uppercase; + letter-spacing: 1px; } @mixin plain_a { border: none; diff --git a/design/templates/admin/buttons.html b/design/templates/admin/buttons.html index d0d4f34..bd4b3cb 100644 --- a/design/templates/admin/buttons.html +++ b/design/templates/admin/buttons.html @@ -48,6 +48,7 @@ <li class="item"><a href="/admin/build/build?id=pages">Build All Pages</a></li> <li class="item"><a href="/admin/build/build?id=sketches">Build Sketches</a></li> <li class="item"><a href="/admin/build/build?id=dailyphotos">Build Daily Photo</a></li> + <li class="item"><a href="/admin/build/build?id=essays">Build Essays</a></li> <li class="item"><a href="/admin/build/build?id=photo_galleries">Build Photo Galleries</a></li> <li class="item"><a href="/admin/build/build?id=projects">Build Project Pages</a></li> <li class="item"><a href="/admin/build/build?id=buildbooks">Build Books</a></li> diff --git a/design/templates/archives/homepage-light.html b/design/templates/archives/homepage-light.html index 7aaf1aa..26ff437 100644 --- a/design/templates/archives/homepage-light.html +++ b/design/templates/archives/homepage-light.html @@ -51,7 +51,7 @@ <section class="recent-popular"> <div class="recent"> <h1 class="homepage-section-header">Recent</h1> - <div class="archive-grid">{% for object in recent %} + <div class="archive-grid">{% 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 %} diff --git a/design/templates/essays/essay_list.html b/design/templates/essays/essay_list.html index 6ea89a3..1d70622 100644 --- a/design/templates/essays/essay_list.html +++ b/design/templates/essays/essay_list.html @@ -1,17 +1,20 @@ {% extends 'base.html' %} {% load typogrify_tags %} -{% load comments %} -{% block pagetitle %}Luxagraf | {{essay_type}}{% endblock %} +{% block pagetitle %}Collected Essays of Scott Gilbertson {% endblock %} +{% block metadescription %}Collected writing: essays, articles and stories on travel, photography, tools, walking, the natural world and other ephemera.{% endblock %} -{% block metadescription %}Luxagraf — Collected writing: essays on ecosophia, mediation, life, photography, tools, walking, and other ephemera.{% 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>{{essay_type|capfirst}}</li> + <li>Essays</li> </ul> <main role="main" id="essay-archive" class="essay-archive archive-list"> - <h1 class="topic-hed">{{essay_type.name|capfirst}}</h1> - <h6>{{essay_type.dek}}</h6> + <div class="essay-intro"> + <h2>My various articles and essays collected in one spot.</h2> + <p>Topics include travel, writing, photography, free software, culture, and once, Del Taco.</p> + <p>Many essays below were previously published in: <em><a href="https://www.wired.com/author/scott-gilbertson/">Wired</a></em>, <em><a href="https://www.budgettravel.com/article/0902_HTTN_SocialNetwork_5488">Budget Travel</a></em>, <em><a href="https://arstechnica.com/">Ars Technica</a></em>, <em><a href="https://web.archive.org/web/20100904114555/http://one.longshotmag.com/article/going-for-seconds">Longshot Magazine</a>,</em> <em><a href="https://web.archive.org/web/20150506051746/http://1888.center/scott-gilbertson/">The Cost of Paper</a></em> and elsewhere.</a> + </div> + <h1 class="topic-hed">Essays</h1> <ul>{% for object in object_list %} <li class="h-entry hentry" itemscope itemType="http://schema.org/Article"> <span class="date dt-published">{{object.pub_date|date:"F Y"}}</span> |