Skip to content

Commit

Permalink
📝
Browse files Browse the repository at this point in the history
  • Loading branch information
IonicaBizau committed Sep 26, 2016
1 parent 09decf5 commit 392be64
Show file tree
Hide file tree
Showing 5 changed files with 443 additions and 17 deletions.
66 changes: 66 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# :eight_spoked_asterisk: :stars: :sparkles: :dizzy: :star2: :star2: :sparkles: :dizzy: :star2: :star2: Contributing :star: :star2: :dizzy: :sparkles: :star: :star2: :dizzy: :sparkles: :stars: :eight_spoked_asterisk:

So, you want to contribute to this project! That's awesome. However, before
doing so, please read the following simple steps how to contribute. This will
make the life easier and will avoid wasting time on things which are not
requested. :sparkles:

## Discuss the changes before doing them
- First of all, open an issue in the repository, using the [bug tracker][1],
describing the contribution you would like to make, the bug you found or any
other ideas you have. This will help us to get you started on the right
foot.

- If it makes sense, add the platform and software information (e.g. operating
system, Node.JS version etc.), screenshots (so we can see what you are
seeing).

- It is recommended to wait for feedback before continuing to next steps.
However, if the issue is clear (e.g. a typo) and the fix is simple, you can
continue and fix it.

## Fixing issues
- Fork the project in your account and create a branch with your fix:
`some-great-feature` or `some-issue-fix`.

- Commit your changes in that branch, writing the code following the
[code style][2]. If the project contains tests (generally, the `test`
directory), you are encouraged to add a test as well. :memo:

- If the project contains a `package.json` or a `bower.json` file add yourself
in the `contributors` array (or `authors` in the case of `bower.json`;
if the array does not exist, create it):

```json
{
"contributors": [
"Your Name <and@email.address> (http://your.website)"
]
}
```

## Creating a pull request

