Skip to content

Commit

Permalink
add example for listing resource
Browse files Browse the repository at this point in the history
  • Loading branch information
karvounis committed Apr 14, 2022
1 parent 892c5ff commit cfa5f46
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description: |-

The Forem provider provides resources to interact with a Forem API.

In order to use this provider, you must first generate an API key under `settings/account`.
In order to use this provider, you must first generate a Forem **API key** under `Settings -> Account`.

## Example Usage

Expand Down
41 changes: 41 additions & 0 deletions docs/resources/listing.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,48 @@ description: |-
- https://developers.forem.com/api#operation/createListing
- https://developers.forem.com/api#operation/updateListing

## Example Usage

```terraform
locals {
tags = ["golang", "terraform", "forem", "md", "listings"]
}
# Minimum required values set
resource "forem_listing" "example_basic" {
title = "This a basic listing"
body_markdown = "A simple single-line body that is very basic even for a listing..."
}
# Listing generated from a file
resource "forem_listing" "example_file" {
title = "How to create a Listing from a file!"
body_markdown = file("${path.module}/files/example.md")
tags = local.tags
}
# Full Listing example
resource "forem_listing" "example_full" {
title = "My first listing using TF Forem provider!"
action = "publish"
category = "cfp"
expires_at = "09/06/2025"
contact_via_connect = false
location = "Amsterdam"
body_markdown = <<-EOT
This is the markdown for the listing
# First header
- bullet1
- bullet2
- bullet3
- bullet4
EOT
tags = local.tags
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
2 changes: 1 addition & 1 deletion templates/index.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description: |-

The Forem provider provides resources to interact with a Forem API.

In order to use this provider, you must first generate an API key under `settings/account`.
In order to use this provider, you must first generate a Forem **API key** under `Settings -> Account`.

## Example Usage

Expand Down

0 comments on commit cfa5f46

Please sign in to comment.