如果主题未经编辑和保存,主题预览将无法工作

我不确定这是否是其应有的工作方式(但看起来有些奇怪),还是仅仅运行不佳。

如果我有一个未启用且不属于其他活动主题组件的主题,预览按钮无法正常工作,或者说,它虽然能点击,但打开的仍然是常规网站,无法让我查看该样式表的预览效果。


我也尝试过作为其他(活动)主题组件使用的样式表,但结果相同。

此外,如果我只是进入样式表页面并点击“预览”按钮,而不进行任何修改,正如前面所述,网站会正常加载,而不会仅显示预览内容。

从实际角度来看,目前预览按钮几乎没有任何作用。

只有在我先进行一些修改,点击保存,然后再点击预览按钮时,预览功能才能正常工作。

因此,我想了解:如何与他人分享预览链接?
我经常需要向团队展示正在进行中的工作,以便共同决定下一步如何推进。起初,我将预览链接分享给他们,但现在由于预览链接已不可用,我不得不制作大量截图,而这些截图往往不足以说明所做的更改,因为其他人无法在“实际操作”中看到这些变化。

3 个赞

I believe @sam plans to do more work in this area soon but it may be a month or two out.

1 个赞

Wonderful :star_struck:

EDIT: (sorry for the two-time response, I was in the middle of a cat VS dog war…)

Do you mean that in addition to the existing functions he might consider adding extra functionality?

The big 2 pieces of functionality missing are

  1. Discovery of themes
  2. User selectable theme components

(2) is on my definite roadmap, (1) needs fleshing out.

3 个赞

Thanks for posting about this issue.

I installed and customised a theme last night and it was going well. When I hit PREVIEW it displayed the theme as I expected. But, this morning when I tried to preview it again, suddenly the unchanged CSS wasn’t being previewed at all. I couldn’t understand why it stopped working.

After reading your post above, I tried adding a blank space anywhere in the theme’s CSS, then clicked SAVE. And BOOM, suddenly the preview button works again, just like you said above.

This is a bug. And as you mentioned, it makes it harder to show the theme to others, without explaining the need to do a pointless save first.

I just ran into this as well. It makes it hard to test and build a theme behind the scenes. This should probably be fixed since it is not working as expected by the user.

It would also be nice to be able to make themes available to either Mods or Admins in addition to users. Let’s say we are working on a special Holiday Theme and do not want to show it or make it available right away.

I am having trouble reproducing this, is the problem theme on your site? I tried to repro the issue in dev and was unable to get this cache poisoning problem.

Right now if I go to a specific theme that is not selectable by users (ex /admin/customize/themes/47) and click on “Preview” the preview does not change the theme. If I then go in change anything (ex Color Scheme or theme name etc…) then it will Preview properly.

Just testing it again right now and it is happening to me.

6 个赞

OH my, what a giant bug,

Fixed per:

https://github.com/discourse/discourse/commit/6f076963f2c1cc419f8be8af901e6b7c111f99d2

Will get it deployed to you @Sean_R shortly.

10 个赞

This topic was automatically closed after 2 days. New replies are no longer allowed.