Skip to content

Commit

Permalink
Document
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed Aug 25, 2023
1 parent a675f49 commit 8870d73
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,35 @@ const blogSubmissions = await client.blogSubmissions(blogName, options);

### Post Methods

#### Create a post with `createPost`

```js
// Create or reblog a post
await client.createPost(blogName, options);
```

To upload media with a created post, provide a `ReadStream` as the block media:

```js
await client.createPost(blogName, {
content: [
{
type: 'image',
media: createReadStream(new URL('./image.jpg', import.meta.url)),
alt_text: '',
},
],
});
```
#### Create a post with `editPost`
// Edit a post
```js
await client.editPost(blogName, postId, options);
```
// Delete a given post
#### Create a post with `deletePost`
```js
await client.deletePost(blogName, postId);
```
Expand Down Expand Up @@ -241,3 +262,7 @@ http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied. See the License for the specific language governing permissions and limitations.
```

```

0 comments on commit 8870d73

Please sign in to comment.