Completely upgrade project:

- removed all translations and used Russian as the base language
- integrated crowdin
- new multilang site layout
- upgraded sphinx
- fixed search, now it correctly handles articles language
This commit is contained in:
ErickSkrauch
2021-03-20 02:48:10 +01:00
parent bc43bce964
commit 5cebcf8abe
31 changed files with 670 additions and 1141 deletions

View File

@ -29,7 +29,7 @@ import datetime
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = []
extensions = ['sphinx.ext.ifconfig']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
@ -45,7 +45,7 @@ master_doc = 'index'
# General information about the project.
project = 'Ely.by Documentation'
copyright = str(datetime.datetime.now().year) + ', ErickSkrauch'
copyright = str(datetime.datetime.now().year) + ', Ely.by'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
@ -58,7 +58,7 @@ release = ''
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
language = 'en'
language = 'ru'
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
@ -258,22 +258,24 @@ texinfo_documents = [
# If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False
# -- Options for sphinx-intl ----------------------------------------------
locale_dirs = ['../locale/']
gettext_compact = False
# -- Static files generation rules ----------------------------------------
static_files = [
'../CNAME',
'../_config.yml',
'api.html',
'minecraft-auth.html',
'oauth.html',
'skin-system.html',
'../.nojekyll',
]
from shutil import copyfile
from os import path
from sphinx.application import Sphinx
def copy_static_files(app, _):
# type: (Sphinx, None) -> None
if app.builder.name != 'html':
def copy_static_files(app: Sphinx, _) -> None:
if app.builder.name != "html":
return
for src_name in static_files:
@ -286,4 +288,4 @@ def copy_static_files(app, _):
copyfile(src_path, target_path)
def setup(app):
app.connect('build-finished', copy_static_files)
app.connect("build-finished", copy_static_files)