Skip to content

Commit

Permalink
apply prettier to site files
Browse files Browse the repository at this point in the history
  • Loading branch information
paskal authored and umputun committed Feb 26, 2024
1 parent 6fcfaa1 commit d020998
Show file tree
Hide file tree
Showing 19 changed files with 423 additions and 407 deletions.
3 changes: 3 additions & 0 deletions site/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build
public/site.webmanifest
src/docs/configuration/parameters/index.md
1 change: 1 addition & 0 deletions site/.prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"semi": false,
"singleQuote": true,
"arrowParens": "always",
"useTabs": true,
"overrides": [
{
"files": "*.md",
Expand Down
4 changes: 2 additions & 2 deletions site/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

Requirements:

* [Node.js v20](https://nodejs.org/en/) or higher - install from package or with Homebrew
* Yarn 1.22 or higher - once you have Node.js, run `npm i -g yarn`
- [Node.js v20](https://nodejs.org/en/) or higher - install from package or with Homebrew
- Yarn 1.22 or higher - once you have Node.js, run `npm i -g yarn`

### Development

Expand Down
2 changes: 1 addition & 1 deletion site/src/docs/backup/url-migration/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ If running in a docker container, the command becomes (`ADMIN_PASSWD` will be ta
docker exec -it remark42 remap -s <your site ID> -f var/rules
```

The command above sends a *request* to start the remap job. You can see the job execution logs by running:
The command above sends a _request_ to start the remap job. You can see the job execution logs by running:

```shell
docker logs <container>
Expand Down
40 changes: 20 additions & 20 deletions site/src/docs/configuration/authorization/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,28 +48,28 @@ After completing the previous steps, you can configure the Apple auth provider.
4. In the left Nav pane, choose **"Credentials"**
5. In the center pane, choose the **"OAuth consent screen"** tab.

- Select "**External**" and click "Create"
- Fill in **"App name"** and select **User support email**
- Upload a logo, if you want to
- In the **App Domain** section:
- **Application home page** - your site URL, e.g., `https://mysite.com`
- **Application privacy policy link** - `/web/privacy.html` of your Remark42 installation, e.g. `https://remark42.mysite.com/web/privacy.html` (please check that it works)
- **Terms of service** - leave empty
- **Authorized domains** - your site domain, e.g., `mysite.com`
- **Developer contact information** - add your email, and then click **Save and continue**
- On the **Scopes** tab, just click **Save and continue**
- On the **Test users**, add your email, then click **Save and continue**
- Before going to the next step, set the app to "Production" and send it to verification
- Select "**External**" and click "Create"
- Fill in **"App name"** and select **User support email**
- Upload a logo, if you want to
- In the **App Domain** section:
- **Application home page** - your site URL, e.g., `https://mysite.com`
- **Application privacy policy link** - `/web/privacy.html` of your Remark42 installation, e.g. `https://remark42.mysite.com/web/privacy.html` (please check that it works)
- **Terms of service** - leave empty
- **Authorized domains** - your site domain, e.g., `mysite.com`
- **Developer contact information** - add your email, and then click **Save and continue**
- On the **Scopes** tab, just click **Save and continue**
- On the **Test users**, add your email, then click **Save and continue**
- Before going to the next step, set the app to "Production" and send it to verification

6. In the center pane, choose the **"Credentials"** tab

- Open the **"Create credentials"** drop-down
- Choose **"OAuth client ID"**
- Choose **"Web application"**
- Application **Name** is freeform; choose something appropriate, like "Comments on mysite.com"
- **Authorized JavaScript Origins** should be your domain, e.g., `https://remark42.mysite.com`
- **Authorized redirect URIs** is the location of OAuth2/callback constructed as domain + `/auth/google/callback`, e.g., `https://remark42.mysite.com/auth/google/callback`
- Click **"Create"**
- Open the **"Create credentials"** drop-down
- Choose **"OAuth client ID"**
- Choose **"Web application"**
- Application **Name** is freeform; choose something appropriate, like "Comments on mysite.com"
- **Authorized JavaScript Origins** should be your domain, e.g., `https://remark42.mysite.com`
- **Authorized redirect URIs** is the location of OAuth2/callback constructed as domain + `/auth/google/callback`, e.g., `https://remark42.mysite.com/auth/google/callback`
- Click **"Create"**

7. Take note of the **Client ID** (`AUTH_GOOGLE_CID`) and **Client Secret** (`AUTH_GOOGLE_CSEC`)

Expand Down Expand Up @@ -124,4 +124,4 @@ For more details refer to [Yandex OAuth](https://yandex.com/dev/oauth/doc/dg/con
Optionally, anonymous access can be turned on. In this case, an extra `anonymous` provider will allow logins without any social login with any name satisfying two conditions:

- the name should be at least three characters long
- the name has to start from the letter and contains letters, numbers, underscores and spaces only**
- the name has to start from the letter and contains letters, numbers, underscores and spaces only
14 changes: 7 additions & 7 deletions site/src/docs/configuration/email/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,13 @@ Now we have the following templates:
To replace any template, add the file with the same name to the directory with the remark42 executable file. In case you run Remark42 inside docker-compose, you can put customised templates into a directory like `customised_templates` and then mount it like that:

```yaml
volumes:
- ./var:/srv/var
- ./customised_templates/email_confirmation_login.html.tmpl:/srv/email_confirmation_login.html.tmpl:ro
- ./customised_templates/email_confirmation_subscription.html.tmpl:/srv/email_confirmation_subscription.html.tmpl:ro
- ./customised_templates/email_reply.html.tmpl:/srv/email_reply.html.tmpl:ro
- ./customised_templates/email_unsubscribe.html.tmpl:/srv/email_unsubscribe.html.tmpl:ro
- ./customised_templates/error_response.html.tmpl:/srv/error_response.html.tmpl:ro
volumes:
- ./var:/srv/var
- ./customised_templates/email_confirmation_login.html.tmpl:/srv/email_confirmation_login.html.tmpl:ro
- ./customised_templates/email_confirmation_subscription.html.tmpl:/srv/email_confirmation_subscription.html.tmpl:ro
- ./customised_templates/email_reply.html.tmpl:/srv/email_reply.html.tmpl:ro
- ./customised_templates/email_unsubscribe.html.tmpl:/srv/email_unsubscribe.html.tmpl:ro
- ./customised_templates/error_response.html.tmpl:/srv/error_response.html.tmpl:ro
```

The easiest way to test it is to mount `error_response.html.tmpl`, and then head to <http://127.0.0.1:8080/email/unsubscribe.html>, where you are supposed to see the page like the following:
Expand Down
48 changes: 24 additions & 24 deletions site/src/docs/configuration/frontend/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ Example with all of the params:

```html
<script>
var remark_config = {
host: 'https://remark42.example.com',
site_id: 'my_site',
components: ['embed', 'last-comments']
max_shown_comments: 100,
theme: 'dark',
page_title: 'My custom title for a page',
locale: 'es',
show_email_subscription: false,
simple_view: true,
no_footer: false
}
var remark_config = {
host: 'https://remark42.example.com',
site_id: 'my_site',
components: ['embed', 'last-comments']
max_shown_comments: 100,
theme: 'dark',
page_title: 'My custom title for a page',
locale: 'es',
show_email_subscription: false,
simple_view: true,
no_footer: false
}
</script>
```

Expand Down Expand Up @@ -92,11 +92,11 @@ Add this snippet to the bottom of web page, or adjust already present `remark_co

```html
<script>
var remark_config = {
host: "REMARK_URL",
site_id: "YOUR_SITE_ID",
components: ["last-comments"],
}
var remark_config = {
host: "REMARK_URL",
site_id: "YOUR_SITE_ID",
components: ["last-comments"],
}
</script>
```

Expand All @@ -119,11 +119,11 @@ Add this snippet to the bottom of web page, or adjust already present `remark_co

```html
<script>
var remark_config = {
host: "REMARK_URL",
site_id: "YOUR_SITE_ID",
components: ["counter"],
}
var remark_config = {
host: "REMARK_URL",
site_id: "YOUR_SITE_ID",
components: ["counter"],
}
</script>
```

Expand All @@ -135,8 +135,8 @@ And then add a node like this in the place where you want to see a number of com

```html
<span
class="remark42__counter"
data-url="https://domain.com/path/to/article/"
class="remark42__counter"
data-url="https://domain.com/path/to/article/"
></span>
```

Expand Down
1 change: 0 additions & 1 deletion site/src/docs/configuration/frontend/spa.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

## API for Single-Page Application

Add the following JavaScript to your `index.html`, which in this case, it is identical to `<script defer src="$HOST/web/embed.js"></script>`
Expand Down
20 changes: 10 additions & 10 deletions site/src/docs/configuration/parameters/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ Most of the parameters have sane defaults and don't require customization. There
The minimal `docker-compose.yml` has to include all required parameters:

```yaml
version: '2'
version: "2"

services:
remark42:
image: umputun/remark42:latest
restart: always
container_name: "remark42"
environment:
- REMARK_URL=https://demo.remark42.com # URL pointing to your Remark42 server
- SITE=YOUR_SITE_ID # site ID, same as used for `site_id`, see "Setup on your website"
- SECRET=abcd-123456-xyz-$%^& # secret key
- AUTH_ANON=true # enable anonymous commenting
- AUTH_GITHUB_CID=12345667890 # OAuth2 client ID
- AUTH_GITHUB_CSEC=abcdefg12345678 # OAuth2 client secret
- REMARK_URL=https://demo.remark42.com # URL pointing to your Remark42 server
- SITE=YOUR_SITE_ID # site ID, same as used for `site_id`, see "Setup on your website"
- SECRET=abcd-123456-xyz-$%^& # secret key
- AUTH_ANON=true # enable anonymous commenting
- AUTH_GITHUB_CID=12345667890 # OAuth2 client ID
- AUTH_GITHUB_CSEC=abcdefg12345678 # OAuth2 client secret
volumes:
- ./var:/srv/var # persistent volume to store all Remark42 data
- ./var:/srv/var # persistent volume to store all Remark42 data
```
### Complete parameters list
Expand Down Expand Up @@ -208,7 +208,7 @@ To get a user ID just log in and click on your username or any other user you wa

Two parameters allow customizing the Docker container on the system level:

* `APP_UID` - sets UID to run Remark42 application in container (default=1001)
* `TIME_ZONE` - sets time zone of Remark42 container, would be used only on the backend as comments shown with user's timezone in the web interface (default=America/Chicago)
- `APP_UID` - sets UID to run Remark42 application in container (default=1001)
- `TIME_ZONE` - sets time zone of Remark42 container, would be used only on the backend as comments shown with user's timezone in the web interface (default=America/Chicago)

_See [umputun/baseimage](https://github.com/umputun/baseimage) for more details._
7 changes: 4 additions & 3 deletions site/src/docs/configuration/telegram/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ To integrate notifications about any comment on your sites with remark42 with [T

1. Set `NOTIFY_ADMINS=telegram`
2. Make [a channel](https://telegram.org/faq_channels), **add your bot as Administrator** into it and add channel ID to remark42 configuration as `NOTIFY_TELEGRAM_CHAN`
* "Post messages" permission is enough for bot to be able to post messages in your channel, others are unnecessary;
* To obtain a public channel ID, forward any message from it to [@JsonDumpBot](https://t.me/JsonDumpBot): look for `id` in `forward_from_chat`;
* If you want to use a private channel or chat, use [these instructions](https://github.com/GabrielRF/telegram-id#web-channel-id) to obtain the ID.

- "Post messages" permission is enough for bot to be able to post messages in your channel, others are unnecessary;
- To obtain a public channel ID, forward any message from it to [@JsonDumpBot](https://t.me/JsonDumpBot): look for `id` in `forward_from_chat`;
- If you want to use a private channel or chat, use [these instructions](https://github.com/GabrielRF/telegram-id#web-channel-id) to obtain the ID.

### Notifications for users

Expand Down
1 change: 1 addition & 0 deletions site/src/docs/contributing/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ Streaming API supposed to provide server-sent events for post updates as well as
- `GET /api/v1/stream/last?site=site-id&since=unix_ts_msec` - returns updates stream (`event: last`) with comments for the site, `since` is optional

It was removed in https://github.com/umputun/remark42/pull/826 due to not being used and affecting tests flakiness and could be returned if there will be a developer who would be willing to write frontend support for it.

</details>

<details><summary>Response example</summary>
Expand Down
20 changes: 10 additions & 10 deletions site/src/docs/getting-started/installation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@ Add config for Remark on a page of your site ([here](/docs/configuration/fronten

```html
<script>
var remark_config = {
host: 'REMARK_URL',
site_id: 'YOUR_SITE_ID',
}
var remark_config = {
host: "REMARK_URL",
site_id: "YOUR_SITE_ID",
}
</script>
```

For example:

```html
<script>
var remark_config = {
host: 'https://demo.remark42.com',
site_id: 'remark',
}
var remark_config = {
host: "https://demo.remark42.com",
site_id: "remark",
}
</script>
```

Expand Down Expand Up @@ -76,5 +76,5 @@ To verify if Remark42 has been properly installed, check a demo page at `${REMAR

### Build from the source

* to build Docker container - `make docker`. This command will produce container `umputun/remark42`
* to build a single binary for direct execution - `make OS=<linux|windows|darwin> ARCH=<amd64|386>`. This step will produce an executable `remark42` file with everything embedded
- to build Docker container - `make docker`. This command will produce container `umputun/remark42`
- to build a single binary for direct execution - `make OS=<linux|windows|darwin> ARCH=<amd64|386>`. This step will produce an executable `remark42` file with everything embedded
Loading

0 comments on commit d020998

Please sign in to comment.