Skip to content

Commit c97fe7c

Browse files
committed
updated docs on common props
1 parent 365ece4 commit c97fe7c

File tree

1 file changed

+42
-27
lines changed

1 file changed

+42
-27
lines changed

doc/components.md

Lines changed: 42 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -28,55 +28,70 @@ Once the scripts are loaded, you can use the components as HTML tags:
2828
```html
2929

3030
<!-- Add a comment form -->
31-
<meh-form backend="https://comments.example.com">
31+
<meh-form>
32+
<!-- Add a Mastodon link -->
33+
<meh-mastodon></meh-mastodon>
3234
<!-- Add an admin login button -->
33-
<meh-login backend="https://comments.example.com"></meh-login>
35+
<meh-login></meh-login>
3436
</meh-form>
3537
<!-- Display comments -->
36-
<meh-comments backend="https://comments.example.com">
37-
</meh-comments>
38+
<meh-comments></meh-comments>
3839
```
3940

41+
Of course, you can surround the components with any other HTML you like. The components will be inserted into the page at the location of the tags.
42+
4043
## Common Properties
4144

4245
All Meh components share these common properties:
4346

44-
* `backend`
47+
### `backend`
48+
49+
The URL where your Meh backend is hosted. This should be the base URL of your Meh installation.
50+
51+
```html
52+
<meh-comments backend="https://comments.example.com"></meh-comments>
53+
```
54+
55+
The components should be able to detect this themselves from the script URL, but you can specify it explicitly if needed.
4556

46-
The URL where your Meh backend is hosted. This should be the base URL of your Meh installation. Each of the components will need at least this property to work.
47-
```html
48-
<meh-comments backend="https://comments.example.com"></meh-comments>
49-
```
57+
### `site`
5058

51-
* `site`
59+
The site identifier for multi-site setups. This corresponds to the site name you configured in your Meh installation.
5260

53-
The site identifier for multi-site setups. This corresponds to the site name you configured in your Meh installation.
61+
```html
62+
<meh-comments site="myblog"></meh-comments>
63+
```
5464

55-
```html
56-
<meh-comments site="myblog"></meh-comments>
57-
```
65+
If not specified, it defaults to "meh".
5866

59-
If not specified, it defaults to "meh".
67+
### `post`
6068

61-
* `post`
69+
This specifies which post the comments belong to. It should be a unique identifier for the page, typically the URL path.
6270

63-
* For `meh-comments` and `meh-form`, this specifies which post the comments belong to. It should be a unique identifier for the page, typically the URL path.
71+
```html
72+
<meh-comments post="/blog/2023/my-awesome-post"></meh-comments>
73+
```
74+
75+
If not specified, it defaults to the current page's path. This default should work for most use cases.
76+
77+
### `language`
78+
79+
The language code for translations. Meh supports multiple languages through translation files.
80+
81+
```html
82+
<meh-comments language="de"></meh-comments>
83+
```
6484

65-
```html
66-
<meh-comments post="/blog/2023/my-awesome-post"></meh-comments>
67-
```
85+
If not specified, it defaults to "en" (English).
6886

69-
If not specified, it defaults to the current page's path. This default should work for most use cases.
87+
### `customTranslations`
7088

71-
* `language`
89+
See the [Translations](translations.md) documentation for more information.
7290

73-
The language code for translations. Meh supports multiple languages through translation files.
91+
### `externalStyles`
7492

75-
```html
76-
<meh-comments language="de"></meh-comments>
77-
```
93+
See the [Styling Components](styling.md) documentation for more information.
7894

79-
If not specified, it defaults to "en" (English).
8095

8196
## Complete Example
8297

0 commit comments

Comments
 (0)