(已弃用)插件出口位置主题组件

:mega: the ability to debug plugin outlets is now included in core. Check out this topic for more details

Original theme component info

Continuing the discussion from Plugin Outlet Locations:

I needed an updated version with all the plugin outlets that have been added recently and then I realised that it would be really easy to create a theme component for this, so there is no need to install a plugin any more.

Repository: GitHub - communiteq/plugin-outlets-theme-component

The repository includes a script (gen/generate.rb) that will auto-generate the outlets based on the Discourse source code.

To toggle the plugin outlets, click the “connector” icon in the top right.

When you click a specific plugin outlet, the display will change and you will be able to see all the arguments to the plugin outlet. Click it again to change it back.

firefox_whjNGBiVSB

Install this theme component

Theme preview: Theme Creator

63 个赞

Didn’t @Mittineague write something like this before?

1 个赞

Yes, see the link at the very top of this topic, that refers to the topic about that. @Mittineague wrote a plugin in 2015. I was using it and then I found out that it needed to be updated (it hadn’t been updated for over 2 years).

The next step was me realizing that this could be done much easier now using a theme component.

7 个赞

Yes, I had started to update the plugin to take into account the changes in the number and locations of plugin outlets a few weeks ago, but other priorities moved it down on my ever growing todo list.

If the same information can be provided as a theme component that works in the GUI and doesn’t require editing app.yml and running launcher I think it would be easier for most. I may be wrong, but I have a feeling most prefer GUI over CLI.

6 个赞

I use this theme component (and the theme preview) a lot since I develop a few themes but I never thanked @RGJ

I can’t say how much time this theme component helped me save, but it’s a lot. Great job, very very useful.

10 个赞

I’m getting a “Bad Gateway” error when trying to install the component. Also when trying to paste the generated content into head_tag.html manually.

Is there a length limit for that file? Because it works fine when I split the content into two separate files.

There is no length limit (at least not one that is close to the current length of the file).

The theme component does take a while to install, your server might be not fast enough and time out because of the large number of plugin outlets / script fragments that are being used.

2 个赞

在开发过程中,我发现自己总是添加/删除此主题,以了解插件出口。为了在我的开发环境中更轻松地做到这一点,我添加了一个切换按钮来切换插件出口的可见性。也许其他人会觉得它有用,所以我为此创建了一个 PR。

13 个赞

太棒了。谢谢!
PR 已合并。

9 个赞

绝妙的主意!我喜欢那个插件按钮图标 :slight_smile:

只有一个问题,似乎如果你切换到不同的路由,顶部的开关会与内容出口不同步,所以你永远无法同时打开或关闭所有东西 :sweat_smile: (在我的例子中这很有用,但可能不是普遍想要的?)。

2 个赞

@merefield
啊是的,你说得对。 :sweat_smile: 我已切换为向 body 添加一个类来切换可见性,这似乎解决了问题。PR 在这里:

6 个赞

我错过了什么?我已经安装了组件。但我仍然需要运行脚本才能使其正常工作吗?脚本是否在我的服务器上的某个地方,我可以运行它?还是我需要复制粘贴?如果我修改 common/head_tag.html,我需要将其恢复才能禁用此组件吗?
:folded_hands:

该脚本仅用于插件维护,您不需要它。

只需安装主题组件,将其添加到您的主主题中,然后按“插件”图标即可。

firefox_jDikn4jVrC

6 个赞

当与 Custom Header Links (icons) 一起使用时,存在一个小错误。
单击自定义标题图标会触发出口按钮:

1 个赞

新的用户卡片作为主题组件存在一个小错误。我不确定它在核心中发布时(如果发布的话)是否也会发生。不过……当“outlets”被关闭时,实验性用户卡片中的“outlets”仍然显示出来:

顺便说一句,如果我以前没说过,这个主题组件绝对很棒。

2 个赞

是的,我可以重现这个问题,感谢您的报告!!:+1:

我将在下周初发布主题组件的新版本,其中将包含 3.1 的新插槽和此错误的修复程序。

3 个赞

我可以建议一个设置吗?选择背景颜色。我很高兴“brutal red”被改成了“poppin’ green”,但个人而言,我喜欢柔和的颜色。:slight_smile:

(不过我可以提交PR)

4 个赞

新版本!!

  • 使用所有 3.2beta PluginOutlets 更新
  • 可配置的颜色
  • 点击插座可查看实际参数 :fire:

firefox_whjNGBiVSB

13 个赞

这似乎有点小错误,现在每次在我的 PC 上刷新页面时都会默认启用,并且它正在抛出一些弃用:

[THEME 105 'Plugin Outlet Locations'] Deprecation notice: The header-icons widget has been deprecated and decorateWidget is no longer a supported override. [deprecated since Discourse v3.3.0.beta1-dev] [deprecation id: discourse.header-widget-overrides] [info: https://meta.discourse.org/t/296544]
[THEME 105 'Plugin Outlet Locations'] Deprecation notice: The header-icons widget has been deprecated and attachWidgetAction is no longer a supported override. [deprecated since Discourse v3.3.0.beta1-dev] [deprecation id: discourse.header-widget-overrides] [info: https://meta.discourse.org/t/296544]
1 个赞

啊,感谢 @Firepup650 提醒我! :+1:
我只检查了我的插件是否符合此弃用项,却忘了我的主题组件。

我已经推送了一个更新来修复此弃用项。

我稍后还将更新该组件以包含一些新的插件出口,但这需要更多时间,因为有新的包装器出口。
我还更新了该组件以包含最新的插件出口,但包装器出口除外,因为它们需要更多时间/重构。

8 个赞