Total Pageviews

Tuesday 21 May 2013

用scriptogr.am+dropbox 写静态博客

Getting started

After connecting your Dropbox account to scriptogr.am, some necessary files and folders are added to your Dropbox at Apps/scriptogram. First the GET_STARTED.txt text file that pretty much explains the exact same as what you’re reading now. Next, we’ve added a posts folder. This is where you add your blog post (& page) files. These files are plain textfiles, but needs to be saved with the .md (markdown) extension like this: yourfile.md

Please use standard, non foreign filenames. Dropbox sometimes have problem syncing filenames that contains invalid HTML characters. We’ve added a post example page (this file) there for you to get familiar with.

The template data

All files needs to contain "front block". The front block must be the first thing in the file and takes the form of:
Date: 2012-04-17
Title: My first post
You can set any of the predefined variables (see below for a reference). But, the Title is required. Without the title, the system will fail.

Predefined global variables

All the variable names below are case-sensitive:
Required:
Title
The title of your post (or page)
Not required, but close to:
Date
The following date format is the correct one to use: 2011-12-31 12:31 or 2011-12-31. (The Date variable can be used to ensure correct sorting of posts.)
Optional:
Published
Set to ’false’ if you don’t want a post to show up when the site is generated.
Type
Set to ’page’ if you wan’t the post to act as a ’page’ instead of a ’post’.
Slug
Custom permalink (replaces the auto generated url based on the "Title:" variable), especially useful if titles tend to be long or they change frequently. E.g ’my-custom-permalink-url’
Link
Links the "post" or "page" title to an external source. E.g ’http://google.com’
Tags
Add tags to your posts and pages. Comma separated words. Once added, scriptogr.am will transform all tags to valid basic HTML characters.
Excerpt
Add an excerpt1 to your post or page.

Difference between ’posts’ and ’pages’

A post is a blog post.
A page is a similar as a post, but generates a link visible in the menu on your site that will lean to a page permalink.

Publishing your posts

This is simple. Just head to your admin panel and hit the ”Synchronize” button. When logged in to scriptogr.am and visiting your own page, you’ll see the scriptogr.am logotype symbol on the top right of the browser window. This is the link that leads to your admin panel.

Published vs unpublished

Total count of published and unpublished posts (& pages) are visible next to the ”Synchronize” button. ”Unpublished” means that you either removed a post text file from your Dropbox or that something went wrong while trying to sync your Dropbox with scriptogr.am. Also, if you’ve set a post to be published with the Published: false variable.
Finally, happy posting. If you have any questions, suggestions or thoughts just drop us an e-mail at any time.

An excerpt is a relatively small sample passage from a longer work, such as a book or article.

我的博客示例: http://scriptogr.am/luckypoe