Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .cspell-dict
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Vorobyovy
Notimaps
retromap
Godina
Rehype

# ru-ru
ватермарки
Expand Down
30 changes: 26 additions & 4 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
import ConfigLocalized from './docusaurus.config.localized.json';

const {themes} = require('prism-react-renderer');
const lightCodeTheme = themes.github;
const darkCodeTheme = themes.dracula;
const defaultLocale = 'ru';

function getLocalizedConfigValue(key) {
const currentLocale = process.env.DOCUSAURUS_CURRENT_LOCALE ?? defaultLocale;
const values = ConfigLocalized[key];
if (!values) {
throw new Error(`Localized config key=${key} not found`);
}
const value = values[currentLocale] ?? values[defaultLocale];
if (!value) {
throw new Error(
`Localized value for config key=${key} not found for both currentLocale=${currentLocale} or defaultLocale=${defaultLocale}`,
);
}
return value;
}

/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'PastVu Resources',
tagline: 'PastVu is an online platform for gathering, geo-tagging, attributing and discussing retro photos.',
title: getLocalizedConfigValue('title'),
tagline: getLocalizedConfigValue('tagline'),
url: 'https://docs.pastvu.com',
baseUrl: '/',
onBrokenLinks: 'throw',
Expand All @@ -20,7 +37,7 @@ const config = {
// metadata like html lang. For example, if your site is Chinese, you may want
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: 'ru',
defaultLocale: defaultLocale,
locales: ['en', 'ru'],
localeConfigs: {
en: {
Expand All @@ -31,6 +48,11 @@ const config = {
},
},
},
markdown: {
remarkRehypeOptions: {
footnoteLabel: getLocalizedConfigValue('remarkRehypeOptions_footnotes'),
},
},
plugins: ['docusaurus-plugin-sass',
["@docusaurus/plugin-client-redirects",
{
Expand Down Expand Up @@ -111,7 +133,7 @@ const config = {
],
},
footer: {
copyright: `© ${new Date().getFullYear()} PastVu documentation. Built with Docusaurus.`, // Not in use, see i18n/en/docusaurus-theme-classic/footer.json
copyright: `© ${new Date().getFullYear()} ` + getLocalizedConfigValue('footer_copyright'), // Not in use, see i18n/en/docusaurus-theme-classic/footer.json
},
prism: {
theme: lightCodeTheme,
Expand Down
18 changes: 18 additions & 0 deletions docusaurus.config.localized.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"title": {
"en": "PastVu Resources",
"ru": "База знаний PastVu"
},
"tagline": {
"en": "PastVu is an online platform for gathering, geo-tagging, attributing and discussing retro photos",
"ru": "Проект по сбору свидетельств прошлого в фотографиях, взгляд на историю среды обитания человечества"
},
"remarkRehypeOptions_footnotes": {
"en": "Footnotes",
"ru": "Примечания"
},
"footer_copyright": {
"en": "PastVu documentation. Built with Docusaurus. Content is licensed under <a href=\"https://creativecommons.org/licenses/by/4.0/\">CC-BY 4.0</a>.",
"ru": "База знаний PastVu. Сделано на Docusaurus. Материал этого сайта доступен по лицензии <a href=\"https://creativecommons.org/licenses/by/4.0/deed.ru\">CC-BY 4.0</a>."
}
}
6 changes: 0 additions & 6 deletions i18n/en/docusaurus-theme-classic/footer.json

This file was deleted.

6 changes: 0 additions & 6 deletions i18n/ru/docusaurus-theme-classic/footer.json

This file was deleted.

9 changes: 2 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4167,14 +4167,9 @@ caniuse-api@^3.0.0:
lodash.memoize "^4.1.2"
lodash.uniq "^4.5.0"

caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001538, caniuse-lite@^1.0.30001541, caniuse-lite@^1.0.30001646, caniuse-lite@^1.0.30001663:
version "1.0.30001667"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001667.tgz"
integrity sha512-7LTwJjcRkzKFmtqGsibMeuXmvFDfZq/nzIjnmgCGzKKRVzjD72selLDK1oPF/Oxzmt4fNcPvTDvGqSDG4tCALw==

caniuse-lite@^1.0.30001754:
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001538, caniuse-lite@^1.0.30001541, caniuse-lite@^1.0.30001646, caniuse-lite@^1.0.30001663, caniuse-lite@^1.0.30001754:
version "1.0.30001755"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001755.tgz#c01cfb1c30f5acf1229391666ec03492f4c332ff"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001755.tgz"
integrity sha512-44V+Jm6ctPj7R52Na4TLi3Zri4dWUljJd+RDm+j8LtNCc/ihLCT+X1TzoOAkRETEWqjuLnh9581Tl80FvK7jVA==

ccount@^2.0.0:
Expand Down