mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 06:35:49 +03:00
parent
ea9c50f49e
commit
fe5df2b0d1
@ -1,6 +1,7 @@
|
||||
var sequence = require('when/sequence'),
|
||||
_ = require('underscore'),
|
||||
Post = require('../../models/post').Post,
|
||||
Tag = require('../../models/tag').Tag,
|
||||
Role = require('../../models/role').Role,
|
||||
Permission = require('../../models/permission').Permission,
|
||||
uuid = require('node-uuid');
|
||||
@ -8,11 +9,10 @@ var sequence = require('when/sequence'),
|
||||
var fixtures = {
|
||||
posts: [
|
||||
{
|
||||
"uuid": uuid.v4(),
|
||||
"title": "Welcome to Ghost",
|
||||
"slug": "welcome-to-ghost",
|
||||
"markdown": "This short guide will teach you how to get Ghost up and running on your computer. It doesn't cover deploying it to a live server, just getting it running on your machine so that you can use it, and develop on top of it.\n\n## Setup Instructions\n\n### Compatibility Notes\n\nGhost uses SQLite which must be built natively on the operating system you intend to run Ghost on. We are working to improve this process, but in the meantime the following OS compatibility notes apply:\n\n* **Linux** - Ghost should install and run with no problems\n* **Mac** - you may require Xcode (free) and the CLI Tools which can be installed from Xcode to get Ghost installed\n* **Windows** - Ghost will and does install and run (really well actually) on Windows, but there are a set of pre-requisites which are tricky to install. Detailed instructions for this are coming very soon.\n\n### Pre-requisites\n\nGhost requires [node][1] 0.10.* or 0.11.* and npm. Download and install from [nodejs.org][1]\n\n### Installing\n\n1. Once you've downloaded one of the release packages, unzip it, and place the directory wherever you would like to run the code\n2. Fire up a terminal (or node command prompt in Windows) and change directory to the root of the Ghost application (where config.js and index.js are)\n3. run `npm install` to install the node dependencies (if you get errors to do with SQLite, please see the compatibility notes)\n4. To start ghost, run `npm start`\n5. Visit [http://localhost:2368/](http://localhost:2368/) in your web browser\n\n## Logging in For The First Time\n\nOnce you have the Ghost server up and running, you should be able to navigate to [http://localhost:2368/ghost](http://localhost:2368/ghost) from a web browser, where you will be prompted for a login.\n\n1. Click on the \"register new user\" link\n2. Enter your user details (careful here: There is no password reset yet!)\n3. Return to the login screen and use those details to log in.\n\n## Finding Your Way Around Ghost\n\nYou should now be logged in and up and running with the very first, very earliest, most historically significant, most prototypal version of the Ghost blogging platform. Click around the dashboard. You will find that most things work, but many things do not. We're still working on those. Keep downloading the new packages as we release them, and you should hopefully see big changes between each version as we go!\n\n [1]: http://nodejs.org/",
|
||||
"html": "<p>This short guide will teach you how to get Ghost up and running on your computer. It doesn't cover deploying it to a live server, just getting it running on your machine so that you can use it, and develop on top of it.</p>\n\n<h2 id=\"setupinstructions\">Setup Instructions</h2>\n\n<h3 id=\"compatibilitynotes\">Compatibility Notes</h3>\n\n<p>Ghost uses SQLite which must be built natively on the operating system you intend to run Ghost on. We are working to improve this process, but in the meantime the following OS compatibility notes apply:</p>\n\n<ul>\n<li><strong>Linux</strong> - Ghost should install and run with no problems</li>\n<li><strong>Mac</strong> - you may require Xcode (free) and the CLI Tools which can be installed from Xcode to get Ghost installed</li>\n<li><strong>Windows</strong> - Ghost will and does install and run (really well actually) on Windows, but there are a set of pre-requisites which are tricky to install. Detailed instructions for this are coming very soon.</li>\n</ul>\n\n<h3 id=\"prerequisites\">Pre-requisites</h3>\n\n<p>Ghost requires <a href=\"http://nodejs.org/\">node</a> 0.10.* or 0.11.* and npm. Download and install from <a href=\"http://nodejs.org/\">nodejs.org</a></p>\n\n<h3 id=\"installing\">Installing</h3>\n\n<ol>\n<li>Once you've downloaded one of the release packages, unzip it, and place the directory wherever you would like to run the code</li>\n<li>Fire up a terminal (or node command prompt in Windows) and change directory to the root of the Ghost application (where config.js and index.js are)</li>\n<li>run <code>npm install</code> to install the node dependencies (if you get errors to do with SQLite, please see the compatibility notes)</li>\n<li>To start ghost, run <code>npm start</code></li>\n<li>Visit <a href=\"http://localhost:2368/\">http://localhost:2368/</a> in your web browser</li>\n</ol>\n\n<h2 id=\"logginginforthefirsttime\">Logging in For The First Time</h2>\n\n<p>Once you have the Ghost server up and running, you should be able to navigate to <a href=\"http://localhost:2368/ghost\">http://localhost:2368/ghost</a> from a web browser, where you will be prompted for a login.</p>\n\n<ol>\n<li>Click on the \"register new user\" link</li>\n<li>Enter your user details (careful here: There is no password reset yet!)</li>\n<li>Return to the login screen and use those details to log in.</li>\n</ol>\n\n<h2 id=\"findingyourwayaroundghost\">Finding Your Way Around Ghost</h2>\n\n<p>You should now be logged in and up and running with the very first, very earliest, most historically significant, most prototypal version of the Ghost blogging platform. Click around the dashboard. You will find that most things work, but many things do not. We're still working on those. Keep downloading the new packages as we release them, and you should hopefully see big changes between each version as we go!</p>",
|
||||
"markdown": "You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!\n\n## Getting Started\n\nWriting in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use *formatting* shortcuts to style your content. For example, a list:\n\n* Item number one\n* Item number two\n * A nested item\n* A final item\n\nor with numbers!\n\n1. Remember to buy some milk\n2. Drink the milk\n3. Tweet that I remembered to buy the milk, and drank it\n\n### Links\n\nWant to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to [the Ghost website](http://ghost.org). Neat.\n\n### What about Images?\n\nImages work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:\n\n![The Ghost Logo](http://tryghost.org/ghost.png)\n\nNot sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:\n\n![A bowl of bananas]\n\n\n### Quoting\n\nSometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.\n\n> Wisdomous - it's definitely a word.\n\n### Working with Code\n\nGot a streak of geek? We've got you covered there, too. You can write inline `<code>` blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.\n\n .awesome-thing {\n display: block;\n width: 100%;\n }\n\n### Ready for a Break? \n\nThrow 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.\n\n---\n\n### Advanced Usage\n\nThere's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.\n\n<input type=\"text\" placeholder=\"I'm an input field!\" />\n\nThat should be enough to get you started. Have fun - and let us know what you think :)",
|
||||
"html": "<p>You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!</p>\n\n<h2 id=\"gettingstarted\">Getting Started</h2>\n\n<p>Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use <em>formatting</em> shortcuts to style your content. For example, a list:</p>\n\n<ul>\n<li>Item number one</li>\n<li>Item number two\n<ul><li>A nested item</li></ul></li>\n<li>A final item</li>\n</ul>\n\n<p>or with numbers!</p>\n\n<ol>\n<li>Remember to buy some milk </li>\n<li>Drink the milk </li>\n<li>Tweet that I remembered to buy the milk, and drank it</li>\n</ol>\n\n<h3 id=\"links\">Links</h3>\n\n<p>Want to link to a source? No problem. If you paste in url, like <a href='http://ghost.org'>http://ghost.org</a> - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to <a href=\"http://ghost.org\">the Ghost website</a>. Neat.</p>\n\n<h3 id=\"whataboutimages\">What about Images?</h3>\n\n<p>Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:</p>\n\n<p><img src=\"http://tryghost.org/ghost.png\" alt=\"The Ghost Logo\" /></p>\n\n<p>Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:</p>\n\n<p><img src=\"undefined\" alt=\"A bowl of bananas\" /></p>\n\n<h3 id=\"quoting\">Quoting</h3>\n\n<p>Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.</p>\n\n<blockquote>\n <p>Wisdomous - it's definitely a word.</p>\n</blockquote>\n\n<h3 id=\"workingwithcode\">Working with Code</h3>\n\n<p>Got a streak of geek? We've got you covered there, too. You can write inline <code><code></code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.</p>\n\n<pre><code>.awesome-thing {\n display: block;\n width: 100%;\n}\n</code></pre>\n\n<h3 id=\"readyforabreak\">Ready for a Break?</h3>\n\n<p>Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.</p>\n\n<hr />\n\n<h3 id=\"advancedusage\">Advanced Usage</h3>\n\n<p>There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.</p>\n\n<p><input type=\"text\" placeholder=\"I'm an input field!\" /></p>\n\n<p>That should be enough to get you started. Have fun - and let us know what you think :)</p>",
|
||||
"image": null,
|
||||
"featured": false,
|
||||
"page": false,
|
||||
@ -23,19 +23,27 @@ var fixtures = {
|
||||
}
|
||||
],
|
||||
|
||||
tags: [
|
||||
{
|
||||
"name": "Getting Started",
|
||||
"slug": "getting-started",
|
||||
"description": null,
|
||||
"parent_id": null,
|
||||
"meta_title": null,
|
||||
"meta_description": null
|
||||
}
|
||||
],
|
||||
|
||||
roles: [
|
||||
{
|
||||
"uuid": uuid.v4(),
|
||||
"name": "Administrator",
|
||||
"description": "Administrators"
|
||||
},
|
||||
{
|
||||
"uuid": uuid.v4(),
|
||||
"name": "Editor",
|
||||
"description": "Editors"
|
||||
},
|
||||
{
|
||||
"uuid": uuid.v4(),
|
||||
"name": "Author",
|
||||
"description": "Authors"
|
||||
}
|
||||
@ -43,19 +51,16 @@ var fixtures = {
|
||||
|
||||
permissions: [
|
||||
{
|
||||
"uuid": uuid.v4(),
|
||||
"name": "Edit posts",
|
||||
"action_type": "edit",
|
||||
"object_type": "post"
|
||||
},
|
||||
{
|
||||
"uuid": uuid.v4(),
|
||||
"name": "Remove posts",
|
||||
"action_type": "remove",
|
||||
"object_type": "post"
|
||||
},
|
||||
{
|
||||
"uuid": uuid.v4(),
|
||||
"name": "Create posts",
|
||||
"action_type": "create",
|
||||
"object_type": "post"
|
||||
@ -70,6 +75,11 @@ module.exports = {
|
||||
_.each(fixtures.posts, function (post) {
|
||||
ops.push(function () {return Post.add(post); });
|
||||
});
|
||||
|
||||
_.each(fixtures.tags, function (tag) {
|
||||
ops.push(function () {return Tag.add(tag); });
|
||||
});
|
||||
|
||||
_.each(fixtures.roles, function (role) {
|
||||
ops.push(function () {return Role.add(role); });
|
||||
});
|
||||
@ -77,6 +87,13 @@ module.exports = {
|
||||
ops.push(function () {return Permission.add(permission); });
|
||||
});
|
||||
|
||||
// add the tag to the post
|
||||
ops.push(function () {
|
||||
Post.forge({id: 1}).fetch({withRelated: ['tags']}).then(function (post) {
|
||||
post.tags().attach([1]);
|
||||
});
|
||||
});
|
||||
|
||||
// finally, grant admins all permissions
|
||||
ops.push(function () {
|
||||
Role.forge({id: 1}).fetch({withRelated: ['permissions']}).then(function (role) {
|
||||
|
Loading…
Reference in New Issue
Block a user