Skip to content

Commit

Permalink
Updated sample blog assets
Browse files Browse the repository at this point in the history
  • Loading branch information
mirovarga committed Nov 23, 2015
1 parent 576a55b commit c5f8a24
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 20 deletions.
29 changes: 18 additions & 11 deletions adapters/cli/sample/posts/creating-a-blog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,24 @@

*Docs, Basics*

The following will create a sample blog in the `litepub-blog` directory:
The following will create a sample blog in the current directory:

```
$ litepub create
```

You can override the default directory by providing your own:
If you don't need the sample templates and posts use the `--skeleton` option:

```
$ litepub create my-blog
```
> If the directory already exists the command will fail.
If you don't need the sample templates and posts use the `--blank` option:

```
$ litepub create my-blog --blank
$ litepub --skeleton
```

> Because the template files are required they will be still created but with no
content.

## Directory Structure

Each blog is just a directory with the following structure:
Each blog is stored in a directory with the following structure:

```bash
posts/ # the posts
Expand All @@ -41,4 +34,18 @@ templates/ # the templates and accompanying files (html, css, js, png, etc.
www/ # the generated HTML files (plus copied accompanying files)
```

## The **create** Command Reference

```
Usage:
litepub create [<dir>] [-s, --skeleton]
Arguments:
<dir> The directory to create the blog in or look for; it will be created if
it doesn't exist (only when creating a blog) [default: .]
Options:
-s, --skeleton Don't create sample posts and templates
```

**Next**: [Creating Posts](/creating-posts.html)
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,15 @@ the tag name when generating tag pages) and adding the `html` extension. For
example, a post with the *How I Switched from Java to JavaScript* title is
generated to the `how-i-switched-from-java-to-javascript.html` file.

## The **build** Command Reference

```
Usage:
litepub build [<dir>]
Arguments:
<dir> The directory to create the blog in or look for; it will be created if
it doesn't exist (only when creating a blog) [default: .]
```

**Next**: [Serving a Blog](/serving-a-blog.html)
12 changes: 7 additions & 5 deletions adapters/cli/sample/posts/getting-help.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ $ litepub --help
LitePub - a lightweight static blog generator, http://litepub.com
Usage:
litepub create [<name>] [-b, --blank]
litepub build
litepub serve [-p, --port <port>] [-w, --watch]
litepub create [<dir>] [-s, --skeleton]
litepub build [<dir>]
litepub serve [<dir>] [-R, --rebuild] [-p, --port <port>] [-w, --watch]
Arguments:
<name> Name of the blog [default: litepub-blog]
<dir> The directory to create the blog in or look for; it will be created if
it doesn't exist (only when creating a blog) [default: .]
Options:
-b, --blank Don't create sample posts and templates
-s, --skeleton Don't create sample posts and templates
-R, --rebuild Rebuild the blog before serving
-p, --port <port> The port to listen on [default: 2703]
-w, --watch Rebuild the blog when posts or templates change
-h, --help Show this screen
Expand Down
2 changes: 1 addition & 1 deletion adapters/cli/sample/posts/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ Download a [release](https://github.com/mirovarga/litepub/releases) and unpack
it to a directory. That's all.

> You can optionally add the directory to the `PATH` so you can run `litepub`
from any directory. All examples below assume you have `litepub` in your `PATH`.
from any directory. All examples assume you have `litepub` in your `PATH`.

**Next**: [Creating a Blog](/creating-a-blog.html)
5 changes: 2 additions & 3 deletions adapters/cli/sample/posts/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ unpack it to a directory.
4. Build the blog:

```
$ cd litepub-blog
$ ../litepub build
$ ./litepub build
Generating: index.html
Generating: tags/reference.html
Generating: tags/tutorial.html
Expand All @@ -43,7 +42,7 @@ unpack it to a directory.
5. Run the built-in server:

```
$ ../litepub serve
$ ./litepub serve
Running on http://localhost:2703
Ctrl+C to quit
```
Expand Down
44 changes: 44 additions & 0 deletions adapters/cli/sample/posts/serving-a-blog.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,48 @@ Ctrl+C to quit
> Note that subdirectories in the `posts` and `templates` directories aren't
watched.

## Rebuilding a Blog Before Serving

Sometimes it can be useful to rebuild a blog before serving it, for example when
you don't remember if you made any changes to posts or templates. To rebuild
a blog before serving use the `--rebuild` option:

```
$ litepub serve --rebuild
Generating: index.html
Generating: tags/reference.html
Generating: tags/tutorial.html
Generating: tags/advanced.html
Generating: tags/docs.html
Generating: tags/basics.html
Generating: overview.html
Generating: quick-start.html
Generating: installation.html
Generating: creating-a-blog.html
Generating: creating-posts.html
Generating: generating-html-files-for-a-blog-aka-building-a-blog.html
Generating: serving-a-blog.html
Generating: templates.html
Generating: getting-help.html
Generating: websites-using-litepub.html
Running on http://localhost:2703
Ctrl+C to quit
```

## The **serve** Command Reference

```
Usage:
litepub serve [<dir>] [-R, --rebuild] [-p, --port <port>] [-w, --watch]
Arguments:
<dir> The directory to create the blog in or look for; it will be created if
it doesn't exist (only when creating a blog) [default: .]
Options:
-R, --rebuild Rebuild the blog before serving
-p, --port <port> The port to listen on [default: 2703]
-w, --watch Rebuild the blog when posts or templates change
```

**Next**: [Templates](/templates.html)

0 comments on commit c5f8a24

Please sign in to comment.