mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2025-03-14 09:45:42 +00:00
website: add docs to website (#2080)
* website: add fontmatter & improve image URLs where necessary * website: add docs to website * website: add prismjs for code highlighting * website: change npm install position in web.sh * website: fix an image URL in lang/cs/README.md * website: improve image paths in lang/cs/translations.md * website: add responsiveness & improve stylings of docs * website: add dir to navbar in blog & docs * website: remove scroll in mobile dropdown menu * website: remove rfcs & add guide docs to website * website: remove file renaming script from web.sh * website: add menu to docs in nav * website: add hash list & add scroll to headers * website: customize docs frontmatter through JS * website: remove supported_languages.json * website: move merge_translations.js to JS folder * website: add the following changes to docs - add frontmatter to new doc merged from master - add ignoreForWeb property to frontmatter of README.md docs * website: remove package-lock.json from .gitignore * website: add package-lock.json from .gitignore * website: add no docs message to docs dropdown * website: improve the sidebar of docs * website: add revision date to docs * website: add script to add version to docs frontmatter * website: add layout to display message in docs if its version is old * website: improve nav responsiveness * website: remove frontmatter form main README & rfcs * website: remove rfcs from website folder * website: add ignore condition for rfcs in .eleventy * website: remove frontmatter from lang README docs * website: remove README from website's lang docs * website: add guides menu in nav * website: following changes - add docs_dropdown.json - extend reference menu in nav - remove docs menu from nav * website: fix in docs sidebar * website: revert main docs README.md files * website: revert main docs README.md files * website: move scripts out of js that are for build * website: remove displayAt form guide docs * website: create a docs_sidebar.json & shift to that approach * update navigation * website: set navbar * website: add icons to external links * website: change the approach for docs sidebar creation * website: update docs template * website: add some strings to en.json and map them accordingly * remove icon --------- Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
This commit is contained in:
parent
315d830357
commit
f97a1fcedf
54 changed files with 1321 additions and 94 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -49,8 +49,8 @@ logs/
|
|||
# for website
|
||||
website/node_modules/
|
||||
website/src/blog/
|
||||
website/src/docs/
|
||||
website/translations.json
|
||||
website/src/_data/supported_languages.json
|
||||
website/src/img/images/
|
||||
website/src/images/
|
||||
# Generated files
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
---
|
||||
title: Accessing files in Android app
|
||||
revision: 07.02.2023
|
||||
---
|
||||
|
||||
| 07.02.2023 | EN, [CZ](/docs/lang/cs/ANDROID.md), [FR](/docs/lang/fr/ANDROID.md) |
|
||||
|
||||
# Accessing files in Android app
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
---
|
||||
title: Terminal CLI
|
||||
revision: 31.01.2023
|
||||
---
|
||||
|
||||
| Updated 31.01.2023 | Languages: EN, [FR](/docs/lang/fr/CLI.md), [CZ](/docs/lang/cs/CLI.md) |
|
||||
|
||||
# SimpleX Chat terminal (console) app for Linux/MacOS/Windows
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
---
|
||||
title: Contributing guide
|
||||
revision: 31.01.2023
|
||||
---
|
||||
|
||||
| Updated 31.01.2023 | Languages: EN, [FR](/docs/lang/fr/CONTRIBUTING.md), [CZ](/docs/lang/cs/CONTRIBUTING.md) |
|
||||
|
||||
# Contributing guide
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
---
|
||||
title: Hosting your own SMP Server
|
||||
revision: 31.01.2023
|
||||
---
|
||||
|
||||
| Updated 31.01.2023 | Languages: EN, [FR](/docs/lang/fr/SERVER.md), [CZ](/docs/lang/cs/SERVER.md) |
|
||||
|
||||
# Hosting your own SMP Server
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
---
|
||||
title: SimpleX platform
|
||||
revision: 07.02.2023
|
||||
---
|
||||
|
||||
| Updated 07.02.2023 | Languages: EN, [FR](/docs/lang/fr/SIMPLEX.md), [CZ](/docs/lang/cs/SIMPLEX.md) |
|
||||
# SimpleX platform - motivation and comparison
|
||||
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
---
|
||||
title: Accessing messages in the database
|
||||
revision: 31.01.2023
|
||||
---
|
||||
|
||||
| Updated 31.01.2023 | Languages: EN, [FR](/docs/lang/fr/SQL.md), [CZ](/docs/lang/cs/SQL.md) |
|
||||
|
||||
# Accessing messages in the database
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
---
|
||||
title: Contributing translations to SimpleX Chat
|
||||
revision: 19.03.2023
|
||||
---
|
||||
|
||||
| 19.03.2023 | EN, [CZ](/docs/lang/cs/TRANSLATIONS.md), [FR](/docs/lang/fr/TRANSLATIONS.md) |
|
||||
|
||||
# Contributing translations to SimpleX Chat
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
---
|
||||
title: Using custom WebRTC ICE servers in SimpleX Chat
|
||||
revision: 31.01.2023
|
||||
---
|
||||
|
||||
| Updated 31.01.2023 | Languages: EN, [FR](/docs/lang/fr/WEBRTC.md), [CZ](/docs/lang/cs/WEBRTC.md) |
|
||||
|
||||
# Using custom WebRTC ICE servers in SimpleX Chat
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
title: Hosting your own XFTP Server
|
||||
revision: 21.04.2023
|
||||
---
|
||||
# Hosting your own XFTP Server
|
||||
|
||||
## Overview
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
---
|
||||
title: Quick start
|
||||
---
|
||||
# SimpleX Chat User Guide
|
||||
|
||||
The first messaging platform that has no user identifiers of any kind — 100% private by design.
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
---
|
||||
title: App settings
|
||||
---
|
||||
# App settings
|
||||
|
||||
## Opening the app settings
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
---
|
||||
title: Audio & video Calls
|
||||
---
|
||||
# Audio and Video Calls
|
||||
|
||||
SimpleX Chat allows you to make end-to-end encrypted audio and video calls with your contacts via WebRTC. Note: Group calls are not supported at this time.
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
---
|
||||
title: Chat profiles
|
||||
---
|
||||
# Your chat profiles
|
||||
|
||||
## Creating additional chat profiles
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
---
|
||||
title: Making connections
|
||||
---
|
||||
# Connect to somebody in the chat
|
||||
|
||||
_Work in progress_
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
---
|
||||
title: Managing data
|
||||
---
|
||||
# Managing Your Data
|
||||
|
||||
## Automatic message deletion
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
---
|
||||
title: Privacy & security
|
||||
---
|
||||
# Privacy and Security
|
||||
|
||||
SimpleX Chat default configuration aims to balance privacy, security and convenience. You may want to change the default options.
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
---
|
||||
title: Secret groups
|
||||
---
|
||||
# Secret groups
|
||||
|
||||
Secret groups are anonymous and private, they are designed to be hard to track by outsiders. Every message and file gets sent separately to every member in the group, which makes secret groups only fit for smaller groups.
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
---
|
||||
title: Sending messages
|
||||
---
|
||||
# Sending, editing and deleting messages
|
||||
|
||||
Sending text messages on SimpleX Chat is pretty straightforward, tap on your contact and then tap on text area, type in your message and tap on "Send" button.
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
title: Přístup k souborům v aplikaci Android
|
||||
revision: 07.02.2023
|
||||
---
|
||||
| Aktualizováno 07.02.2023 | Jazyky: CZ, [EN](/docs/ANDROID.md) |
|
||||
|
||||
# Přístup k souborům v aplikaci Android
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
title: SimpleX Chat terminálová
|
||||
revision: 31.01.2023
|
||||
---
|
||||
| Aktualizováno 31.01.2023 | Jazyky: CZ, [EN](/docs/CLI.md), [FR](/docs/lang/fr/CLI.md) |
|
||||
|
||||
# SimpleX Chat terminálová (konzolová) aplikace pro Linux/MacOS/Windows
|
||||
|
@ -174,7 +178,7 @@ Po spuštění chatu budete vyzváni k zadání svého "zobrazovacího jména" a
|
|||
Následující schéma ukazuje, jak se připojit ke kontaktu a poslat mu zprávu:
|
||||
|
||||
<div align="center">
|
||||
<img align="center" src="../images/how-to-use-simplex.svg">
|
||||
<img align="center" src="/images/how-to-use-simplex.svg">
|
||||
</div>
|
||||
|
||||
Po nastavení místního profilu zadejte `/c` (pro `/connect`) pro vytvoření nového spojení a vygenerování pozvánky. Tuto pozvánku odešlete svému kontaktu prostřednictvím jakéhokoli jiného kanálu.
|
||||
|
@ -193,7 +197,7 @@ Seznam dostupných příkazů zobrazíte pomocí `/help` v chatu.
|
|||
|
||||
Skupinu vytvoříte příkazem `/g <group>` a kontakty do ní přidáte příkazem `/a <group> <name>`. Do skupiny pak můžete posílat zprávy zadáním `#<skupina> <zpráva>`. Pro další příkazy použijte `/help groups`.
|
||||
|
||||

|
||||

|
||||
|
||||
> **Upozornění**: skupiny nejsou uloženy na žádném serveru, jsou vedeny jako seznam členů v databázi aplikace, kterým budou zprávy zasílány.
|
||||
|
||||
|
@ -201,7 +205,7 @@ Skupinu vytvoříte příkazem `/g <group>` a kontakty do ní přidáte příkaz
|
|||
|
||||
Soubor můžete odeslat kontaktu pomocí `/f @<contact> <soubor_cesta>` - příjemce jej bude muset před odesláním přijmout. Pro další příkazy použijte `/help files`.
|
||||
|
||||

|
||||

|
||||
|
||||
Soubory můžete posílat skupině pomocí `/f #<skupina> <soubor_cesta>`.
|
||||
|
||||
|
@ -215,7 +219,7 @@ Uživatelská adresa je "dlouhodobá" v tom smyslu, že se jedná o odkaz pro v
|
|||
|
||||
Pro ostatní příkazy použijte `/help address`.
|
||||
|
||||

|
||||

|
||||
|
||||
### Přístup k historii chatu
|
||||
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
title: Průvodce přispíváním
|
||||
revision: 31.01.2023
|
||||
---
|
||||
| Aktualizováno 31.01.2023 | Jazyky: CZ, [EN](/docs/CONTRIBUTING.md), [FR](/docs/lang/fr/CONTRIBUTING.md) |
|
||||
|
||||
# Průvodce přispíváním
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
title: Hostování vlastního serveru SMP
|
||||
revision: 31.01.2023
|
||||
---
|
||||
| Aktualizováno 31.01.2023 | Jazyky: CZ, [EN](/docs/SERVER.md), [FR](/docs/lang/fr/SERVER.md) |
|
||||
|
||||
# Hostování vlastního serveru SMP
|
||||
|
@ -327,4 +331,4 @@ Adresu svého serveru můžete také sdílet se svými přáteli tak, že je nec
|
|||
|
||||
_Upozornění_: pro podporu hesla je třeba mít SMP server verze 4.0. Pokud již máte nasazený server, můžete heslo přidat přidáním do souboru INI serveru.
|
||||
|
||||
<img src="./server_config_1.png" width="288"> <img src="./server_config_2.png" width="288"> <img src="./server_config_3.png" width="288">
|
||||
<img src="/docs/server_config_1.png" width="288"> <img src="/docs/server_config_2.png" width="288"> <img src="/docs/server_config_3.png" width="288">
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
title: Platforma SimpleX
|
||||
revision: 07.02.2023
|
||||
---
|
||||
| Aktualizováno 07.02.2023 | Jazyky: CZ, [EN](/docs/SIMPLEX.md), [FR](/docs/lang/fr/SIMPLEX.md) |
|
||||
|
||||
# Platforma SimpleX - motivace a srovnání
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
title: Přístup ke zprávám v databázi
|
||||
revision: 31.01.2023
|
||||
---
|
||||
| Aktualizováno 31.01.2023 | Jazyky: CZ, [EN](/docs/SQL.md), [FR](/docs/lang/fr/SQL.md) |
|
||||
|
||||
# Přístup ke zprávám v databázi
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
title: Přispívání překladů do SimpleX Chat
|
||||
revision: 07.02.2023
|
||||
---
|
||||
| Aktualizováno 07.02.2023 | Jazyky: CZ, [EN](/docs/TRANSLATIONS.md) |
|
||||
|
||||
# Přispívání překladů do SimpleX Chat
|
||||
|
@ -22,7 +26,7 @@ Tento dokument vznikl proto, abychom tento proces urychlili, a podělili se s v
|
|||
|
||||
2. Některé řetězce není třeba překládat, ale přesto je třeba je překopírovat - v uživatelském rozhraní Weblate je k tomu tlačítko:
|
||||
|
||||
<img src="./images/weblate_1.png" alt="weblate: zkopírovat zdroj do překladu" width="100%">
|
||||
<img src="/docs/images/weblate_1.png" alt="weblate: zkopírovat zdroj do překladu" width="100%">
|
||||
|
||||
3. Weblate má také automatické návrhy, které mohou proces urychlit. Někdy je lze použít tak, jak jsou, jindy je třeba je upravit - kliknutím je použijete v překladu.
|
||||
|
||||
|
@ -30,7 +34,7 @@ Tento dokument vznikl proto, abychom tento proces urychlili, a podělili se s v
|
|||
|
||||
5. Při překladu [aplikace pro iOS](https://hosted.weblate.org/projects/simplex-chat/ios/) je velká část řetězců naprosto stejná - lze je jedním kliknutím překopírovat do sekce glosář. Vizuální nápovědou, že to lze provést, je to, že celý zdrojový řetězec je zvýrazněn žlutě. Mnoho dalších řetězců je velmi podobných, liší se pouze syntaxí interpolace nebo způsobem použití tučného písma - vyžadují minimální úpravy. Existují některé řetězce, které jsou jedinečné pro platformu iOS - ty je třeba přeložit zvlášť.
|
||||
|
||||
<img src="./images/weblate_2.png" alt="weblate: automatické návrhy" width="100%">
|
||||
<img src="/docs/images/weblate_2.png" alt="weblate: automatické návrhy" width="100%">
|
||||
|
||||
## Po dokončení překladu
|
||||
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
title: Použití vlastních serverů WebRTC ICE v SimpleX Chat
|
||||
revision: 31.01.2023
|
||||
---
|
||||
| Aktualizováno 31.01.2023 | Jazyky: CZ, [EN](/docs/WEBRTC.md), [FR](/docs/lang/fr/WEBRTC.md) |
|
||||
|
||||
# Použití vlastních serverů WebRTC ICE v SimpleX Chat
|
||||
|
@ -124,7 +128,7 @@ To je vše - nyní můžete uskutečňovat audio a video hovory prostřednictví
|
|||
|
||||
2. Do části **Sestavit seznam serverů ICE** přidejte:
|
||||
|
||||
<img src="./stun_1.png">.
|
||||
<img src="/docs/stun_1.png">.
|
||||
|
||||
- `STUN: stun:<vaše_ip_nebo_doména>:<port>` a stiskněte `Add STUN`.
|
||||
- `TURN: turn:<vaše_ip_nebo_doména>:<port>`, `Username: <vaše_přihlašovací jméno>`, `Credential: <vaš_pas>` a stiskněte `Add TURN`
|
||||
|
@ -133,10 +137,10 @@ To je vše - nyní můžete uskutečňovat audio a video hovory prostřednictví
|
|||
|
||||
3. Měli byste vidět své servery v sekci **ICE server list**. Pokud je vše správně nastaveno, stiskněte `Start test`:
|
||||
|
||||
<img src="./stun_2.png">
|
||||
<img src="/docs/stun_2.png">
|
||||
|
||||
4. V části **Výsledky** byste měli vidět něco takového:
|
||||
|
||||
<img src="./stun_3.png">
|
||||
<img src="/docs/stun_3.png">
|
||||
|
||||
Pokud výsledky zobrazují kandidáty `srflx` a `relay`, je vše nastaveno správně!
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
title: Accès aux fichiers dans l'application Android
|
||||
revision: 07.02.2023
|
||||
---
|
||||
| 07.02.2023 | FR, [EN](/docs/ANDROID.md), [CZ](/docs/lang/cs/ANDROID.md) |
|
||||
|
||||
# Accès aux fichiers dans l'application Android
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
title: Application de terminal
|
||||
revision: 31.01.2023
|
||||
---
|
||||
| 31.01.2023 | FR, [EN](/docs/CLI.md), [CZ](/docs/lang/cs/CLI.md) |
|
||||
|
||||
# Application de terminal (console) SimpleX Chat pour Linux/MacOS/Windows
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
title: Guide pour contribuer
|
||||
revision: 31.01.2023
|
||||
---
|
||||
| 31.01.2023 | FR, [EN](/docs/CONTRIBUTING.md), [CZ](/docs/lang/cs/CONTRIBUTING.md) |
|
||||
|
||||
# Guide pour contribuer
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
title: Héberger votre propre serveur SMP
|
||||
revision: 31.01.2023
|
||||
---
|
||||
| 31.01.2023 | FR, [EN](/docs/SERVER.md), [CZ](/docs/lang/cs/SERVER.md) |
|
||||
|
||||
# Héberger votre propre serveur SMP
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
title: Plateforme SimpleX
|
||||
revision: 07.02.2023
|
||||
---
|
||||
| 07.02.2023 | FR, [EN](/docs/SIMPLEX.md), [CZ](/docs/lang/cs/SIMPLEX.md) |
|
||||
|
||||
# Plateforme SimpleX - motivation et comparaison
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
title: Accès aux messages de la base de données
|
||||
revision: 31.01.2023
|
||||
---
|
||||
| 31.01.2023 | FR, [EN](/docs/SQL.md), [CZ](/docs/lang/cs/SQL.md) |
|
||||
|
||||
# Accès aux messages de la base de données
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
title: Contribuer aux traductions de SimpleX Chat
|
||||
revision: 19.03.2023
|
||||
---
|
||||
| 19.03.2023 | FR, [EN](/docs/TRANSLATIONS.md), [CZ](/docs/lang/cs/TRANSLATIONS.md) |
|
||||
|
||||
# Contribuer aux traductions de SimpleX Chat
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
title: Utilisation de serveurs WebRTC ICE personnalisés dans SimpleX Chat
|
||||
revision: 31.01.2023
|
||||
---
|
||||
| 31.01.2023 | FR, [EN](/docs/WEBRTC.md), [CZ](/docs/lang/cs/WEBRTC.md) |
|
||||
|
||||
# Utilisation de serveurs WebRTC ICE personnalisés dans SimpleX Chat
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
title: SimpleX Chat Protocol
|
||||
revision: 08.08.2022
|
||||
---
|
||||
DRAFT Revision 0.1, 2022-08-08
|
||||
|
||||
Evgeny Poberezkin
|
||||
|
|
|
@ -15,7 +15,7 @@ const globalConfig = {
|
|||
}
|
||||
|
||||
const translationsDirectoryPath = './langs'
|
||||
const supportedRoutes = ["blog", "contact", "invitation", ""]
|
||||
const supportedRoutes = ["blog", "contact", "invitation", "docs", ""]
|
||||
let supportedLangs = []
|
||||
fs.readdir(translationsDirectoryPath, (err, files) => {
|
||||
if (err) {
|
||||
|
@ -26,7 +26,7 @@ fs.readdir(translationsDirectoryPath, (err, files) => {
|
|||
return file.endsWith('.json') && fs.statSync(translationsDirectoryPath + '/' + file).isFile()
|
||||
})
|
||||
supportedLangs = jsonFileNames.map(file => file.replace('.json', ''))
|
||||
});
|
||||
})
|
||||
|
||||
const translations = require("./translations.json")
|
||||
|
||||
|
@ -40,18 +40,41 @@ module.exports = function (ty) {
|
|||
return "en"
|
||||
})
|
||||
|
||||
ty.addShortcode("getlangRoute", (path) => {
|
||||
const lang = path.split("/")[1]
|
||||
if (supportedRoutes.includes(lang)) return ""
|
||||
if (supportedLangs.includes(lang)) return `/${lang}`
|
||||
return "/en"
|
||||
ty.addFilter("getlang", (path) => {
|
||||
const urlParts = path.split("/")
|
||||
if (urlParts[1] === "docs") {
|
||||
if (urlParts[2] === "lang") {
|
||||
return urlParts[3]
|
||||
}
|
||||
return "en"
|
||||
}
|
||||
else {
|
||||
if (supportedRoutes.includes(urlParts[1])) return "en"
|
||||
else if (supportedLangs.includes(urlParts[1])) return urlParts[1]
|
||||
return "en"
|
||||
}
|
||||
})
|
||||
|
||||
ty.addShortcode("completeRoute", (obj) => {
|
||||
const urlParts = obj.url.split("/")
|
||||
|
||||
if (supportedRoutes.includes(urlParts[1])) {
|
||||
if (urlParts[1] == "blog")
|
||||
return `/blog`
|
||||
|
||||
else if (urlParts[1] === "docs") {
|
||||
if (urlParts[2] === "lang") {
|
||||
if (obj.lang === "en")
|
||||
return `/docs/${urlParts.slice(4).join('/')}`
|
||||
return `/docs/lang/${obj.lang}/${urlParts.slice(4).join('/')}`
|
||||
}
|
||||
else {
|
||||
if (obj.lang === "en")
|
||||
return `${obj.url}`
|
||||
return `/docs/lang/${obj.lang}/${urlParts.slice(2).join('/')}`
|
||||
}
|
||||
}
|
||||
|
||||
else if (obj.lang === "en")
|
||||
return `${obj.url}`
|
||||
return `/${obj.lang}${obj.url}`
|
||||
|
@ -73,7 +96,7 @@ module.exports = function (ty) {
|
|||
'*': 'en'
|
||||
},
|
||||
defaultLocale: 'en',
|
||||
});
|
||||
})
|
||||
|
||||
// Keeps the same directory structure.
|
||||
ty.addPassthroughCopy("src/assets/")
|
||||
|
@ -87,7 +110,10 @@ module.exports = function (ty) {
|
|||
ty.addPassthroughCopy("src/hero-phone")
|
||||
ty.addPassthroughCopy("src/hero-phone-dark")
|
||||
ty.addPassthroughCopy("src/blog/images")
|
||||
supportedLangs.forEach(lang => ty.addPassthroughCopy(`src/${lang}/blog/images`))
|
||||
ty.addPassthroughCopy("src/docs/*.png")
|
||||
ty.addPassthroughCopy("src/docs/images")
|
||||
ty.addPassthroughCopy("src/docs/protocol/diagrams")
|
||||
ty.addPassthroughCopy("src/docs/protocol/*.json")
|
||||
ty.addPassthroughCopy("src/images")
|
||||
ty.addPassthroughCopy("src/CNAME")
|
||||
ty.addPassthroughCopy("src/.well-known")
|
||||
|
@ -96,6 +122,83 @@ module.exports = function (ty) {
|
|||
return collection.getFilteredByGlob('src/blog/*.md').reverse()
|
||||
})
|
||||
|
||||
ty.addCollection('docs', function (collection) {
|
||||
const docs = collection.getFilteredByGlob('src/docs/**/*.md')
|
||||
.map(doc => {
|
||||
return { url: doc.url, title: doc.data.title, inputPath: doc.inputPath }
|
||||
})
|
||||
|
||||
let referenceContent = fs.readFileSync(path.resolve(__dirname, 'src/_data/docs_sidebar.json'), 'utf-8')
|
||||
referenceContent = JSON.parse(referenceContent).items
|
||||
|
||||
const newDocs = []
|
||||
|
||||
referenceContent.forEach(referenceMenu => {
|
||||
referenceMenu.data.forEach(referenceSubmenu => {
|
||||
docs.forEach(doc => {
|
||||
const url = doc.url.replace("/docs/", "")
|
||||
const urlParts = url.split("/")
|
||||
|
||||
if (doc.inputPath.includes(referenceSubmenu)) {
|
||||
if (urlParts.length === 1 && urlParts[0] !== "") {
|
||||
const index = newDocs.findIndex((ele) => ele.lang === 'en' && ele.menu === referenceMenu.menu)
|
||||
if (index !== -1) {
|
||||
newDocs[index].data.push(doc)
|
||||
}
|
||||
else {
|
||||
newDocs.push({
|
||||
lang: 'en',
|
||||
menu: referenceMenu.menu,
|
||||
data: [doc],
|
||||
})
|
||||
}
|
||||
}
|
||||
else if (urlParts.length > 1 && urlParts[0] !== "" && urlParts[0] !== "lang") {
|
||||
const index = newDocs.findIndex((ele) => ele.lang === 'en' && ele.menu === referenceMenu.menu)
|
||||
if (index !== -1) {
|
||||
newDocs[index].data.push(doc)
|
||||
} else {
|
||||
newDocs.push({
|
||||
lang: 'en',
|
||||
menu: referenceMenu.menu,
|
||||
data: [doc],
|
||||
})
|
||||
}
|
||||
}
|
||||
else if (urlParts.length === 3 && urlParts[0] === "lang" && urlParts[2] !== '') {
|
||||
const index = newDocs.findIndex((ele) => ele.lang === urlParts[1] && ele.menu === referenceMenu.menu)
|
||||
if (index !== -1) {
|
||||
newDocs[index].data.push(doc)
|
||||
}
|
||||
else {
|
||||
newDocs.push({
|
||||
lang: urlParts[1],
|
||||
menu: referenceMenu.menu,
|
||||
data: [doc],
|
||||
})
|
||||
}
|
||||
}
|
||||
else if (urlParts.length > 3 && urlParts[0] === "lang" && urlParts[2] !== '') {
|
||||
const index = newDocs.findIndex((ele) => ele.lang === urlParts[1] && ele.menu === referenceMenu.menu)
|
||||
if (index !== -1) {
|
||||
newDocs[index].data.push(doc)
|
||||
}
|
||||
else {
|
||||
newDocs.push({
|
||||
lang: urlParts[1],
|
||||
menu: referenceMenu.menu,
|
||||
data: [doc],
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
return newDocs
|
||||
})
|
||||
|
||||
ty.addWatchTarget("src/css")
|
||||
ty.addWatchTarget("markdown/")
|
||||
ty.addWatchTarget("components/Card.js")
|
||||
|
|
90
website/customize_docs_frontmatter.js
Normal file
90
website/customize_docs_frontmatter.js
Normal file
|
@ -0,0 +1,90 @@
|
|||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const matter = require('gray-matter');
|
||||
|
||||
const directoryPath = path.resolve(__dirname, 'src/docs');
|
||||
const langFolder = 'lang';
|
||||
const enFiles = {};
|
||||
|
||||
function traverseDirectory(directory, currentLanguage = 'en', result = {}, callback) {
|
||||
const filesAndDirectories = fs.readdirSync(directory);
|
||||
|
||||
filesAndDirectories.forEach((fileOrDirectoryName) => {
|
||||
const fullPath = path.join(directory, fileOrDirectoryName);
|
||||
|
||||
if (fs.statSync(fullPath).isDirectory()) {
|
||||
// If the subdirectory is inside the 'lang' folder, update the current language
|
||||
if (directory.endsWith('/lang')) {
|
||||
currentLanguage = fileOrDirectoryName;
|
||||
}
|
||||
|
||||
// Recursively traverse the subdirectories
|
||||
traverseDirectory(fullPath, currentLanguage, result, callback);
|
||||
} else {
|
||||
// Process the file only if it has the '.md' extension
|
||||
if (path.extname(fullPath) === '.md') {
|
||||
// Add the language to the file's language array or create a new array if it doesn't exist
|
||||
const fileName = path.basename(fullPath, '.md');
|
||||
if (!result[fileName]) {
|
||||
result[fileName] = [];
|
||||
}
|
||||
result[fileName].push(currentLanguage);
|
||||
}
|
||||
if (callback) {
|
||||
callback(fullPath, currentLanguage);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
const fileLanguageMapping = traverseDirectory(directoryPath);
|
||||
|
||||
// Update the frontmatter of each Markdown file
|
||||
Object.entries(fileLanguageMapping).forEach(([fileName, languages]) => {
|
||||
// Find and update the frontmatter of each Markdown file
|
||||
traverseDirectory(directoryPath, null, {}, (fullPath, currentLanguage) => {
|
||||
if (path.basename(fullPath) === `${fileName}.md`) {
|
||||
// Read the existing frontmatter
|
||||
const fileContent = fs.readFileSync(fullPath, 'utf-8');
|
||||
const parsedMatter = matter(fileContent);
|
||||
const relativePath = path.relative(directoryPath, fullPath);
|
||||
|
||||
// Calculate the permalink based on the file's location
|
||||
const linkPath = path.relative(directoryPath, fullPath).replace(/\.md$/, '.html');
|
||||
const permalink = `/docs/${linkPath}`.toLowerCase();
|
||||
parsedMatter.data.permalink = permalink;
|
||||
|
||||
// Update the frontmatter with the new languages list
|
||||
parsedMatter.data.supportedLangsForDoc = languages;
|
||||
|
||||
// Add the layout value
|
||||
parsedMatter.data.layout = 'layouts/doc.html';
|
||||
|
||||
if (fullPath.startsWith(path.join(directoryPath, langFolder))) {
|
||||
// Non-English files
|
||||
const [language, ...rest] = relativePath.split(path.sep).slice(1);
|
||||
const enFilePath = path.join(directoryPath, ...rest);
|
||||
|
||||
if (enFiles[enFilePath]) {
|
||||
const enRevision = new Date(enFiles[enFilePath].revision);
|
||||
const currentRevision = new Date(parsedMatter.data.revision);
|
||||
|
||||
const isOld = currentRevision < enRevision;
|
||||
// Add the version value
|
||||
parsedMatter.data.version = isOld ? 'old' : 'new';
|
||||
}
|
||||
} else {
|
||||
// English files
|
||||
enFiles[fullPath] = { revision: parsedMatter.data.revision };
|
||||
// Add the version value
|
||||
parsedMatter.data.version = 'new';
|
||||
}
|
||||
|
||||
// Save the updated frontmatter and content back to the file
|
||||
const updatedFileContent = matter.stringify(parsedMatter.content, parsedMatter.data);
|
||||
fs.writeFileSync(fullPath, updatedFileContent, 'utf-8');
|
||||
}
|
||||
});
|
||||
});
|
|
@ -209,5 +209,27 @@
|
|||
"comparison-section-list-point-5": "Does not protect users' metadata",
|
||||
"comparison-section-list-point-6": "While P2P are distributed, they are not federated - they operate as a single network",
|
||||
"comparison-section-list-point-7": "P2P networks either have a central authority or the whole network can be compromised",
|
||||
"see-here": "see here"
|
||||
"see-here": "see here",
|
||||
"guide-dropdown-1": "Quick start",
|
||||
"guide-dropdown-2": "Sending messages",
|
||||
"guide-dropdown-3": "Secret groups",
|
||||
"guide-dropdown-4": "Chat profiles",
|
||||
"guide-dropdown-5": "Managing data",
|
||||
"guide-dropdown-6": "Audio & video Calls",
|
||||
"guide-dropdown-7": "Privacy & security",
|
||||
"guide-dropdown-8": "App settings",
|
||||
"guide-dropdown-9": "Making connections",
|
||||
"guide": "Guide",
|
||||
"docs-dropdown-1": "SimpleX platform",
|
||||
"docs-dropdown-2": "Accessing Android files",
|
||||
"docs-dropdown-3": "Accessing chat database",
|
||||
"docs-dropdown-4": "Host SMP Server",
|
||||
"docs-dropdown-5": "Host XFTP Server",
|
||||
"docs-dropdown-6": "WebRTC servers",
|
||||
"docs-dropdown-7": "Translate SimpleX Chat",
|
||||
"newer-version-of-eng-msg": "There is a newer version of this page in English.",
|
||||
"click-to-see": "Click to see",
|
||||
"menu": "Menu",
|
||||
"on-this-page": "On this page",
|
||||
"back-to-top": "Back to top"
|
||||
}
|
|
@ -9,11 +9,11 @@ const jsonFileNames = files.filter(file => file.endsWith('.json'));
|
|||
supportedLangs = jsonFileNames.map(file => file.replace('.json', ''))
|
||||
|
||||
// keys of the english language are used as the base keys
|
||||
const enStrings = require("./langs/en.json")
|
||||
const enStrings = require(path.resolve(__dirname, "langs/en.json"))
|
||||
|
||||
const languages = {}
|
||||
for (const lang of supportedLangs) {
|
||||
languages[lang] = require(`./langs/${lang}.json`)
|
||||
languages[lang] = require(path.resolve(__dirname, `langs/${lang}.json`))
|
||||
}
|
||||
|
||||
// this program generates a combined translations.json file
|
||||
|
@ -27,9 +27,7 @@ for (const key in enStrings) {
|
|||
translations[key] = langStrings
|
||||
}
|
||||
|
||||
saveFile("translations.json", translations)
|
||||
// the list in the supported_languages.json file is used as the reference list for displaying available languages on the frontend
|
||||
saveFile("src/_data/supported_languages.json", {"langs": supportedLangs})
|
||||
saveFile(path.resolve(__dirname, "translations.json"), translations)
|
||||
|
||||
function saveFile(relPath, data) {
|
||||
filePath = path.resolve(__dirname, relPath)
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
"tailwindcss": "^3.2.7"
|
||||
},
|
||||
"dependencies": {
|
||||
"eleventy-plugin-i18n": "^0.1.3"
|
||||
"eleventy-plugin-i18n": "^0.1.3",
|
||||
"gray-matter": "^4.0.3"
|
||||
}
|
||||
}
|
||||
|
|
32
website/src/_data/docs_dropdown.json
Normal file
32
website/src/_data/docs_dropdown.json
Normal file
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"items": [
|
||||
{
|
||||
"title": "docs-dropdown-1",
|
||||
"url": "/docs/simplex.html"
|
||||
},
|
||||
{
|
||||
"title": "docs-dropdown-2",
|
||||
"url": "/docs/android.html"
|
||||
},
|
||||
{
|
||||
"title": "docs-dropdown-3",
|
||||
"url": "/docs/sql.html"
|
||||
},
|
||||
{
|
||||
"title": "docs-dropdown-4",
|
||||
"url": "/docs/server.html"
|
||||
},
|
||||
{
|
||||
"title": "docs-dropdown-5",
|
||||
"url": "/docs/xftp-server.html"
|
||||
},
|
||||
{
|
||||
"title": "docs-dropdown-6",
|
||||
"url": "/docs/webrtc.html"
|
||||
},
|
||||
{
|
||||
"title": "docs-dropdown-7",
|
||||
"url": "/docs/translations.html"
|
||||
}
|
||||
]
|
||||
}
|
38
website/src/_data/docs_sidebar.json
Normal file
38
website/src/_data/docs_sidebar.json
Normal file
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
"items": [
|
||||
{
|
||||
"menu": "Guide",
|
||||
"data": [
|
||||
"README.md",
|
||||
"send-messages.md",
|
||||
"secret-groups.md",
|
||||
"chat-profiles.md",
|
||||
"managing-data.md",
|
||||
"audio-video-calls.md",
|
||||
"privacy-security.md",
|
||||
"app-settings.md",
|
||||
"making-connections.md"
|
||||
]
|
||||
},
|
||||
{
|
||||
"menu": "Reference",
|
||||
"data": [
|
||||
"SIMPLEX.md",
|
||||
"ANDROID.md",
|
||||
"CLI.md",
|
||||
"SQL.md",
|
||||
"CONTRIBUTING.md",
|
||||
"SERVER.md",
|
||||
"TRANSLATIONS.md",
|
||||
"WEBRTC.md",
|
||||
"XFTP-SERVER.md"
|
||||
]
|
||||
},
|
||||
{
|
||||
"menu": "Protocol",
|
||||
"data": [
|
||||
"simplex-chat.md"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
40
website/src/_data/guide_dropdown.json
Normal file
40
website/src/_data/guide_dropdown.json
Normal file
|
@ -0,0 +1,40 @@
|
|||
{
|
||||
"items": [
|
||||
{
|
||||
"title": "guide-dropdown-1",
|
||||
"url": "/docs/guide/readme.html"
|
||||
},
|
||||
{
|
||||
"title": "guide-dropdown-2",
|
||||
"url": "/docs/guide/send-messages.html"
|
||||
},
|
||||
{
|
||||
"title": "guide-dropdown-3",
|
||||
"url": "/docs/guide/secret-groups.html"
|
||||
},
|
||||
{
|
||||
"title": "guide-dropdown-4",
|
||||
"url": "/docs/guide/chat-profiles.html"
|
||||
},
|
||||
{
|
||||
"title": "guide-dropdown-5",
|
||||
"url": "/docs/guide/managing-data.html"
|
||||
},
|
||||
{
|
||||
"title": "guide-dropdown-6",
|
||||
"url": "/docs/guide/audio-video-calls.html"
|
||||
},
|
||||
{
|
||||
"title": "guide-dropdown-7",
|
||||
"url": "/docs/guide/privacy-security.html"
|
||||
},
|
||||
{
|
||||
"title": "guide-dropdown-8",
|
||||
"url": "/docs/guide/app-settings.html"
|
||||
},
|
||||
{
|
||||
"title": "guide-dropdown-9",
|
||||
"url": "/docs/guide/making-connections.html"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,38 +1,51 @@
|
|||
{% set lang = page.url | getlang %}
|
||||
<section class="bg-[#D9E7ED] dark:bg-[#0E2B57] py-[50px]">
|
||||
<div class="container">
|
||||
<div class="flex flex-col lg:flex-row justify-between">
|
||||
<div class="flex flex-col items-center lg:items-start">
|
||||
<a href="{% getlangRoute page.url %}/" class="h-full mb-14 dark:hidden"><img class="w-auto h-[32px]" src="/img/new/logo-light.png" alt="logo" /></a>
|
||||
<a href="{% getlangRoute page.url %}/" class="h-full mb-14 hidden dark:inline-block"><img class="w-auto h-[32px]" src="/img/new/logo-dark.png" alt="logo" /></a>
|
||||
<a href="/{{ '' if lang == 'en' else lang }}" class="h-full mb-14 dark:hidden"><img class="w-auto h-[32px]" src="/img/new/logo-light.png" alt="logo" /></a>
|
||||
<a href="/{{ '' if lang == 'en' else lang }}" class="h-full mb-14 hidden dark:inline-block"><img class="w-auto h-[32px]" src="/img/new/logo-dark.png" alt="logo" /></a>
|
||||
|
||||
<div class="flex flex-col items-center lg:items-start lg:flex-row gap-[150px] lg:gap-[350px]">
|
||||
<div class="flex flex-col items-center lg:items-start">
|
||||
<a href="https://github.com/simplex-chat/simplexmq/blob/stable/protocol/overview-tjr.md"
|
||||
target="_blank"
|
||||
class="text-grey-black dark:text-white text-[14px] font-medium leading-[28px] tracking-[0.01em] mb-3">
|
||||
SimpleX Whitepaper</a>
|
||||
class="text-grey-black dark:text-white text-[14px] font-medium leading-[28px] tracking-[0.01em] mb-3 flex items-center gap-1">
|
||||
SimpleX Whitepaper
|
||||
<svg class="float-right" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg>
|
||||
</a>
|
||||
<a href="https://github.com/simplex-chat/simplex-chat/blob/stable/docs/protocol/simplex-chat.md"
|
||||
target="_blank"
|
||||
class="text-grey-black dark:text-white text-[14px] font-medium leading-[28px] tracking-[0.01em] mb-3">
|
||||
{{ "simplex-chat-protocol" | i18n({}, lang ) | safe }}</a>
|
||||
class="text-grey-black dark:text-white text-[14px] font-medium leading-[28px] tracking-[0.01em] mb-3 flex items-center gap-1">
|
||||
{{ "simplex-chat-protocol" | i18n({}, lang ) | safe }}
|
||||
<svg class="float-right" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg>
|
||||
</a>
|
||||
<a href="https://github.com/simplex-chat/simplex-chat/blob/stable/PRIVACY.md"
|
||||
target="_blank"
|
||||
class="text-grey-black dark:text-white text-[14px] font-medium leading-[28px] tracking-[0.01em] mb-3">
|
||||
{{ "terms-and-privacy-policy" | i18n({}, lang ) | safe }}</a>
|
||||
class="text-grey-black dark:text-white text-[14px] font-medium leading-[28px] tracking-[0.01em] mb-3 flex items-center gap-1">
|
||||
{{ "terms-and-privacy-policy" | i18n({}, lang ) | safe }}
|
||||
<svg class="float-right" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg>
|
||||
</a>
|
||||
<a href="https://github.com/simplex-chat/simplex-chat#help-us-with-donations"
|
||||
target="_blank"
|
||||
class="text-grey-black dark:text-white text-[14px] font-medium leading-[28px] tracking-[0.01em] mb-3">
|
||||
{{ "donate" | i18n({}, lang ) | safe }}</a>
|
||||
class="text-grey-black dark:text-white text-[14px] font-medium leading-[28px] tracking-[0.01em] mb-3 flex items-center gap-1">
|
||||
{{ "donate" | i18n({}, lang ) | safe }}
|
||||
<svg class="float-right" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg>
|
||||
</a>
|
||||
</div>
|
||||
<div class="flex flex-col items-center lg:items-start">
|
||||
<a href="https://github.com/simplex-chat/simplex-chat/blob/stable/docs/CLI.md"
|
||||
target="_blank"
|
||||
class="text-grey-black dark:text-white text-[14px] font-medium leading-[28px] tracking-[0.01em] mb-3">
|
||||
{{ "terminal-cli" | i18n({}, lang ) | safe }}</a>
|
||||
class="text-grey-black dark:text-white text-[14px] font-medium leading-[28px] tracking-[0.01em] mb-3 flex items-center gap-1">
|
||||
{{ "terminal-cli" | i18n({}, lang ) | safe }}
|
||||
<svg class="float-right" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg>
|
||||
</a>
|
||||
<a href="https://github.com/simplex-chat/simplex-chat/tree/stable/packages/simplex-chat-client/typescript"
|
||||
target="_blank"
|
||||
class="text-grey-black dark:text-white text-[14px] font-medium leading-[28px] tracking-[0.01em] mb-3">
|
||||
TypeScript SDK</a>
|
||||
class="text-grey-black dark:text-white text-[14px] font-medium leading-[28px] tracking-[0.01em] mb-3 flex items-center gap-1">
|
||||
TypeScript SDK
|
||||
<svg class="float-right" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
<link rel="icon" type="image/png" sizes="96x96" href="/img/favicon.ico" />
|
||||
<link href="/css/tailwind.css" rel="stylesheet" />
|
||||
<link rel="stylesheet" href="/css/blog.css" />
|
||||
<link rel="stylesheet" href="/css/prism.min.css"/>
|
||||
<link href="/css/style.css" rel="stylesheet" />
|
||||
<script async defer src="https://buttons.github.io/buttons.js"></script>
|
||||
</head>
|
||||
|
@ -41,6 +42,7 @@
|
|||
</section>
|
||||
|
||||
{% include "footer.html" %}
|
||||
<script src="/js/prism.min.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
123
website/src/_includes/layouts/doc.html
Normal file
123
website/src/_includes/layouts/doc.html
Normal file
|
@ -0,0 +1,123 @@
|
|||
{% set lang = page.url | getlang %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ page.url | getlang }}"
|
||||
{% for language in languages.languages %}
|
||||
{% if language.label == page.url | getlang %}
|
||||
dir="{{ "rtl" if language.rtl else "ltr" }}"
|
||||
{% endif %}
|
||||
{% endfor %}>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{{ title }}</title>
|
||||
<meta name="Content-Type" content="text/html;charset=utf-8"/>
|
||||
|
||||
<link rel="icon" type="image/png" sizes="96x96" href="/img/favicon.ico"/>
|
||||
<link href="/css/tailwind.css" rel="stylesheet"/>
|
||||
<link rel="stylesheet" href="/css/prism.min.css"/>
|
||||
<link href="/css/style.css" rel="stylesheet"/>
|
||||
<link rel="stylesheet" href="/css/doc.css"/>
|
||||
<script async defer src="https://buttons.github.io/buttons.js"></script>
|
||||
</head>
|
||||
|
||||
<body class="bg-[#F3F6F7] dark:bg-[#0C0B13]">
|
||||
<section class="w-full bg-transparent fixed top-0 z-50">
|
||||
{% include "navbar.html" %}
|
||||
</section>
|
||||
|
||||
<section id="doc" class="bg-white dark:bg-[#17203D] mt-[66px]">
|
||||
<div>
|
||||
<main>
|
||||
<aside class="sidebar px-4 lg:px-7">
|
||||
<div class="h-[66px] lg:h-0">
|
||||
<a href="/{{ '' if lang == 'en' else lang }}" class="h-full flex dark:hidden lg:hidden items-center ltr:mr-auto rtl:ml-auto"><img class="w-auto max-h-[50px] pr-10" src="/img/new/logo-light.png" alt="logo"/></a>
|
||||
<a href="/{{ '' if lang == 'en' else lang }}" class="h-full hidden dark:flex dark:lg:hidden items-center ltr:mr-auto rtl:ml-auto"><img class="w-auto max-h-[50px] pr-10" src="/img/new/logo-dark.png" alt="logo"/></a>
|
||||
</div>
|
||||
<ul class="!my-4">
|
||||
{% for doc in collections.docs %}
|
||||
{% set hasMenu = false %}
|
||||
{% for checkDoc in collections.docs %}
|
||||
{% if checkDoc.lang == lang and checkDoc.menu == doc.menu %}
|
||||
{% set hasMenu = true %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if hasMenu %}
|
||||
{% if doc.lang == page.url | getlang %}
|
||||
<p class="">{{ doc.menu | capitalize }}</p>
|
||||
<ul>
|
||||
{% for submenu in doc.data %}
|
||||
<li>
|
||||
<a class="{{ "active" if page.url == submenu.url | url else '' }}" href="{{ submenu.url | url }}">{{ submenu.title }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<p class="">{{ doc.menu | capitalize }}</p>
|
||||
<ul>
|
||||
{% for submenu in doc.data %}
|
||||
<li>
|
||||
<a class="{{ "active" if page.url == submenu.url | url else '' }}" href="{{ submenu.url | url }}">{{ submenu.title }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</aside>
|
||||
<article class="content px-4 lg:px-7">
|
||||
|
||||
{% if version == 'old' %}
|
||||
<div class="px-4 lg:px-7 !py-2">
|
||||
<div class="bg-yellow-200 px-4 lg:px-7 py-6 rounded-md">
|
||||
{{ "newer-version-of-eng-msg" | i18n({}, lang ) | safe }} <a class="!no-underline !text-primary-pressed-light" href="{% completeRoute {url:page.url,lang:'en'} %}">{{ "click-to-see" | i18n({}, lang ) | safe }}</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="sticky top-[66px] bg-white dark:bg-[#17203D] z-[49] !py-2 lg:hidden">
|
||||
<div class="relative flex items-center justify-between">
|
||||
<button class="menu flex items-center gap-2">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewBox="0 0 24 24" class="menu-icon h-4 w-4 fill-[rgb(60,60,60)] dark:fill-white">
|
||||
<path d="M17,11H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h14c0.6,0,1,0.4,1,1S17.6,11,17,11z"></path>
|
||||
<path d="M21,7H3C2.4,7,2,6.6,2,6s0.4-1,1-1h18c0.6,0,1,0.4,1,1S21.6,7,21,7z"></path>
|
||||
<path d="M21,15H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h18c0.6,0,1,0.4,1,1S21.6,15,21,15z"></path>
|
||||
<path d="M17,19H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h14c0.6,0,1,0.4,1,1S17.6,19,17,19z"></path>
|
||||
</svg>
|
||||
<span class="!text-[rgb(60,60,60)] dark:!text-white">{{ "menu" | i18n({}, lang ) | safe }}</span>
|
||||
</button>
|
||||
|
||||
<div class="nav-link">
|
||||
<a href="javascript:void(0);" class="flex items-center gap-2 !no-underline !text-[rgb(60,60,60)] dark:!text-white">
|
||||
<span class="">{{ "on-this-page" | i18n({}, lang ) | safe }}</span>
|
||||
<span href="" id="btn-mobile" class="flex items-center justify-center h-auto w-auto mt-1">
|
||||
<svg class="fill-black dark:fill-white" width="10" height="6" viewBox="0 0 10 6" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M1.50447 0.902966C1.21571 0.627397 0.747525 0.627397 0.458761 0.902966C0.169996 1.17853 0.169996 1.62532 0.458761 1.90089L4.21933 5.48961C4.25543 5.52406 4.29433 5.5542 4.33533 5.58003C4.62234 5.76088 5.01237 5.73074 5.26504 5.48961L9.02561 1.90089C9.31438 1.62532 9.31438 1.17853 9.02561 0.902966C8.73685 0.627397 8.26867 0.627397 7.97991 0.902966L4.74219 3.99273L1.50447 0.902966Z"/>
|
||||
</svg>
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<ul class="flex flex-col items-start gap-2 absolute bg-white dark:bg-black top-full left-0 right-0 mt-[10px] w-full h-auto rounded-md shadow-[0_0_3px_rgb(60_72_88_/_15%)] sub-menu hash-list">
|
||||
<li class="mb-5">
|
||||
<a href="#" id="back-to-top">{{ "back-to-top" | i18n({}, lang ) | safe }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>{{ content | safe }}</div>
|
||||
</article>
|
||||
</main>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{% include "footer.html" %}
|
||||
|
||||
<script src="/js/docs.js"></script>
|
||||
<script src="/js/prism.min.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -1,16 +1,24 @@
|
|||
{% set lang = page.url | getlang %}
|
||||
{% set langName = "aaa" %}
|
||||
{% for language in languages.languages %}
|
||||
{% if language.label == page.url | getlang %}
|
||||
{% set langName = language.name %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
<header class="">
|
||||
<div class="flex items-center flex-row justify-end m-auto px-4 lg:px-7 h-[66px]">
|
||||
<a href="{% getlangRoute page.url %}/" class="h-full hidden dark:hidden lg:flex items-center ltr:mr-auto rtl:ml-auto"><img class="w-auto max-h-[50px] pr-10" src="/img/new/logo-light.png" alt="logo" /></a>
|
||||
<a href="{% getlangRoute page.url %}/" class="h-full hidden dark:lg:flex items-center ltr:mr-auto rtl:ml-auto"><img class="w-auto max-h-[50px] pr-10" src="/img/new/logo-dark.png" alt="logo" /></a>
|
||||
<a href="{% getlangRoute page.url %}/" class="dark:hidden lg:hidden ltr:mr-auto rtl:ml-auto"><img class="h-[32px]" src="/img/new/logo-symbol-light.svg" alt="" srcset=""></a>
|
||||
<a href="{% getlangRoute page.url %}/" class="hidden dark:inline-block dark:lg:hidden lg:hidden ltr:mr-auto rtl:ml-auto"><img class="h-[32px]" src="/img/new/logo-symbol-dark.svg" alt="" srcset=""></a>
|
||||
<a href="/{{ '' if lang == 'en' else lang }}" class="h-full hidden dark:hidden lg:flex items-center ltr:mr-auto rtl:ml-auto"><img class="w-auto max-h-[50px] pr-10" src="/img/new/logo-light.png" alt="logo" /></a>
|
||||
<a href="/{{ '' if lang == 'en' else lang }}" class="h-full hidden dark:lg:flex items-center ltr:mr-auto rtl:ml-auto"><img class="w-auto max-h-[50px] pr-10" src="/img/new/logo-dark.png" alt="logo" /></a>
|
||||
<a href="/{{ '' if lang == 'en' else lang }}" class="dark:hidden lg:hidden ltr:mr-auto rtl:ml-auto"><img class="h-[32px]" src="/img/new/logo-symbol-light.svg" alt="" srcset=""></a>
|
||||
<a href="/{{ '' if lang == 'en' else lang }}" class="hidden dark:inline-block dark:lg:hidden lg:hidden ltr:mr-auto rtl:ml-auto"><img class="h-[32px]" src="/img/new/logo-symbol-dark.svg" alt="" srcset=""></a>
|
||||
|
||||
<nav class="bg-[#F0F1F2] dark:bg-gradient-radial-mobile dark:lg:bg-none lg:bg-transparent fixed top-[66px] left-0 right-0 bottom-0 lg:top-0 lg:relative" id="menu">
|
||||
<div class="flex flex-col lg:flex-row justify-between lg:items-center gap-5 xl:gap-10 px-4 lg:px-0 h-full">
|
||||
<div class="flex flex-col lg:flex-row justify-between lg:items-center gap-5 xl:gap-10 px-4 lg:px-0 h-full">
|
||||
<ul class="flex flex-col lg:flex-row lg:items-center gap-3 py-4 lg:py-0 lg:gap-5 xl:gap-8">
|
||||
|
||||
<li class="nav-link relative {% if active_home %}active{% endif %}">
|
||||
<a href="{% getlangRoute page.url %}/" class="flex items-center justify-between gap-2 lg:py-5 ">
|
||||
<a href="/{{ '' if lang == 'en' else lang }}" class="flex items-center justify-between gap-2 lg:py-5 whitespace-nowrap">
|
||||
<span class="text-[16px] leading-[26px] tracking-[0.01em] nav-link-text text-black dark:text-white before:bg-black dark:before:bg-white">{{ "home" | i18n({}, lang ) | safe }}</span>
|
||||
</a>
|
||||
</li>
|
||||
|
@ -19,7 +27,7 @@
|
|||
|
||||
<li class="nav-link relative">
|
||||
<a href="javascript:void(0);" class="flex items-center justify-between gap-2 lg:py-5">
|
||||
<span class="text-[16px] leading-[26px] tracking-[0.01em] text-black dark:text-white before:bg-black dark:before:bg-white">{{ "developers" | i18n({}, lang ) | safe }}</span>
|
||||
<span class="text-[16px] leading-[26px] tracking-[0.01em] text-black dark:text-white before:bg-black dark:before:bg-white">{{ "guide" | i18n({}, lang ) | safe }}</span>
|
||||
<span href="" id="btn-mobile" class="flex items-center justify-center h-[36px] w-[36px] lg:h-auto lg:w-auto mt-1">
|
||||
<svg class="fill-black dark:fill-white" width="10" height="6" viewBox="0 0 10 6" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M1.50447 0.902966C1.21571 0.627397 0.747525 0.627397 0.458761 0.902966C0.169996 1.17853 0.169996 1.62532 0.458761 1.90089L4.21933 5.48961C4.25543 5.52406 4.29433 5.5542 4.33533 5.58003C4.62234 5.76088 5.01237 5.73074 5.26504 5.48961L9.02561 1.90089C9.31438 1.62532 9.31438 1.17853 9.02561 0.902966C8.73685 0.627397 8.26867 0.627397 7.97991 0.902966L4.74219 3.99273L1.50447 0.902966Z"/>
|
||||
|
@ -27,20 +35,11 @@
|
|||
</span>
|
||||
</a>
|
||||
|
||||
<ul class="flex flex-col items-start gap-2 lg:h-fit lg:absolute lg:bg-white dark:lg:bg-black top-full lg:mt-[10px] lg:py-4 min-w-[200px] rounded-md lg:shadow-[0_0_3px_rgb(60_72_88_/_15%)] sub-menu">
|
||||
<li><a href="https://github.com/simplex-chat/simplex-chat/blob/stable/apps/simplex-bot-advanced/Main.hs"
|
||||
target="_blank" class="lg:px-[20px] inline-block"
|
||||
>{{ "chat-bot-example" | i18n({}, lang ) | safe }}</a></li>
|
||||
<li><a href="https://github.com/simplex-chat/simplex-chat/tree/stable/packages/simplex-chat-client/typescript"
|
||||
target="_blank" class="lg:px-[20px] inline-block"
|
||||
>TypeScript SDK</a></li>
|
||||
<li><a href="https://github.com/simplex-chat/simplex-chat/blob/stable/docs/CLI.md"
|
||||
target="_blank" class="lg:px-[20px] inline-block"
|
||||
>{{ "terminal-cli" | i18n({}, lang ) | safe }}</a></li>
|
||||
<li><a href="https://github.com/simplex-chat/simplexmq"
|
||||
target="_blank" class="lg:px-[20px] inline-block"
|
||||
>SimpleXMQ</a></li>
|
||||
</ul>
|
||||
<ul class="flex flex-col items-start gap-2 lg:h-fit lg:absolute lg:bg-white dark:lg:bg-black top-full lg:mt-[10px] lg:py-4 min-w-[180px] rounded-md lg:shadow-[0_0_3px_rgb(60_72_88_/_15%)] sub-menu">
|
||||
{% for guide in guide_dropdown.items %}
|
||||
<li><a href="{{ guide.url | url }}" class="{{ "active" if page.url == guide.url | url else '' }} lg:px-[20px] inline-block whitespace-nowrap">{{ guide.title | i18n({}, lang ) | safe }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<hr class="dark:opacity-[0.1]" >
|
||||
|
@ -57,14 +56,43 @@
|
|||
|
||||
<ul class="flex flex-col items-start gap-2 lg:h-fit lg:absolute lg:bg-white dark:lg:bg-black top-full lg:mt-[10px] lg:py-4 min-w-[180px] rounded-md lg:shadow-[0_0_3px_rgb(60_72_88_/_15%)] sub-menu">
|
||||
<li><a href="https://github.com/simplex-chat/simplexmq/blob/stable/protocol/overview-tjr.md"
|
||||
target="_blank" class="lg:px-[20px] inline-block"
|
||||
>Whitepaper</a></li>
|
||||
target="_blank" class="lg:px-[20px] flex items-center gap-1"
|
||||
>Whitepaper
|
||||
<svg class="float-right" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg>
|
||||
</a></li>
|
||||
<li><a href="https://github.com/simplex-chat/simplexmq/blob/stable/protocol/simplex-messaging.md"
|
||||
target="_blank" class="lg:px-[20px] inline-block"
|
||||
>{{ "smp-protocol" | i18n({}, lang ) | safe }}</a></li>
|
||||
<li><a href="https://github.com/simplex-chat/simplex-chat/blob/stable/docs/protocol/simplex-chat.md"
|
||||
target="_blank" class="lg:px-[20px] inline-block"
|
||||
target="_blank" class="lg:px-[20px] flex items-center gap-1"
|
||||
>{{ "smp-protocol" | i18n({}, lang ) | safe }}
|
||||
<svg class="float-right" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg>
|
||||
</a></li>
|
||||
<li><a href="/docs/protocol/simplex-chat.html" class="lg:px-[20px] inline-block"
|
||||
>{{ "chat-protocol" | i18n({}, lang ) | safe }}</a></li>
|
||||
|
||||
<hr class=" h-[1px] w-full dark:opacity-[0.1]">
|
||||
|
||||
{% for doc in docs_dropdown.items %}
|
||||
<li><a href="{{ doc.url | url }}" class="{{ "active" if page.url == doc.url | url else '' }} lg:px-[20px] inline-block whitespace-nowrap">{{ doc.title | i18n({}, lang ) | safe }}</a></li>
|
||||
{% endfor %}
|
||||
|
||||
<hr class=" h-[1px] w-full dark:opacity-[0.1]">
|
||||
|
||||
<li><a href="https://github.com/simplex-chat/simplex-chat/blob/stable/apps/simplex-bot-advanced/Main.hs"
|
||||
target="_blank" class="lg:px-[20px] flex items-center gap-1"
|
||||
>{{ "chat-bot-example" | i18n({}, lang ) | safe }}
|
||||
<svg class="float-right" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg>
|
||||
</a></li>
|
||||
<li><a href="https://github.com/simplex-chat/simplex-chat/tree/stable/packages/simplex-chat-client/typescript"
|
||||
target="_blank" class="lg:px-[20px] flex items-center gap-1"
|
||||
>TypeScript SDK
|
||||
<svg class="float-right" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg>
|
||||
</a></li>
|
||||
<li><a href="/docs/cli.html" class="lg:px-[20px] inline-block"
|
||||
>{{ "terminal-cli" | i18n({}, lang ) | safe }}</a></li>
|
||||
<li><a href="https://github.com/simplex-chat/simplexmq"
|
||||
target="_blank" class="lg:px-[20px] flex items-center gap-1"
|
||||
>SimpleXMQ
|
||||
<svg class="float-right" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg>
|
||||
</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
@ -78,8 +106,9 @@
|
|||
</ul>
|
||||
|
||||
<a href="https://github.com/simplex-chat/simplex-chat#help-us-with-donations"
|
||||
target="_blank" class="whitespace-nowrap inline-block self-center text-white dark:text-black text-[16px] font-medium tracking-[0.02em] rounded-[34px] bg-primary-light dark:bg-primary-dark py-3 lg:py-2 px-20 lg:px-5 mb-16 lg:mb-0"
|
||||
>{{ "donate" | i18n({}, lang ) | safe }}</a>
|
||||
target="_blank" class="whitespace-nowrap flex items-center gap-1 self-center text-white dark:text-black text-[16px] font-medium tracking-[0.02em] rounded-[34px] bg-primary-light dark:bg-primary-dark py-3 lg:py-2 px-20 lg:px-5 mb-16 lg:mb-0"
|
||||
>{{ "donate" | i18n({}, lang ) | safe }}
|
||||
</a>
|
||||
|
||||
<div class="inline-block dark:hidden self-center mt-[8px]">
|
||||
<a class="github-button" href="https://github.com/simplex-chat/simplex-chat" data-size="large"
|
||||
|
@ -110,26 +139,50 @@
|
|||
{% endfor %}
|
||||
</a>
|
||||
|
||||
<ul class="flex flex-col items-start gap-2 h-fit absolute top-11 -right-14 bg-white dark:bg-black mt-[10px] py-4 px-5 min-w-[170px] rounded-md shadow-[0_0_3px_rgb(60_72_88_/_15%)] sub-menu overflow-auto">
|
||||
{% for language in languages.languages %}
|
||||
{% if language.enabled %}
|
||||
<li>
|
||||
{% if language.flag %}
|
||||
<a href="{% completeRoute {url:page.url,lang:language.label} %}" class="flex items-center gap-4 flag-anchor whitespace-nowrap w-max">
|
||||
<img class="h-4" src="{{ language.flag }}" alt="" srcset="">
|
||||
<p>{{ language.name }}</p>
|
||||
</a>
|
||||
{% else %}
|
||||
<a href="{% completeRoute {url:page.url,lang:language.label} %}" class="flex items-center gap-4 flag-anchor whitespace-nowrap w-max">
|
||||
<div class="flex items-center justify-center" style="background-color:{{ language.iconBg }}; color:{{ language.textColor }}; width:21.33px; height:16px">
|
||||
<p style="text-align:center; font-size:7px">{{ language.iconText }}</p>
|
||||
</div>
|
||||
<p>{{ language.name }}</p>
|
||||
</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<ul class="flex flex-col items-start gap-2 h-fit absolute top-11 -left-10 bg-white dark:bg-black mt-[10px] py-4 min-w-[170px] rounded-md shadow-[0_0_3px_rgb(60_72_88_/_15%)] sub-menu overflow-auto">
|
||||
{% if "docs" in page.url %}
|
||||
{% for supportedLang in supportedLangsForDoc %}
|
||||
{% for language in languages.languages %}
|
||||
{% if language.label == supportedLang %}
|
||||
<li>
|
||||
{% if language.flag %}
|
||||
<a href="{% completeRoute {url:page.url,lang:language.label} %}" class="px-[20px] flex items-center gap-4 flag-anchor">
|
||||
<img class="h-4" src="{{ language.flag }}" alt="" srcset="">
|
||||
<p>{{ language.name }}</p>
|
||||
</a>
|
||||
{% else %}
|
||||
<a href="{% completeRoute {url:page.url,lang:language.label} %}" class="px-[20px] flex items-center gap-4 flag-anchor">
|
||||
<div class="flex items-center justify-center" style="background-color:{{ language.iconBg }}; color:{{ language.textColor }}; width:21.33px; height:16px">
|
||||
<p style="text-align:center; font-size:7px">{{ language.iconText }}</p>
|
||||
</div>
|
||||
<p>{{ language.name }}</p>
|
||||
</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{% for language in languages.languages %}
|
||||
{% if language.enabled %}
|
||||
<li>
|
||||
{% if language.flag %}
|
||||
<a href="{% completeRoute {url:page.url,lang:language.label} %}" class="px-[20px] flex items-center gap-4 flag-anchor">
|
||||
<img class="h-4" src="{{ language.flag }}" alt="" srcset="">
|
||||
<p>{{ language.name }}</p>
|
||||
</a>
|
||||
{% else %}
|
||||
<a href="{% completeRoute {url:page.url,lang:language.label} %}" class="px-[20px] flex items-center gap-4 flag-anchor">
|
||||
<div class="flex items-center justify-center" style="background-color:{{ language.iconBg }}; color:{{ language.textColor }}; width:21.33px; height:16px">
|
||||
<p style="text-align:center; font-size:7px">{{ language.iconText }}</p>
|
||||
</div>
|
||||
<p>{{ language.name }}</p>
|
||||
</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
412
website/src/css/doc.css
Normal file
412
website/src/css/doc.css
Normal file
|
@ -0,0 +1,412 @@
|
|||
html {
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
|
||||
header {
|
||||
transition: none;
|
||||
}
|
||||
|
||||
:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
#doc {
|
||||
font-size: 16px;
|
||||
line-height: 1.5;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
#doc code,
|
||||
#doc kbd,
|
||||
#doc pre,
|
||||
#doc samp {
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
||||
font-size: 1em;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
#doc p {
|
||||
margin: 0 0 16px;
|
||||
gap: 2px;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.dark #doc p {
|
||||
color: white;
|
||||
}
|
||||
|
||||
#doc h1 {
|
||||
font-size: 32px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.02em;
|
||||
background: -webkit-linear-gradient(to bottom, #53C1FF -50%, #0053D0 160%);
|
||||
background: linear-gradient(to bottom, #53C1FF -50%, #0053D0 160%);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
text-fill-color: transparent;
|
||||
|
||||
position: relative;
|
||||
margin: 0px 0px 16px;
|
||||
padding: 0px 0px 9.6px;
|
||||
}
|
||||
|
||||
#doc h2 {
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
color: #3F484B;
|
||||
position: relative;
|
||||
margin: 24px 0px 16px;
|
||||
padding: 0 0 7.2px;
|
||||
}
|
||||
|
||||
#doc h3 {
|
||||
font-size: 20px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.02em;
|
||||
color: #606C71;
|
||||
margin: 24px 0px 16px;
|
||||
}
|
||||
|
||||
#doc h1::after,
|
||||
#doc h2::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0px;
|
||||
width: 100%;
|
||||
height: 1px;
|
||||
background-color: rgb(216, 222, 228);
|
||||
}
|
||||
|
||||
.dark #doc h1::after,
|
||||
.dark #doc h2::after {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.dark #doc h1 {
|
||||
background: -webkit-linear-gradient(to bottom, #70F0F9 100%, #70F0F9 100%);
|
||||
background: linear-gradient(to bottom, #70F0F9 100%, #70F0F9 100%);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
text-fill-color: transparent;
|
||||
}
|
||||
|
||||
.dark #doc h2,
|
||||
.dark #doc h3,
|
||||
.dark #doc h4 {
|
||||
color: white;
|
||||
}
|
||||
|
||||
#doc img {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
#doc article ul {
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
#doc ul,
|
||||
#doc ol {
|
||||
list-style-position: inside;
|
||||
overflow: auto;
|
||||
margin: 1rem 0;
|
||||
padding-left: 1rem;
|
||||
}
|
||||
|
||||
#doc ul li,
|
||||
#doc ol li {
|
||||
margin-right: 0;
|
||||
margin-left: 0;
|
||||
-webkit-margin-start: 1.1rem;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.dark #doc ul li,
|
||||
.dark #doc ol li {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
#doc ul li::marker,
|
||||
#doc ol li::marker {
|
||||
color: black;
|
||||
}
|
||||
|
||||
.dark #doc ul li::marker,
|
||||
.dark #doc ol li::marker {
|
||||
color: white;
|
||||
}
|
||||
|
||||
#doc ul li a,
|
||||
#doc ol li a {
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
#doc ul li {
|
||||
list-style: disc;
|
||||
}
|
||||
|
||||
#doc ol li {
|
||||
list-style: decimal;
|
||||
}
|
||||
|
||||
#doc a {
|
||||
color: #0053D0;
|
||||
text-decoration: underline;
|
||||
text-underline-offset: 4px;
|
||||
}
|
||||
|
||||
#doc h1 a {
|
||||
-webkit-text-fill-color: #0053D0;
|
||||
text-fill-color: #0053D0;
|
||||
}
|
||||
|
||||
.dark #doc a {
|
||||
color: #70F0F9;
|
||||
}
|
||||
|
||||
.dark #doc h1 a {
|
||||
-webkit-text-fill-color: #70F0F9;
|
||||
text-fill-color: #70F0F9;
|
||||
}
|
||||
|
||||
#doc pre {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.dark #doc pre {
|
||||
color: white;
|
||||
}
|
||||
|
||||
#doc table {
|
||||
display: block;
|
||||
border-collapse: collapse;
|
||||
width: max-content;
|
||||
max-width: 100%;
|
||||
overflow: auto;
|
||||
margin-bottom: 1rem;
|
||||
border: 1px solid #e1e4e8;
|
||||
}
|
||||
|
||||
#doc table th,
|
||||
#doc table td {
|
||||
border: 1px solid #e1e4e8;
|
||||
padding: 6px 13px;
|
||||
}
|
||||
|
||||
#doc table td a {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
#doc table th {
|
||||
font-weight: 600;
|
||||
background-color: #f6f8fa;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#doc table tbody tr:nth-child(odd) {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
#doc table tbody tr:nth-child(even) {
|
||||
background-color: #fafbfc;
|
||||
}
|
||||
|
||||
.dark #doc table tr,
|
||||
.dark #doc table th {
|
||||
color: white;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
#doc main {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
#doc main aside {
|
||||
width: 320px;
|
||||
height: calc(100vh - 66px);
|
||||
position: sticky;
|
||||
top: 66px;
|
||||
overflow-y: auto;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.dark #doc main aside {
|
||||
background-color: #17203D;
|
||||
}
|
||||
|
||||
#doc main aside ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#doc main aside ul li {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#doc main aside ul li a {
|
||||
font-size: 14px;
|
||||
display: block;
|
||||
color: rgb(60, 60, 60);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#doc main aside ul li a:hover {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.dark #doc main aside ul li a:hover {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
#doc main aside ul li a.active {
|
||||
color: #0053D0;
|
||||
}
|
||||
|
||||
.dark #doc main aside ul li a.active {
|
||||
color: #70F0F9;
|
||||
}
|
||||
|
||||
#doc main aside p {
|
||||
margin: 0;
|
||||
font-weight: 700;
|
||||
letter-spacing: .8px;
|
||||
margin-top: 1.2rem;
|
||||
margin-bottom: .4rem;
|
||||
}
|
||||
|
||||
#doc main article {
|
||||
width: calc(100vw - 320px);
|
||||
}
|
||||
|
||||
@media (max-width: 1024px) {
|
||||
#doc main aside {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100vh;
|
||||
z-index: 100;
|
||||
transition: all ease .3s;
|
||||
transform: translateX(-100%);
|
||||
}
|
||||
|
||||
#doc main.overlay aside {
|
||||
transform: translateX(0);
|
||||
}
|
||||
|
||||
#doc main.overlay::after {
|
||||
content: "";
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: #F3F6F7;
|
||||
opacity: 0.9;
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
.dark #doc main.overlay::after {
|
||||
background-color: #0C0B13;
|
||||
}
|
||||
|
||||
#doc main article {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
#doc article>div {
|
||||
max-width: 870px;
|
||||
margin: 0 auto;
|
||||
padding: 16px 32px 32px 32px;
|
||||
}
|
||||
|
||||
@media (max-width: 1024px) {
|
||||
#doc article>div {
|
||||
max-width: 600px;
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
#doc .hash-link {
|
||||
opacity: 0;
|
||||
font-size: 1.5rem;
|
||||
text-decoration: none !important;
|
||||
position: absolute;
|
||||
left: -16px;
|
||||
top: 0;
|
||||
transition: all ease .3s;
|
||||
}
|
||||
|
||||
#doc h1 a.hash-link {
|
||||
top: 6px;
|
||||
}
|
||||
|
||||
#doc h1:hover .hash-link,
|
||||
#doc h2:hover .hash-link,
|
||||
#doc h3:hover .hash-link,
|
||||
#doc h4:hover .hash-link,
|
||||
#doc h5:hover .hash-link,
|
||||
#doc h6:hover .hash-link,
|
||||
#doc .hash-link:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
#doc .hash-link:hover {
|
||||
text-decoration: underline !important;
|
||||
}
|
||||
|
||||
#doc .hash-list {
|
||||
padding: 1.5rem 2rem !important;
|
||||
}
|
||||
|
||||
#doc .hash-list li {
|
||||
list-style: none !important;
|
||||
width: 100%;
|
||||
-webkit-margin-start: 0 !important;
|
||||
}
|
||||
|
||||
#doc .hash-list li a {
|
||||
text-decoration: none !important;
|
||||
color: #000 !important;
|
||||
}
|
||||
|
||||
.dark #doc .hash-list li a {
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
@media (max-width: 1024px) {
|
||||
#doc .sub-menu.hash-list {
|
||||
max-height: fit-content;
|
||||
}
|
||||
}
|
||||
|
||||
#doc #back-to-top {
|
||||
color: #0053D0 !important;
|
||||
position: relative;
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.dark #doc #back-to-top {
|
||||
color: #70F0F9 !important;
|
||||
}
|
||||
|
||||
#doc #back-to-top::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: -12px;
|
||||
height: 1px;
|
||||
background-color: rgb(216, 222, 228);
|
||||
}
|
||||
|
||||
.dark #doc #back-to-top::after {
|
||||
opacity: 0.2;
|
||||
}
|
4
website/src/css/prism.min.css
vendored
Normal file
4
website/src/css/prism.min.css
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
/* PrismJS 1.29.0
|
||||
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+bash+c+csharp+cpp+css-extras+dart+docker+ejs+git+linker-script+gradle+haskell+http+java+javadoclike+jsdoc+js-extras+json+json5+jsonp+jsstacktrace+js-templates+kotlin+makefile+markdown+markup-templating+n1ql+nginx+plsql+powerquery+powershell+python+sql+swift+typescript+typoscript+xml-doc+xquery+yaml&plugins=normalize-whitespace+toolbar+copy-to-clipboard */
|
||||
code[class*=language-],pre[class*=language-]{color:#000;background:0 0;text-shadow:0 1px #fff;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:#b3d4fc}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#999}.token.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#905}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#690}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color:#9a6e3a;background:hsla(0,0%,100%,.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.class-name,.token.function{color:#dd4a68}.token.important,.token.regex,.token.variable{color:#e90}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}
|
||||
div.code-toolbar{position:relative}div.code-toolbar>.toolbar{position:absolute;z-index:10;top:.3em;right:.2em;transition:opacity .3s ease-in-out;opacity:0}div.code-toolbar:hover>.toolbar{opacity:1}div.code-toolbar:focus-within>.toolbar{opacity:1}div.code-toolbar>.toolbar>.toolbar-item{display:inline-block}div.code-toolbar>.toolbar>.toolbar-item>a{cursor:pointer}div.code-toolbar>.toolbar>.toolbar-item>button{background:0 0;border:0;color:inherit;font:inherit;line-height:normal;overflow:visible;padding:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}div.code-toolbar>.toolbar>.toolbar-item>a,div.code-toolbar>.toolbar>.toolbar-item>button,div.code-toolbar>.toolbar>.toolbar-item>span{color:#bbb;font-size:.8em;padding:0 .5em;background:#f5f2f0;background:rgba(224,224,224,.2);box-shadow:0 2px 0 0 rgba(0,0,0,.2);border-radius:.5em}div.code-toolbar>.toolbar>.toolbar-item>a:focus,div.code-toolbar>.toolbar>.toolbar-item>a:hover,div.code-toolbar>.toolbar>.toolbar-item>button:focus,div.code-toolbar>.toolbar>.toolbar-item>button:hover,div.code-toolbar>.toolbar>.toolbar-item>span:focus,div.code-toolbar>.toolbar>.toolbar-item>span:hover{color:inherit;text-decoration:none}
|
|
@ -182,6 +182,14 @@ img{
|
|||
color: #fff;
|
||||
}
|
||||
|
||||
.nav-link ul li a.active{
|
||||
color: #0053D0;
|
||||
|
||||
}
|
||||
.dark .nav-link ul li a.active{
|
||||
color: #66D9E2;
|
||||
}
|
||||
|
||||
@media (min-width:1024px) {
|
||||
.nav-link-text,
|
||||
.menu-link {
|
||||
|
@ -229,8 +237,13 @@ img{
|
|||
color: #505158;
|
||||
}
|
||||
|
||||
.dark .sub-menu {
|
||||
color: #fff;
|
||||
.sub-menu .no-hover{
|
||||
color: #505158 !important;
|
||||
}
|
||||
|
||||
.dark .sub-menu,
|
||||
.dark .sub-menu .no-hover {
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.dark .sub-menu li:hover {
|
||||
|
@ -282,7 +295,7 @@ header nav {
|
|||
}
|
||||
|
||||
.active .sub-menu {
|
||||
max-height: 200px;
|
||||
max-height: 600px;
|
||||
transform: translateY(0px);
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
|
|
91
website/src/js/docs.js
Normal file
91
website/src/js/docs.js
Normal file
|
@ -0,0 +1,91 @@
|
|||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const imgs = document.querySelectorAll('p img')
|
||||
imgs.forEach(img => {
|
||||
console.log(img.height)
|
||||
img.style.height = `${img.getAttribute('height')}px`
|
||||
})
|
||||
|
||||
const allParagraphs = document.querySelectorAll("p")
|
||||
allParagraphs.forEach((paragraph) => {
|
||||
if (paragraph.querySelector("img")) {
|
||||
paragraph.style.display = "flex"
|
||||
}
|
||||
})
|
||||
|
||||
const docMain = document.querySelector('#doc main')
|
||||
const menuBtn = document.querySelector('#doc main button.menu')
|
||||
docMain.addEventListener('click', () => {
|
||||
docMain.classList.remove("overlay")
|
||||
document.body.classList.remove('lock-scroll')
|
||||
})
|
||||
|
||||
menuBtn.addEventListener('click', (e) => {
|
||||
docMain.classList.add("overlay")
|
||||
document.body.classList.add('lock-scroll')
|
||||
e.stopPropagation()
|
||||
})
|
||||
|
||||
const headerWithIds = document.querySelectorAll('h1[id], h2[id]')
|
||||
const hashList = document.querySelector('.hash-list')
|
||||
|
||||
headerWithIds.forEach(header => {
|
||||
const id = header.getAttribute('id')
|
||||
|
||||
const listItem = document.createElement('li')
|
||||
const anchor = document.createElement('a')
|
||||
anchor.href = `#${id}`
|
||||
anchor.textContent = header.textContent
|
||||
listItem.appendChild(anchor)
|
||||
hashList.appendChild(listItem)
|
||||
|
||||
const hashLink = document.createElement('a')
|
||||
hashLink.href = `#${id}`
|
||||
hashLink.textContent = '#'
|
||||
hashLink.classList.add('hash-link')
|
||||
header.appendChild(hashLink)
|
||||
})
|
||||
|
||||
function scrollToIdWithTopOffset(id, topOffset) {
|
||||
const element = document.getElementById(id)
|
||||
if (element) {
|
||||
const elementRect = element.getBoundingClientRect()
|
||||
const absoluteElementTop = elementRect.top + window.scrollY
|
||||
const scrollToPosition = absoluteElementTop - topOffset
|
||||
window.scrollTo({ top: scrollToPosition, behavior: 'smooth' })
|
||||
}
|
||||
}
|
||||
|
||||
function scrollToHashWithTopOffset() {
|
||||
const topOffset = window.innerWidth <= 1024 ? 104 : 66 // Adjust the top offset value as needed
|
||||
const hash = window.location.hash.substring(1)
|
||||
|
||||
if (hash) {
|
||||
setTimeout(() => {
|
||||
scrollToIdWithTopOffset(hash, topOffset)
|
||||
}, 0)
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener('click', (event) => {
|
||||
const target = event.target
|
||||
if (target.tagName.toLowerCase() === 'a' && target.getAttribute('href').startsWith('#')) {
|
||||
event.preventDefault()
|
||||
const id = target.getAttribute('href').substring(1)
|
||||
|
||||
const topOffset = window.innerWidth <= 1024 ? 104 : 66 // Adjust the top offset value as needed
|
||||
history.pushState(null, null, '#' + id)
|
||||
|
||||
scrollToIdWithTopOffset(id, topOffset)
|
||||
}
|
||||
})
|
||||
|
||||
window.addEventListener('load', () => {
|
||||
scrollToHashWithTopOffset()
|
||||
})
|
||||
|
||||
const backToTop = document.getElementById('back-to-top')
|
||||
backToTop.addEventListener('click', function (event) {
|
||||
event.preventDefault()
|
||||
window.scrollTo({ top: 0, behavior: 'smooth' })
|
||||
})
|
||||
})
|
49
website/src/js/prism.min.js
vendored
Normal file
49
website/src/js/prism.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -2,6 +2,9 @@
|
|||
|
||||
set -e
|
||||
|
||||
cp -R docs website/src
|
||||
rm -rf website/src/docs/rfcs
|
||||
rm website/src/docs/lang/*/README.md
|
||||
cp -R blog website/src
|
||||
cp -R images website/src
|
||||
rm website/src/blog/README.md
|
||||
|
@ -18,7 +21,9 @@ for file in langs/*.json; do
|
|||
fi
|
||||
done
|
||||
|
||||
npm install
|
||||
node merge_translations.js
|
||||
node customize_docs_frontmatter.js
|
||||
|
||||
# creating folders for each language for internationalization
|
||||
for lang in "${langs[@]}"; do
|
||||
|
@ -30,7 +35,6 @@ for lang in "${langs[@]}"; do
|
|||
echo "done $lang copying"
|
||||
done
|
||||
|
||||
npm install
|
||||
npm run build
|
||||
|
||||
for lang in "${langs[@]}"; do
|
||||
|
|
Loading…
Add table
Reference in a new issue