diff --git a/doc/conf.py b/doc/conf.py index a545567..19c802a 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -49,6 +49,7 @@ # atsphinx.mini18n mini18n_default_language = "ja" mini18n_support_languages = ["en", "ja"] +mini18n_basepath = "/mini18n/" def setup(app): diff --git a/src/atsphinx/mini18n/__init__.py b/src/atsphinx/mini18n/__init__.py index 3f218f5..9820471 100644 --- a/src/atsphinx/mini18n/__init__.py +++ b/src/atsphinx/mini18n/__init__.py @@ -89,6 +89,7 @@ def autocomplete_config(app: Sphinx, config: Config): if not config.html_context: config.html_context = {} config.html_context["mini18n"] = { + "basepath": config.mini18n_basepath, "support_languages": config.mini18n_support_languages, } @@ -101,6 +102,7 @@ def setup(app: Sphinx): # noqa: D103 register_i18n_builders(app) app.add_config_value("mini18n_default_language", None, "env") app.add_config_value("mini18n_support_languages", [], "env") + app.add_config_value("mini18n_basepath", "/", "env") app.connect("config-inited", autocomplete_config) return { "version": __version__, diff --git a/src/atsphinx/mini18n/templates/mini18n/index.html b/src/atsphinx/mini18n/templates/mini18n/index.html index 558b4bd..98a269b 100644 --- a/src/atsphinx/mini18n/templates/mini18n/index.html +++ b/src/atsphinx/mini18n/templates/mini18n/index.html @@ -10,9 +10,12 @@