From d02099844eb81ef78011293b50329d9ac53dab87 Mon Sep 17 00:00:00 2001 From: Dmitry Verkhoturov Date: Fri, 23 Feb 2024 01:20:57 +0100 Subject: [PATCH] apply prettier to site files --- site/.prettierignore | 3 + site/.prettierrc | 1 + site/README.md | 4 +- site/src/docs/backup/url-migration/index.md | 2 +- .../docs/configuration/authorization/index.md | 40 +-- site/src/docs/configuration/email/index.md | 14 +- site/src/docs/configuration/frontend/index.md | 48 ++-- site/src/docs/configuration/frontend/spa.md | 1 - .../docs/configuration/parameters/index.md | 20 +- site/src/docs/configuration/telegram/index.md | 7 +- site/src/docs/contributing/api/index.md | 1 + .../getting-started/installation/index.md | 20 +- .../manuals/integration-with-astro/index.md | 137 +++++----- .../manuals/integration-with-gatsby/index.md | 196 +++++++------- .../src/docs/manuals/separate-domain/index.md | 2 +- site/src/docs/manuals/subdomain/index.md | 2 +- site/src/docs/nav.json | 242 +++++++++--------- site/src/pages/index.md | 66 ++--- site/src/pages/redirects.md | 4 +- 19 files changed, 413 insertions(+), 397 deletions(-) create mode 100644 site/.prettierignore diff --git a/site/.prettierignore b/site/.prettierignore new file mode 100644 index 00000000..006399ed --- /dev/null +++ b/site/.prettierignore @@ -0,0 +1,3 @@ +build +public/site.webmanifest +src/docs/configuration/parameters/index.md diff --git a/site/.prettierrc b/site/.prettierrc index 59bb36fc..a50eccd1 100644 --- a/site/.prettierrc +++ b/site/.prettierrc @@ -2,6 +2,7 @@ "semi": false, "singleQuote": true, "arrowParens": "always", + "useTabs": true, "overrides": [ { "files": "*.md", diff --git a/site/README.md b/site/README.md index e415338e..289c1414 100644 --- a/site/README.md +++ b/site/README.md @@ -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 diff --git a/site/src/docs/backup/url-migration/index.md b/site/src/docs/backup/url-migration/index.md index 685effdd..1ce6d0e6 100644 --- a/site/src/docs/backup/url-migration/index.md +++ b/site/src/docs/backup/url-migration/index.md @@ -29,7 +29,7 @@ If running in a docker container, the command becomes (`ADMIN_PASSWD` will be ta docker exec -it remark42 remap -s -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 diff --git a/site/src/docs/configuration/authorization/index.md b/site/src/docs/configuration/authorization/index.md index b862b7c2..a60e0fa9 100644 --- a/site/src/docs/configuration/authorization/index.md +++ b/site/src/docs/configuration/authorization/index.md @@ -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`) @@ -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 diff --git a/site/src/docs/configuration/email/index.md b/site/src/docs/configuration/email/index.md index fff71e44..94c50135 100644 --- a/site/src/docs/configuration/email/index.md +++ b/site/src/docs/configuration/email/index.md @@ -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 , where you are supposed to see the page like the following: diff --git a/site/src/docs/configuration/frontend/index.md b/site/src/docs/configuration/frontend/index.md index 78a72424..2887d083 100644 --- a/site/src/docs/configuration/frontend/index.md +++ b/site/src/docs/configuration/frontend/index.md @@ -27,18 +27,18 @@ Example with all of the params: ```html ``` @@ -92,11 +92,11 @@ Add this snippet to the bottom of web page, or adjust already present `remark_co ```html ``` @@ -119,11 +119,11 @@ Add this snippet to the bottom of web page, or adjust already present `remark_co ```html ``` @@ -135,8 +135,8 @@ And then add a node like this in the place where you want to see a number of com ```html ``` diff --git a/site/src/docs/configuration/frontend/spa.md b/site/src/docs/configuration/frontend/spa.md index ae4c9fc7..4ab4db5a 100644 --- a/site/src/docs/configuration/frontend/spa.md +++ b/site/src/docs/configuration/frontend/spa.md @@ -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 `` diff --git a/site/src/docs/configuration/parameters/index.md b/site/src/docs/configuration/parameters/index.md index ef2ab1cf..bbb2cc86 100644 --- a/site/src/docs/configuration/parameters/index.md +++ b/site/src/docs/configuration/parameters/index.md @@ -13,7 +13,7 @@ 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: @@ -21,14 +21,14 @@ services: 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 @@ -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._ diff --git a/site/src/docs/configuration/telegram/index.md b/site/src/docs/configuration/telegram/index.md index 974bd727..d892cc16 100644 --- a/site/src/docs/configuration/telegram/index.md +++ b/site/src/docs/configuration/telegram/index.md @@ -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 diff --git a/site/src/docs/contributing/api/index.md b/site/src/docs/contributing/api/index.md index 975282d3..b0b5e871 100644 --- a/site/src/docs/contributing/api/index.md +++ b/site/src/docs/contributing/api/index.md @@ -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. +
Response example diff --git a/site/src/docs/getting-started/installation/index.md b/site/src/docs/getting-started/installation/index.md index 8a3323c9..63f385fc 100644 --- a/site/src/docs/getting-started/installation/index.md +++ b/site/src/docs/getting-started/installation/index.md @@ -29,10 +29,10 @@ Add config for Remark on a page of your site ([here](/docs/configuration/fronten ```html ``` @@ -40,10 +40,10 @@ For example: ```html ``` @@ -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= ARCH=`. 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= ARCH=`. This step will produce an executable `remark42` file with everything embedded diff --git a/site/src/docs/manuals/integration-with-astro/index.md b/site/src/docs/manuals/integration-with-astro/index.md index 02aa0a87..9faab97b 100644 --- a/site/src/docs/manuals/integration-with-astro/index.md +++ b/site/src/docs/manuals/integration-with-astro/index.md @@ -10,10 +10,12 @@ While Astro supports numerous front-end framework [integrations](https://docs.astro.build/en/guides/integrations-guide/#official-integrations) (e.g. React, Vue, SolidJS, etc.) - ## w/ Svelte Components + ### Svelte Component (Embedded Frame) + #### remark42-embed.svelte + ```js