Skip to content

Commit

Permalink
Blog: Add Blog To Bitcoin.org
Browse files Browse the repository at this point in the history
* Adds new page /en/blog

* Adds new feed for blog posts to /en/rss/blog.xml

* Adds "Blog" link to site footer

* Adds three back-dated blog posts to give the blog some initial
  content.
  • Loading branch information
harding committed Apr 22, 2015
1 parent 3a7968e commit ffa9a24
Show file tree
Hide file tree
Showing 27 changed files with 803 additions and 1 deletion.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -612,3 +612,34 @@ aliases:
--author=Satoshi Nakamoto: Satoshi Nakamoto
gavinandresen: Gavin Andresen
```
### Blog Posts
Posts for the [Bitcoin.org Site Blog][] should be added to the `_posts`
directory with the naming convention:
`YEAR-MONTH-DAY-ARBITRARY_FILE_NAME` (with year, month, and day as
two-digit numbers). The YAML front matter should be similar to this:
---
type: posts
layout: post
lang: en
category: blog
title: "Quarterly Report March 2015"
permalink: /en/posts/quarterly-report-march-2015.html
date: 2015-03-05
author: >
David A. Harding (<a href="mailto:dave@dtrt.org">email</a>, <a
href="https://github.com/harding">GitHub</a>,
<a href="http://www.reddit.com/user/harda/">Reddit</a>)
---
The type, layout, and category should always be as specified above. The
other parameters should be set to values specific to that post, but the
permalink must end in '.html'.
Below the YAML front matter, enter the content of the post in Markdown
format. Images should be placed in `img/blog/free` if they are
MIT-licensed or `img/blog/nonfree` if they have a more restrictive
copyright license.
3 changes: 3 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,10 @@ aliases:

safe: false
port: 4000
## Used in older version of Jekyll
base-url: /
## Used in newer versions of Jekyll
baseurl: /

source: .
destination: ./_site
Expand Down
2 changes: 1 addition & 1 deletion _contrib/bco-htmlproof
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ HTML::Proofer.new(
## require updating
:href_swap => {
## (Hack) Append '$' to the ends of filenames we don't want to append .html to
/(css|png|rss|pdf|jpg|asc)$/ => '\1$',
/(css|png|rss|pdf|jpg|asc|xml)$/ => '\1$',

## Append .html to end of most URLs so proofer can find the local files
/^(
Expand Down
1 change: 1 addition & 0 deletions _layouts/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
{% endcase %}
<a href="/{{ page.lang }}/{% translate press url %}">{% translate menu-press layout %}</a>
<a href="/{{ page.lang }}/{% translate about-us url %}">{% translate menu-about-us layout %}</a>
<a href="/en/blog">Blog</a>
</div>
<div class="footersponsor">
<div><span>{% translate sponsor layout %}</span> <a href="https://bitcoinfoundation.org/"><img src="/img/brand/bitcoinfoundation.png" alt="Bitcoin Foundation"></a></div>
Expand Down
25 changes: 25 additions & 0 deletions _layouts/post.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
# This file is licensed under the MIT License (MIT) available on
# http://opensource.org/licenses/MIT.

layout: base
lang: en
---
<div class="subhead-links"><a href="/en/blog">Blog home</a>
| <a href="/en/rss/blog.xml">Subscribe to RSS feed</a>
| <a href="https://github.com/bitcoin/bitcoin.org/commits/master/{{page.path|uri_escape}}">Post history</a>
| <a href="https://github.com/bitcoin/bitcoin.org/issues/new?body=Source%20File%3A%20{{page.path|uri_escape}}%0A%0A">Report issue</a></div>

<div class="post">
<header class="post-header">
<h1 class="post-title">{{ page.title }}</h1>
</header>

<article class="post-content">
{{ content }}
</article>

<p class="post-meta">Posted to the <a href="/en/blog">Bitcoin.org Site
Blog</a> on {{ page.date | date: "%d %B %Y" }} {% if page.author %} by {{ page.author }}{% endif %}{% if page.meta %} {{ page.meta }}{% endif %}</p>

</div>
16 changes: 16 additions & 0 deletions _less/screen.less
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,22 @@ br.clear {
height: 18px;
}

div.post {
max-width: 40em;
margin-right: auto;
margin-left: auto;
}
.post img {
max-width: 100%;
}
.post-meta {
margin-top: 20px;
font-style: italic;
}
.post-title {
padding-top: 20px;
}

.highlight { background: #ffffff; }
.highlight .c { color: #999988; font-style: italic } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
Expand Down
Loading

0 comments on commit ffa9a24

Please sign in to comment.