All the Articles

![](upload://iJdbV1LQJp00rnJNCJJsDUhU3SG.jpeg)

All the Articles

My God, It's Full of Articles

I spent a little time struggling conceptually with how I wanted to categorize the different types of content I am planning for this site. As I had previously noted, I was already done with creating a blog post type of content, and had noted that I was working on how to show tutorials and ‘showcase’ types of posts.

Apparently, I had the answer in mind when I created that graphic last month. If you notice the two other types of content I am working on, Tutorials and Showcase, are both listed as types Articles on the graphic.

site content types - Blog, Tutorials, Showcase

Of course. There will only be two distinct types of content from the viewpoint of the site, blogposts and articles. I will then use the features of the static-site generator I use for this site, metalsmith, to manage the content presentation (tutorials, showcase, etc). This will be handled through collections in metalsmith.

So at the end of the day, even though there will be a section of Tutorials and Showcase or whatever else I come up with (or someone else), the bottom line is that the base content object will be an Article.

I like this approach, as it leaves a large amount of flexibility while maintaining a nice sense of simplicity. (Anything that lowers the barrier to writing and publishing material is good in my book).

An Aside on Collections in Metalsmith

This is just a note to myself in case I forget what I was on about with collections.

There are basically two ways of associating an article with a collection, through metadata on the file and through a matching pattern during compile time. Unfortunately, as near as I can tell, you can’t do them both at the same time for the same collection type.

Metadata

Doing it through metadata assocation only requires that in the front-matter of the file, the collection type is called out, like collection: tutorial. For example, here’s a sample of the front-matter for this blog post:

---
date: 2015-03-30T17:31:36-05:00
title: "All the Articles"
sub-title: "My God, It's Full of Articles"
lede-img: "M31 - Adam Evans.jpg"
author: "Pat David"
collection: blogposts
layout: blog-posts.hbt
---

In this case, the post will be added to the collection, blogposts.

Pattern Matching

In the index.js for the site, there’s a section for using collections where a pattern can be specified to add files:

.use( collections({
    articles: {
        pattern: 'articles/*/index.html',
        sortBy: 'date',
        reverse: true
        }
}))

This glob pattern will simply add all the posts in a folder in the articles/ directory to the collection, articles.

In fact, this is actually how I want to collect all articles on the site for archive purposes. I’ll want a page on the site that will list all of the articles that will be published, regardless of further classifications. I feel that it is helpful for people searching for information to have a single page listing of all the material on the site (I did something similar with my blog by adding an archive page).

Happy!

So these pieces sort of falling into place make me happy because it means that I am much closer to having a setup how I would like it to be. I can get started writing these other article types now without worrying as much about the back end.

Rather, I only need to focus on creating the landing pages for the content type (tutorials/, showcase/, etc…). Yay! More time to spend on writing new stuff!

Discourse

![Discourse Logo](upload://fbCghm0vITUcNn69KJNwSRR90sA.png)

I had mentioned it previously, but darix on #darktable has been an immense help in testing out Discourse for me. He has gotten it to a point where it mostly works so the only thing holding me back from getting it rolled out is deciding how/where to host the instance.

If anyone has any thoughts or suggestions, I’m all ears! To use Darix’s discourse, I’ll need openSUSE 13 at least. Otherwise, I could probably buy a droplet on Digital Ocean and host it there for now.


This is a companion discussion topic for the original entry at https://pixls.us/blog/2015/03/all-the-articles/

Really? All the things are articles (except blogposts remember)? This is all @darix fault, I think.

Wait. Did I say it was his fault? I should clarify, by his fault, I meant my fault for stumbling through things so often…

the image in front of metalsmith has as src link:

http://pixls.us/blog/2015/02/some-updates/Some%20Updates%204.png'%20alt='site%20content%20types%20-%20Blog,%20Tutorials,%20Showcase'%20/%3E%0A%3C/figure%3E%0A%0A%0A%3Cp%3EOf%20course.%0AThere%20will%20only%20be%20two%20distinct%20types%20of%20content%20from%20the%20viewpoint%20of%20the%20site,%20%3Cem%3Eblogposts%3C/em%3E%20and%20%3Cem%3Earticles%3C/em%3E.%0AI%20will%20then%20use%20the%20features%20of%20the%20static-site%20generator%20I%20use%20for%20this%20site,%20%3Ca%20href=

decoded:

"http://pixls.us/blog/2015/02/some-updates/Some Updates 4.png' alt='site content types - Blog, Tutorials, Showcase' />\n</figure>\n\n\n<p>Of course.\nThere will only be two distinct types of content from the viewpoint of the site, <em>blogposts</em> and <em>articles</em>.\nI will then use the features of the static-site generator I use for this site, <a href="

which might also explain the missing text. the <figure> element that you are using might confuse something here maybe. would need to debug with the importer again.

It is actually your fault

<img src="http://pixls.us/blog/2015/02/some-updates/Some%20Updates%204.png' alt='site content types - Blog, Tutorials, Showcase' />

you open with a " but close with a ' :smiley:

I was so free and edited the initial post to apply the fix.

I’ll check it in a bit, but at first glance, looks like a quote mismatch? Double quotes start the src link, but a single quote is closing it?

correct :smiley:

I grabbed the missing content from the rss feed and fixed the typo for the initial post of this topic.

1 Like

I’m checking the markdown of the post now to make sure it wasn’t from there before I trace it through the metalsmith stack… I may push an update shortly.

Yep, it was a regex mistake when creating absolute paths for the RSS feed. Hard replace with a double quote. Should be fixed now!