- Open a pull request, and reference the initial issue in the pull request
message (e.g. *fixes #<your-issue-number>*). Write a good description and
title, so everybody will know what is fixed/improved.

- If it makes sense, add screenshots, gifs etc., so it is easier to see what
is going on.

## Wait for feedback
Before accepting your contributions, we will review them. You may get feedback
about what should be fixed in your modified code. If so, just keep committing
in your branch and the pull request will be updated automatically.

## Everyone is happy!
Finally, your contributions will be merged, and everyone will be happy! :smile:
Contributions are more than welcome!

Thanks! :sweat_smile:



[1]: https://github.com/Bloggify/Bloggify/issues

[2]: https://github.com/IonicaBizau/code-style
137 changes: 137 additions & 0 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
## Documentation

You can see below the API reference of this module.

### `Bloggify(options, adapter)`
Creates a new instance of `Bloggify`.

#### Params
- **Object** `options`: An object containing the following fields:
- `loadPlugins`: false
- `plugins`: plugins to load
- `pluginConfigs`: plugin configs
- `metadata`:
- `siteTitle`: the site title
- `siteDescription`: the site title
- `domain`: the site domain
- `corePlugins`: `[ "bloggify-plugin-manager", "bloggify-router" ]`
- `server`: The lien settings.
- `theme`:
- `path`: the theme path (default: `"theme"`)
- `public`: the theme public directory (default: `"public"`)
- `adapter`: Adapter settings
- `paths`:
- `articles`: the path to the articles dir (default: `"content/articles"`)
- `pages`: the path to the pages dir (default: `"content/pages"`)
- **BloggifyAdapter** `adapter`: A custom content adapter.

#### Return
- **Bloggify** The `Bloggify` instance.

### `render(lien, templateName, data)`
Renders a template.

#### Params
- **Lien** `lien`: The `lien` object.
- **String** `templateName`: The template name or path.
- **Object** `data`: The template data.

### `registerRouter(router)`
Registers a new router.

#### Params
- **BloggifyRouter** `router`: The Bloggify router to register.

### `getArticleById(id, cb)`
Gets a specific article, by id.

#### Params
- **String** `id`: The article id.
- **Function** `cb`: The callback function.

### `getArticles(query, cb)`
Get multiple articles.

#### Params
- **Object** `query`: The query.
- **Function** `cb`: The callback function.

### `createArticle(title, content, custom, cb)`
Create a new article.

#### Params
- **String** `title`: The article title.
- **String** `content`: The article content.
- **Object** `custom`: Custom data.
- **Function** `cb`: The callback function.

### `saveArticle(id, title, content, custom, cb)`
Saves an existing article.

#### Params
- **String** `id`: The article id.
- **String** `title`: The article title.
- **String** `content`: The article content.
- **Object** `custom`: Custom data.
- **Function** `cb`: The callback function.

### `deleteArticle(id, cb)`
Delete an article.

#### Params
- **String** `id`: The article id.
- **Function** `cb`: The callback function.

### `deleteArticles(ids, cb)`
Delete multiple articles.

#### Params
- **Array** `ids`: A list of ids.
- **Function** `cb`: The callback function.

### `getPageBySlug(slug, cb)`
Get a page by the slug.

#### Params
- **String** `slug`: The page slug.
- **Function** `cb`: The callback function.

### `getPages(query, cb)`
Get multiple pages.

#### Params
- **Object** `query`: The query object.
- **Function** `cb`: The callback function.

### `createPage(title, content, custom, cb)`
Create a new page.

#### Params
- **String** `title`: The article title.
- **String** `content`: The article content.
- **Object** `custom`: Custom data.
- **Function** `cb`: The callback function.

### `savePage(title, content, custom, cb)`
Saves a page.

#### Params
- **String** `title`: The article title.
- **String** `content`: The article content.
- **Object** `custom`: Custom data.
- **Function** `cb`: The callback function.

### `deletePage(slug, cb)`
Delete a page.

#### Params
- **String** `slug`: The page slug.
- **Function** `cb`: The callback function.

### `deletePages(slugs, cb)`
Delete multiple pages.

#### Params
- **Array** `slugs`: An array of slugs.
- **Function** `cb`: The callback function.

88 changes: 74 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,79 @@
<p align="center">
<img src="https://raw.githubusercontent.com/Bloggify/Resources/master/logo/Logo.png" width="150">
</p>

Node.JS based blogging platform.
# `$ bloggify`

## Installation
[![Version](https://img.shields.io/npm/v/bloggify.svg)](https://www.npmjs.com/package/bloggify) [![Downloads](https://img.shields.io/npm/dt/bloggify.svg)](https://www.npmjs.com/package/bloggify)

> We make publishing easy.
## :cloud: Installation

You can install the package globally and use it as command line tool:


```sh
$ npm i -g bloggify
```


Then, run `bloggify --help` and see what the CLI tool can do.


```
$ bloggify --help
Usage: bloggify <command> [options]
We make publishing easy.
Commands:
start Starts the Bloggify process.
stop Stops the Bloggify process.
Options:
-v, --version Displays version information.
-h, --help Displays this help.
Examples:
$ bloggify start
$ bloggify stop
$ bloggify start -c path/to/config/file.json
Documentation can be found at https://github.com/Bloggify/Bloggify.
```

## :clipboard: Example


Here is an example how to use this package as library. To install it locally, as library, you can do that using `npm`:

```sh
$ git clone git@github.com:IonicaBizau/Bloggify.git
$ cd Bloggify/
$ cp config.templ.json config.json
# edit config.json with your data
$ npm install
# Create your website directory and locate it in `config.site.path`
# An example can found here: https://github.com/IonicaBizau/ionicabizau.net
# The website directory should contain the theme folder (as set in config)
$ node index # this will download/init plugins and start Bloggify
$ npm i --save bloggify
```



```js
const Bloggify = require("bloggify");

let app = new Bloggify(`${__dirname}/../node_modules/bloggify-app-example`);

app.onLoad(err => {
console.log(`Bloggify server running on port ${app._serverPort}`);
});
```

## :memo: Documentation

For full API reference, see the [DOCUMENTATION.md][docs] file.

## :yum: How to contribute
Have an idea? Found a bug? See [how to contribute][contributing].


## :scroll: License

[MIT][license] © [Bloggify][website]

[license]: http://showalicense.com/?fullname=Bloggify%20%3Ccontact%40bloggify.org%3E%20(http%3A%2F%2Fbloggify.org)&year=2014#license-mit
[website]: http://bloggify.org
[contributing]: /CONTRIBUTING.md
[docs]: /DOCUMENTATION.md

0 comments on commit 392be64

Please sign in to comment.