Your Own Gravity Your Own Gravity     Categories     About     Feed    

Jekyll Categories

I recently implemented categories on this site, which are really acting as tags here. Jekyll supports both, and if you override the default URL scheme in config.yml (which puts a post “under” its category in the URL, e.g. /technology/my-interesting-post – I’m using permalink: /:title/ instead), the difference mostly evaporates. I figured I’d just stick with categories for now.

Anyway, here is how I implemented it. First, a slightly modified categories.rb plug-in from the Jekyll site goes in your _plugins folder:

module Jekyll

  class CategoryPage < Page
    def initialize(site, base, dir, category)
      @site = site
      @base = base
      @dir = dir
      @name = 'index.html'

      self.process(@name)
      self.read_yaml(File.join(base, '_layouts'), 'categories.html')
      self.data['category'] = category

      category_title_prefix = site.config['category_title_prefix'] || 'Category: '
      self.data['title'] = "#{category_title_prefix}#{category}"
    end
  end

  class CategoryPageGenerator < Generator
    safe true

    def generate(site)
      if site.layouts.key? 'categories'
        dir = site.config['category_dir'] || 'categories'
        site.categories.each_key do |category|
          site.pages << CategoryPage.new(site, site.source, 
			File.join(dir, category), category)
        end
      end
    end
  end

end

Next, create a categories.html layout for the categories pages in your _layouts folder:

---
layout: default
---

<article class="page">
  <h3>Category: {{ page.category }}</h3>
  <div>&nbsp;</div>   
  {% for post in site.categories[page.category] %}
    <p><a href="{{ post.url }}">{{ post.title }}</a></p>
  {% endfor %}
</article>

Then add support in the post.html layout to show categories somewhere in your post layout (I put it at the end of the post content):

<article class="post">
  <h1 class="post-title">{{ page.title }}</h1>
  <time datetime="{{ page.date | date_to_xmlschema }}" 
    class="post-date">{{ page.date | date_to_string }}</time>
  {{ content }}
    {% if page.categories != empty %}
        <p class="category">Categories &nbsp;&nbsp; 
        {% for category in page.categories %}
          <a href="/categories/{{ category }}">
            {{ category }}</a> &nbsp;&nbsp;
        {% endfor %}
    {% endif %}
    </p>
</article>

You should now be able to find posts by categories, e.g. /categories/Technology.

Trump, Kelly: Two Brands

Trevor Noah on Megyn Kelly’s interview with The Donald on Fox:

“You know last night’s interview doesn’t seem to be about journalism or the Republican Party or even the election,” Noah continued. “It seemed like it was about two brands: Donald Trump and Megyn Kelly, and whether they could forge a mutually-beneficial partnership.”

This is exactly what I thought when I watched a recording of this. Maybe Kelly was not actually going for “journalism.” That this was more about her bolstering her own brand seemed to be reinforced at the show’s closing with her hawking her new book. Trump knows he can stonewall answering tough questions, or providing specifics for almost any question. On this show, she became yet another enabler who doesn’t follow-up to press him. It all makes for a shallow spectacle that viewers can take in without much critical thought, another example of journalism as infotainment.

Journalism, Robots, And Algorithms

In light of the Facebook trending news controversy, there are even more troubling aspects of journalism brewing.

My wife and I were talking about Apple News the other day, and she expressed concern about not understanding what determined the stories she is shown. This got into a larger discussion about the weird state of modern journalism, and I mentioned John Gruber’s thoughts about how curation of news feeds is becoming more automated:

If news curation can be automated, there’s nothing inherently wrong with it. Progress in the industrialized world has always involved previously labor-intensive jobs being replaced by automated machinery. We’ve gotten to the point now where some of this work is white collar, not blue collar, and some journalists seem offended by the notion. Their downfall is their dogmatic belief in not having a point-of-view, of contorting themselves to appear not to have a point of view — which, as Jay Rosen has forcefully argued, is effectively a “view from nowhere”. The irony is that machines don’t have a point of view — they are “objective”. Over the last half century or so, mainstream U.S. journalism has evolved in a way that has writers and editors acting like machines. They’ve made it easier for themselves to be replaced by algorithms. Most readers won’t even notice.

At the risk of being a lightning rod, I’ll offer a subject that is an obvious example of where this type of reporting is widespread – climate change. Many writers go out of their way to appear balanced when writing about it when in fact they would serve their readers and themselves better by being accurate. Climate change, after all, is clearly not a phenomenon with 50% uncertainty that requires an article that gives 50% of attention to each side. Yet a lot of news organizations seem to insist that journalists portray it with this false sense of balance.

And Gruber really hits it right with this:

I do two things here at DF most days: find interesting things to link to, and comment on them. An algorithm may well beat me at finding interesting links. My job then, is to be a better writer — smarter, funnier, keener, more surprising — than an algorithm could be. When I can’t do that, it’ll be time to hang up the keyboard… What I’m saying is more If what you do can be replaced by a robot (whether hardware or software), it will happen — and modern U.S. news journalism’s brand of “objectivity” feels algorithmic.

