Skip to content

Commit

Permalink
updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbakker committed May 6, 2021
1 parent 4dd17fb commit 5dd66d3
Showing 1 changed file with 32 additions and 12 deletions.
44 changes: 32 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,36 +21,56 @@ To upgrade:
brew upgrade afosto-cli
```

## Usage
## Features

The current list for features for this CLI tool is as follows:

- upload a local directory to your account
- download a remote directory (from your account) to your machine
- develop HTML templates

To start local development of templates, run:

## Upload files

In order to upload a directory and all it's contents from your machine to your account use the following command:
```bash
afosto render -p 8888 -f afosto.config.yml
afosto upload -s /Users/peter/images -d /images
```
`-s` (source) points to the path on your computer that you want to recursively upload. `-d` (destination) points to the directory in your account.

Where `-p` is the port number for the local webserver and `-f` points to the afosto.config.yml file in the root of the template repository.

## Download files

When you want to download files from your account to your computer you run:

```bash
afosto download -s invoices -d /Users/peter/backups/invoices
```

`-s` (source) points to the directory in your account. `-d` (destination) points to the path on your computer that you want to store the files.

## Filters

Sort
## Develop templates

sort takes in a slice or a map and sort this based on a key.
To start working on templates in your account you need to start the local development server while pointing to your configuration file.

to determine if it will be asc or desc, first parameter can be a `-` which controls the order of the sorting
after that it takes in a dotted path. which represents the nesting it should check
```bash
afosto render -p 8888 -f afosto.config.yml
```

{{slice|sort}}
Where `-p` is the port number for the local webserver and `-f` points to the afosto.config.yml file in the root of the template repository.

### Templating language

Within the templates that are rendered there a some (hidden) powerful features / filters that might be of use.

#### Sort

Sort takes in a slice or a map and sort this based on a key. Start with `-` in order to sort in ascending order.
```
{{slice|sort}}
{{slice|sort:"filters.key"}}
{{slice|sort:"-filters.key"}}
```


Expand Down

0 comments on commit 5dd66d3

Please sign in to comment.