Skip to content

Commit e1b19e9

Browse files
committed
docs: document placeholder support in the remark42 div (#1990)
Clarify that any content placed inside the `<div id="remark42">` is automatically removed once the iframe signals it has initialised. Update all code examples across getting-started, frontend config, and Astro/Gatsby integration guides to use "Comments loading..." as the placeholder so the feature is visible by default.
1 parent 0105bc2 commit e1b19e9

File tree

4 files changed

+18
-9
lines changed

4 files changed

+18
-9
lines changed

site/src/docs/configuration/frontend/index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ Add following snippet in the place where you want to see Remark42 widget. The co
6666
**Note:** The initialization script should be placed after the code mentioned above.
6767
:::
6868

69+
You can place any placeholder content inside the `remark42` div — it will be automatically removed once the comments widget has loaded. This is useful for showing a loading indicator or message while the widget initialises:
70+
71+
```html
72+
<div id="remark42">Comments loading...</div>
73+
```
74+
6975
If you want to set this up on a Single Page App, see the [appropriate doc page](https://remark42.com/docs/configuration/frontend/spa/).
7076

7177
#### Themes

site/src/docs/getting-started/installation/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,10 @@ After that place the code snippet right after config.
114114
Put the next code snippet on a page of your site where you want to have comments:
115115

116116
```html
117-
<div id="remark42"></div>
117+
<div id="remark42">Comments loading...</div>
118118
```
119119

120-
After that widget will be rendered inside this node.
120+
After that widget will be rendered inside this node. Any content you place inside the div (such as "Comments loading..." above) is automatically removed once the widget initialises, so you can use it as a loading placeholder.
121121

122122
For more information about frontend configuration please [learn about other parameters here](https://remark42.com/docs/configuration/frontend/)
123123
If you want to set this up on a Single Page App, see the [appropriate doc page](https://remark42.com/docs/configuration/frontend/spa/).

site/src/docs/manuals/integration-with-astro/index.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ While Astro supports numerous front-end framework [integrations](https://docs.as
4040
</script>
4141
</svelte:head>
4242

43-
<div id="remark42" />
43+
<div id="remark42">Comments loading...</div>
4444
```
4545
4646
### Astro Layout (Page)
@@ -231,8 +231,9 @@ export function Comments() {
231231
<p>
232232
There are <span className="remark42__counter"></span> comments.
233233
</p>
234-
{/* The div where Remark42 will embed the comments. */}
235-
<div id="remark42"></div>
234+
{/* The div where Remark42 will embed the comments.
235+
Any content inside is automatically removed once the widget loads. */}
236+
<div id="remark42">Comments loading...</div>
236237
</>
237238
)
238239
}

site/src/docs/manuals/integration-with-gatsby/index.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ const Comments = ({ location }) => {
8787
return (
8888
<>
8989
<h2>Comments</h2>
90-
{/* This div is the target for actual comments insertion */}
91-
<div id="remark42"></div>
90+
{/* This div is the target for actual comments insertion.
91+
Any content inside is automatically removed once the widget loads. */}
92+
<div id="remark42">Comments loading...</div>
9293
</>
9394
)
9495
}
@@ -194,8 +195,9 @@ export function Comments({ location }: CommentsProps) {
194195
return (
195196
<Fragment>
196197
<h2>Comments</h2>
197-
{/* This div is the target for actual comments insertion */}
198-
<div id="remark42" />
198+
{/* This div is the target for actual comments insertion.
199+
Any content inside is automatically removed once the widget loads. */}
200+
<div id="remark42">Comments loading...</div>
199201
</Fragment>
200202
)
201203
}

0 commit comments

Comments
 (0)