Skip to content

Commit

Permalink
Merge pull request #43 from creativecommons/add_blog
Browse files Browse the repository at this point in the history
Publish technical blog archives
  • Loading branch information
kgodey committed Mar 25, 2019
2 parents b4aebf1 + 7e417d1 commit dc17f7d
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 0 deletions.
7 changes: 7 additions & 0 deletions content/tech-blog-archives/contents.lr
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
_model: blog
---
title: CC Technical Blog Archives
---
description:

Here are CC's technical blog posts from 2007-2014 for historical preservation. The information in the posts is probably inaccurate and links may be broken.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
title: Getting started with hacking on The List
---
author: Matt Lee
---
body:

One thing we want to do at Creative Commons is get people involved
with our projects, and run them like true free software projects. As
such, no code is internal for long -- it's just waiting to be checked
in, and pushed. My style of programming is to check in often
(sometimes too often) and with short, punchy comments about the
changes. Sometimes, as we all do, I fail at good commit messages.

With that in mind, I thought I'd write up
[some documentation on how to get started hacking](https://github.com/creativecommons/list/blob/master/www/_source/getting-started.md)
on my most recent project, The List web app.
---
pub_date: 2014-12-15
23 changes: 23 additions & 0 deletions models/blog-post.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[model]
name = Blog Post
label = {{ this.title }}
hidden = yes

[fields.title]
label = Title
type = string
size = large

[fields.pub_date]
label = Publication date
type = date
width = 1/2

[fields.author]
label = Author
type = string
width = 1/2

[fields.body]
label = Body
type = markdown
24 changes: 24 additions & 0 deletions models/blog.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[model]
name = Blog
label = Blog
hidden = yes
protected = yes

[fields.title]
label = Title
type = string
size = large

[fields.description]
label = Description
type = markdown

[children]
model = blog-post
order_by = -pub_date, title

[pagination]
enabled = yes
per_page = 10


8 changes: 8 additions & 0 deletions templates/blog-post.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% extends "layout.html" %}
{% block title %}{{ this.title }}{% endblock %}
{% block header %}{{ this.parent.title }}{% endblock %}
{% block body %}
<h2 class="mb-0">{{ this.title }}</h2>
<p class="meta text-muted mt-0">by {{ this.author }} on {{ this.pub_date|dateformat('full') }}
<div class="body">{{ this.body }}</div>
{% endblock %}
18 changes: 18 additions & 0 deletions templates/blog.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% extends "layout.html" %}
{% from "macros/pagination.html" import render_pagination %}
{% block title %}{{ this.title }}{% endblock %}
{% block body %}
{{ this.description }}
<ul class="blog-index list-unstyled">
{% for post in this.pagination.items %}
<li>
<a href="{{ post|url }}">{{ post.title }}</a>
<p class="text-muted small">by {{ post.author }} on {{ post.pub_date|dateformat("YYYY-MM-dd") }}</p>
</li>
{% endfor %}
</ul>

{% if this.pagination.pages > 1 %}
{{ render_pagination(this.pagination) }}
{% endif %}
{% endblock %}

0 comments on commit dc17f7d

Please sign in to comment.