Skip to content

sendsay-ru/sendsay-docs

Repository files navigation

Netlify Status

Links

List of changes in swizzled components


Working with articles

Edititng article with GitHub interface

  1. add ?edit=true to the URL on any page you want to edit
  2. scroll to the bottom of the article to see Edit this page link

Adding a month update page

  1. add a new file with .mdx extension to the /docs/updates/list, sidebar_position should be in NEGATIVE REVERSE order (where -1 is January and -12 is December)

  2. change import in the root file docs/updates/index.mdx to a new article

import ChangeLog from './updates-may-2023.mdx';`
  1. (optional) create previous year folder and move pages from past year -> add _category_.json file with position in REVERSE order (where "position": 1000 is for 2023)
{
   "label": "2023",
   "position": 999
}

How to restrict access to an article or category:

  1. add restrictedAccessHref custom prop in _category_.json or article header
    value should be uniq across all docs
  2. add full route to config/restrictedAccessRoutes.json
    to exclude it from search
  3. add lines into static/robots.txt
User-agent: *
Disallow: /automations/automations-by-event/welcome-series/

How to translate a new article

There is a couple of pathes for each translated file:

Name Pattern Usage
Actual shorten url /folder-path/file-name i18n/
Actual full url /en/folder-path/file-name config/
Sidebar file id en/shorten-folder-path/en-file-name sidebars.js

Notice:

Despite of the fact that we omit excessive folders for en locale in sidebar, we must keep the path full:

Name Pattern Usage
url /en/other-channels/sms/how-to-connect-url
folder-path other-channels/sms/how-to-connect-sms ru sidebar
docs/
i18n/
shorten-folder-path other-channels/how-to-connect-sms en sidebar
docs/en/
i18n/**/en/

Steps:

  1. Prepare markdown file with correct translation

  2. Place the file to i18n/en/docusaurus-plugin-content-docs/current/en and create correct header:

---
  id: en-file-name
  slug: /folder-path/file-name      (without en prefix here)
---
  1. Create empty file with same name in docs/en/ (in corresponding to sidebar folder) and create correct header:
---
  id: en-file-name
  draft: true
---
  1. Change corresponding file from i18n/en/docusaurus-plugin-content-docs/current/ that follows 'ru' locale folder structure
---
(delete) hide_title: true
(paste) draft: true
---
  1. Add correct url of the file to config/translatedLinks.json
[
  ...
  "/en/folder-path/file-name"
]
  1. Add the file into sidebars.js to display in sidebar

This doc might help

'docs-en': [
  ...
  {
    'Sidebar folder name': [
      'en/shorten-folder-path/en-file-name'  (no leading slash)
    ],
  },
]