欢迎页面图片

目前,您只能将内容添加到文本上方……但我刚刚推送了一个更新,将允许您在下方添加内容,因为这看起来是一个合理的功能。 (FEATURE: Add below-static plugin outlet · discourse/discourse@e4ebc30 · GitHub)。

如果您在几小时内更新 Discourse(通过 yoursite.com/admin/upgrade),您将获得此更改,并能够根据需要添加内容。

操作方法如下:在您的主题中,需要将以下内容添加到 header.html 文件中:

<script type="text/x-handlebars" data-template-name="/connectors/below-static/custom-login">
  {{#if showLoginButton}} 
    <div class="custom-login-content">
       <!-- 在此处添加您的自定义 HTML -->
    </div>
  {{/if}}
</script>

请注意,此模板在多个位置使用(例如常见问题页面、关于页面等)。因此,如果您仅希望内容在欢迎登录页面上可见,则需要保留外层的 {{#if showLoginButton}} {{/if}}

您可以在此处了解更多关于使用插件出口向我们的 Handlebars 模板添加内容的信息:Developing Discourse Themes & Theme Components