UNPKG

4.96 kBMarkdownView Raw
1# Hey.coffee
2
3**These docs are a work in progress**
4
5This is a simple flatfile blog tool. Write your posts with markdown, and publish via the commandline.
6
7Just to be clear, this blog tool isn't for you if you need a CMS with more features then you'll ever know about. There is no web based interface. Hey.coffee generates flat HTML files, and then rsyncs those files to your web server.
8
9Generated files are placed in the **site/** folder. Anything you place there, including additional folders and files, will be sent up to your server.
10
11## Installing
12
13 > npm install -g hey-coffee
14
15Once you have Hey.coffee installed, you can open a shell and run the following command to get info on how to use it:
16
17 > hey --help
18
19### Requirements
20
21Hey.coffee was written in...CoffeeScript. So the basic requirements to run this on your personal machine are:
22
23- Node.js
24- CoffeeScript installed globally (npm install -g coffee-script)
25
26You will of course need a webserver somewhere for Hey.coffee to post your generated website to. That host should allow you access to rsync.
27
28## Getting Started
29
30To setup a new blog, create an empty directory and run this command:
31
32 > hey --init
33
34This script will generate the base structure of your new blog:
35
36- Posts directory: Save your markdown posts here. A sample is created by the init command
37- Pages directory: Save your pages here
38- hey-config.json: Open this file and configure it. More on this to follow
39- hey-cache.json: Hey.coffee uses this file to store your processed posts
40
41### hey-config.json
42
43So in this file we have some pretty basic parameters that need setting:
44
45- **siteTitle:** The name of your blog
46- **author:** Your name as it will appear in your rss feed
47- **description:** Your site's description as it will appear in your rss feed
48- **site:** Your site's URL. Should include 'http://' and have no trailing slash
49- **postsOnHomePage:** The number of posts on your home page
50- **server:** For the rsync: user@yoursite.com:/path/to/blog
51- **port:** The ssh port...22 is usually the safe bet
52
53Everything except the server parameter will be passed down to your templates, so if you want to add a copyright or anything else this a good place to do it.
54
55
56## Posts
57
58Posts are simply markdown files in the **posts/** directory. The name of the file will become part of the post's URL (ex: test-post.md will have a slug of /2013/04/22/test-post).
59
60The first line is the post's title, and right under that is where you can place some key/value pairs that will be treated as variables and passed down to your template.
61
62 Post Title
63 ==========
64 Type: text
65 Tags: sample, post
66 Published: 2013-03-27 12:00:00
67
68 The FIRST post.
69
70 And a second paragraph for good meassure.
71
72So in the example above, you'll have a title of: "Post Title". The template will also have access to variables: type and tags. You can put practically anything here and it will be passed down to the template.
73
74Some variables have special meaning to Hey.coffee, and affects how it works:
75
76- **Type:** Hey.coffee will check for the type variable in your posts and create a variable with a value of true for use in your templates. If you have a type of *link* in your post file, your template will get a variable named *isLink*
77- **Tags:** This field isn't required, but when it is it should be a comma seperated list
78- **Published:** This variable will let Hey.coffee know when your story should be published, and what order to display your posts in. If this variable isn't included in your markdown file, it won't be published to the front page of your site. It must also be in this format: 2013-03-27 12:00:00
79
80## Pages
81
82Pages are pretty much the same deal as posts. You place them in the **pages/** directory, and the same rules regarding variables apply with the exception of *published*. The published variable is not required.
83
84## To Do
85
86- Generate Makefile
87- Write tests
88
89## The License (MIT)
90Copyright (c) 2013 TJ Eastmond
91
92Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
93
94The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
95
96THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\No newline at end of file