Skip to content

Commit

Permalink
work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
samhatoum committed Dec 9, 2014
1 parent a90e62f commit b3170c5
Show file tree
Hide file tree
Showing 8 changed files with 586 additions and 148 deletions.
101 changes: 68 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,32 @@
Xolv.io MD-Blog
===============

This is the blog package currently used on The Meteor Testing Manual.

It will give you a blog on your site. You will have two new routes: `/blog` and `/blog/:slug`.
###Getting Started

#### 1. Setup Accounts & Roles
You need to ensure you are using a Meteor accounts package like accounts-password, and that the
user you are logged has 'roles' array with the element `mdblog-author`. Here's an example of a
user object:

```json
{
_id: "ixoreoJY5wzmNYMcY",
emails: [ {
"address" : "[email protected]",
"verified" : true
} ],
profile: { "name" : "Sam Hatoum" },
roles: [ "mdblog-author" ]
}
```

You can also the above pragmatically by calling
`Roles.addUsersToRoles(user._id, ['mdblog-author']);`

#### 2. Define Templates
This is the blog package currently used on The Meteor Testing Manual. It will give you a blog on
your site. You will have two new routes: `/blog` and `/blog/:_id/:slug`.

You need to define these templates in your main app and structure/style them as you like:

Expand All @@ -17,50 +40,62 @@ You need to define these templates in your main app and structure/style them as
</template>
```

And for SEO purposes, you need to set the following settings:
```json
Here you can customize the template further by adding disqus for instance:

```html
<template name="blogPostLayout">
{{> yield}}
{{> disqus}}
</template>
```

#### 3. Customize

This blog is designed to be fully customizable and as unopinionated as possible.

####Styling
For syntax highlighting, you need to add the hljs css file of your choice.
[Pick a css template from here](https://highlightjs.org/static/demo/). You can also isable


####Settings File
{
"public": {
"blog": {
"name": "The Name Of Your Blog",
"Description": "Get the latest news on what's happening in the Meteor testing landscape."
"name": "The Meteor Testing Manual Blog",
"Description": "Get the latest news on what's happening in the Meteor testing landscape.",
"prettify": {
"syntax-highlighting": true,
"element-classes": [
{
"locator": "img",
"classes": ["pure-img"]
}
]
},
"sortBy": {"date": -1}
}
}
}
```

Currently this package doesn't have an editor! That part is coming when time permits. You can do
this in the meantime. Create a file called `blogLoader.js` (or similar) with this setup:
####Sorting

```javascript
Meteor.startup(function () {
####Custom Classes

// this is a new deployment so empty the blog
Blog.remove({});

// add new entries like this
Blog.insert({
slug: 'my-blog-entry',
title: "My Blog Entry",
author: "Sam Hatoum",
date: "Mon Dec 1 2014 13:33:01 GMT-0800 (PST)",
summary: "This is my first blog entry",
content: Assets.getText('blog/my-blog-entry.md'),
order: 6
});
##URL
The URL format of your blog will look lik this:

// rest of the entries
// Blog.insert ...

});

```
`www.your-site.com/blog`

and create blog entries as markdown docs under `/private/blog`
`www.your-site.com/blog/7yh22/your-latest-blog-post`

Pull requests are welcome to add an editor :)
The format is `/:_id/:slug`

The `:slug` is the title of the blog post with all the spaces replaced with dashes. It's believed
this is good for SEO purposes.

## Help Wanted
The `:_id` is a truncated version of the mongo id for the blog entry. This allows you to have
multiple posts with the same title over time.

Use [hallojs](http://hallojs.org/)
##Customizing
Loading

0 comments on commit b3170c5

Please sign in to comment.