In other words, you can be interesting and compelling and still be objective. Robotic reporting can’t do that.

Another view of what’s gone wrong is this piece with George Clooney’s thoughts on a more insidious aspect of modern journalism:

Clooney also used the press conference to attack cable news networks for allowing their output to slide further into infotainment, a move that he says helped Trump become a viable candidate for the presidency… asked about his own film about TV news, Good Night, and Good Luck (which told the story of Edward R Murrow’s analytical takedown of McCarthyism), [he] said that the problem in the television industry was that broadcasters had lost sight of the idea that news was never designed to be immensely profitable, but that it was designed to inform.

It’s clear that the Internet, not television, is driving news now, but it’s the same issue: monetization, in web parlance. Monetization über alles, and this is what you get.

Take Back The Web

Dan Gilmor on the Facebook trending news dust-up and the meeting with CEO Mark Zuckerberg and conservatives today:

A delegation of right-wing activists will travel this week to Silicon Valley. They will be supplicants at the throne of Facebook, a platform so pervasive that it has unprecedented power to decide what’s news—a platform that could consume journalism itself in coming years. They will be begging Mark Zuckerberg for his indulgence. What they should be doing—what we all should be doing—is finding ways to reduce his company’s dominance.

The promise of the internet and personal technology was in its decentralization: one of the most profound advances for liberty in history. Yet at a rapid rate we’re seeing it re-centralized, as governments and corporations—often with users’ willing, if short-sighted, cooperation—are taking control in the center, creating choke points over what we say and how we can say it.

and:

We—you and I—are part of the solution, too. Unless we recognize what’s at stake, and think about changing our own habits, we’re part of the problem. Unless we advocate for liberty, we’re helping the control freaks win. We’ll need to do things individually, and as members of communities at all levels, to change the trajectory.

I largely agree, but it’s 1) a question of degree and 2) a pendulum. Humankind has always experienced this tension between how much we tolerate centralized control versus the responsibility of how much freedom we want to assume. We often opt to let someone else take care of things, and in many cases including the news now, that someone else is a large platform like Facebook.

Gilmor is right to express concern, but having written about his aversion to the “centralizers” and changing our own habits, it’s funny that he writes some things at one of the new centralizers-on-the-block, Medium.

I Meander, and Swear a Bit

I got curious about something last night. Being knee-deep in moving a website from a homegrown, static concoction to a proper content management system, I’ve become interested (in a somewhat unhealthy way) in the platforms running several blogs I follow. It’s almost unnecessary to say, since it always happens, but this effort took me way into the rabbit hole. I bounced from Apple ticking-and-tocking to life being too short for the slow Apple Watch to better living through Server-generated JavaScript Responses (SJR’s). And anyway…

Yesterday I saw Rands in Repose mention that he’s still using his blog but also selectively putting content on Medium. So he’s using WordPress? Lemme check the page source… sure enough.

I use WordPress for a couple sites I run, but not this site. If you’ve tried to figure out what I’m running here and it’s still a mystery, it’s a static site generated by Jekyll. I love it. The only drawback is not being able to post occasionally from devices besides my MacBook Pro. However, since writing on anything other than a proper keyboard is cumbersome for all but the briefest stuff, that’s not really an issue.

So I meandered a bit more and found some good writing advice, Swear A Bit:

Probably a controversial piece of advice, but fuck it, I love swearing. This is likely a sub-point to sounding like a human, but it’s worth talking about. If you’re sitting at the bar with your friends, you swear. If you’re writing for the web, you’re writing for your extended friends… who cares if you know them? Keep it familiar.

It’s likely I agree that it’s good advice because I already believe it. Then I found more tips about captivating readers who are afflicted by Nerd Attention Deficit Disorder. His entire site is loaded with good shit.

So what was I doing? Building a website, right.

The Verge: 'FBI Has Lost The Encryption Fight'...

Russell Brandom at the Verge with a headline-to-make-ya-click:

But it’s also the end of something much larger. With the New York case closed, the government is no longer using the courts to try to force Apple to break its own security. There are plenty of other iPhones that prosecutors would like to unlock, but no active cases, and given the retreats in both New York and San Bernardino, it doesn’t seem likely prosecutors will start up a new case any time soon. Prosecutors will leave New York with a new ruling in place that strikes down the legal reasoning behind the government’s unlocking request, and there’s now no prospect that ruling will be overturned. After months of high-stakes legal maneuvering, the FBI’s encryption cases are over, and the bureau is leaving in a far worse spot than it started.

I’m not so sure the government is giving up yet, and by withdrawing from these two key cases, little precedent has yet been set in the courts besides the judge’s opinion in the New York case. Besides the legislative route, such as the draft Feinstein-Burr bill, I doubt we have seen the last of government efforts to compel manufacturers or software vendors to break into devices.