在Dokuwiki Bitnami Docker映像中添加和覆盖文件

时间:2020-06-24 10:46:03

标签: docker bitnami dokuwiki

正在尝试启用“翻译”插件dokuwiki和对Dokuwiki Bitnami图像的其他一些更改。例如,我向Dokuwiki Bitnami映像的'lib / tpl / dokuwiki'中添加了一个新文件,并且还覆盖了'lang.php'。

更改为默认的原始docker-compose.yml

   - './conf/lang.php:/bitnami/dokuwiki/lib/tpl/dokuwiki/lang/en/lang.php'
      - './conf/sidebarheader.html:/bitnami/dokuwiki/lib/tpl/dokuwiki/sidebarheader.html' 

但是更改不会反映在容器中,也不会产生任何错误。欢迎提出任何建议。

1 个答案:

答案 0 :(得分:4)

这对我们有用:

  1. 使用扩展管理器安装插件。 https://www.dokuwiki.org/plugin:translation

  2. 将local.php文件复制到主机

docker cp <container>:/bitnami/dokuwiki/conf/local.php conf/local.php
  1. 将以下内容添加到local.php文件。 https://www.dokuwiki.org/plugin:translation#manual_configuration

$conf['plugin']['translation']['translations']  = 'en,fr,de,it';                        // available languages
$conf['plugin']['translation']['dropdown']      = 1;                                    // use a dropdown
$conf['plugin']['translation']['translationns'] = 'wiki';                               // namespace where to activate translation
$conf['plugin']['translation']['skiptrans']     = '^:(plugin|template):';               // what to skip (regexp)
$conf['plugin']['translation']['translateui']   = 1;                                    // translate the wiki user interface too
$conf['plugin']['translation']['checkage']      = 1;                                    // show notice on outdated translations
$conf['plugin']['translation']['about']         = 'translation:about';                  // page describing the translation process to users
$conf['plugin']['translation']['localabout']    = 1;
$conf['plugin']['translation']['display']       = 'langcode,name';
  1. 在主机上创建conf/sidebarheader.html
<?php
$translation = plugin_load('helper','translation');
if ($translation) echo $translation->showTranslations();
?>
  1. 确保已创建侧栏。如果没有创建它。 http:// /doku.php?id=sidebar

  2. 在docker-compose中挂载文件

    volumes:
      - 'dokuwiki_data:/bitnami'
      - './conf/local.php:/bitnami/dokuwiki/conf/local.php'
      - './conf/sidebarheader.html:/bitnami/dokuwiki/lib/tpl/dokuwiki/sidebarheader.html'
  1. 重新创建容器以应用新的安装路径
dc down && dc up

enter image description here