这看起来很令人兴奋。希望能利用落地页来列出即将举行的活动,或者至少按标签分类。
谢谢!
这看起来很令人兴奋。希望能利用落地页来列出即将举行的活动,或者至少按标签分类。
谢谢!
感谢提交补丁!效果很好。您觉得为落地首页路径添加一个配置选项是否合理?我尝试过其他设置自定义首页的方案,但只有这个方案配合该落地页插件真正对我有效。
在 plugin.rb 文件中,有没有办法访问插件变量中的值?
@angus,有没有办法将某些自定义落地页的内容渲染在 Discourse 的标准布局中,而不是落地页插件的布局里?
不直接,但或许你可以多解释一下你的想法,我会为你指明正确的方向。
我在想,我们是否可以让自定义落地页的内容直接加载到主 Ember 应用容器布局中,而不是使用落地页布局?
我知道 Discourse 现在可以将主题转换为静态页面,但我不希望页面顶部显示作者信息,也不希望页面 URL 嵌套在 /pub/ 下。
我有一个例子:我想通过自定义导航项组件在导航栏中链接到其中一个静态页面,但由于该路径 Ember 应用无法识别,点击标题栏中的链接时会显示 404 页面。如果直接访问页面 URL 则一切正常,但通过 Ember 应用内的链接则不行。
这个插件是否主要设计为仅适用于未登录或未注册的用户的静态落地页,而不支持在已登录用户的主应用布局中使用?
我明白了。
这是您希望在 Ember 中渲染落地页内容的唯一原因吗?如果是的话,我们可以用更轻量级的方式来实现。
谢谢。我希望能够在 Ember 应用布局中渲染 Discourse 内置页面或着陆页插件(landing pages plugin)的页面,作为面向站点成员的信息页面。
部分页面面向公众,可以在着陆页插件的布局中渲染;而其他页面则面向已登录用户,应在主应用布局中渲染,以便保留我对主应用所做的自定义设置,包括自定义导航项和用户菜单。
目前似乎没有任何现有的插件或 Discourse 核心功能可以实现这一点。所有方案似乎都为自定义页面使用各自的布局。您是否了解,这仅仅是现有解决方案开发者设定的用例限制,还是 Discourse 平台本身的限制?
我设想的做法大致是从某个 API 端点拉取自定义页面,并利用 slug 与 JavaScript 路由中的通配符回退路径进行匹配。
嗯,一旦你深入细节,你在这里提出的区分就会显得不那么合理了。
你能举个例子说明这类页面吗?确实,landing pages 插件不包含 Discourse 导航项和用户菜单,但如果你希望在页面中包含这些内容,最好的做法是在 Discourse 应用内部针对每个具体用例单独创建。试图在 landing page 中重新实现它们是没有意义的。
之所以没有通用的实现方法,是因为并不存在通用的用例。你可以采取多种方法,最佳方案取决于你想要实现的目标。最好是你更详细地说明你打算做什么,这样我才能给出更具体的建议。
好的,谢谢。我会这么做的😊
帖子已拆分为新主题:导入私有存储库时出错
您好,我无法安装示例主题,您能帮帮我吗?
您需要描述您做了什么以及尝试时发生了什么。
https://develcoder.com/join 我不明白为什么这部分
你好 @angus,我尝试在我的 Discourse 实例上安装这个插件,但在尝试重建应用时一直出现错误。这部分可能相关:
I, [2022-06-16T15:13:33.339825 #1] INFO -- : cd /var/www/discourse & su discourse -c 'bundle exec rake db:migrate'
rake aborted!
Gem::LoadError: can't activate jquery-rails-4.4.0, already activated jquery-rails-4.5.0
/var/www/discourse/lib/plugin_gem.rb:27:in `load'
/var/www/discourse/lib/plugin/instance.rb:773:in `gem'
/var/www/discourse/plugins/discourse-landing-pages/plugin.rb:20:in `activate!'
/var/www/discourse/lib/plugin/instance.rb:679:in `instance_eval'
/var/www/discourse/lib/plugin/instance.rb:679:in `activate!'
/var/www/discourse/lib/discourse.rb:279:in `block in activate_plugins!'
/var/www/discourse/lib/discourse.rb:276:in `each'
/var/www/discourse/lib/discourse.rb:276:in `activate_plugins!'
/var/www/discourse/config/application.rb:228:in `block in <class:Application>'
/var/www/discourse/lib/plugin.rb:6:in `initialization_guard'
/var/www/discourse/config/application.rb:227:in `<class:Application>'
/var/www/discourse/config/application.rb:81:in `<module:Discourse>'
/var/www/discourse/config/application.rb:80:in `<top (required)>'
/var/www/discourse/Rakefile:7:in `require'
/var/www/discourse/Rakefile:7:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
(See full trace by running task with --trace)
I, [2022-06-16T15:13:34.530066 #1] INFO -- : gem install jquery-rails -v 4.4.0 -i /var/www/discourse/plugins/discourse-landing-pages/gems/2.7.6 --no-document --ignore-dependencies --no-user-install
Successfully installed jquery-rails-4.4.0
1 gem installed
I, [2022-06-16T15:13:34.530330 #1] INFO -- : Terminating async processes
I, [2022-06-16T15:13:34.530366 #1] INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/13/bin/postmaster -D /etc/postgresql/13/main pid: 42
103:signal-handler (1655392414) Received SIGTERM scheduling shutdown...
I, [2022-06-16T15:13:34.530403 #1] INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 103
2022-06-16 15:13:34.530 UTC [42] LOG: received fast shutdown request
103:M 16 Jun 2022 15:13:34.546 # User requested shutdown...
103:M 16 Jun 2022 15:13:34.546 * Saving the final RDB snapshot before exiting.
2022-06-16 15:13:34.551 UTC [42] LOG: aborting any active transactions
2022-06-16 15:13:34.553 UTC [42] LOG: background worker "logical replication launcher" (PID 51) exited with exit code 1
2022-06-16 15:13:34.554 UTC [46] LOG: shutting down
103:M 16 Jun 2022 15:13:34.668 * DB saved on disk
103:M 16 Jun 2022 15:13:34.668 # Redis is now ready to exit, bye bye...
2022-06-16 15:13:34.724 UTC [42] LOG: database system is shut down
FAILED
--------------------
Pups::ExecError: cd /var/www/discourse & su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 1735 exit 1>
Location of failure: /usr/local/lib/ruby/gems/2.7.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
bootstrap failed with exit code 1
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.
bd8d903e1ec861801fdd32f7c35089aaebb97ca210dbe6eb5d584fc58379773e
我认为问题在于:Gem::LoadError: can't activate jquery-rails-4.4.0, already activated jquery-rails-4.5.0
这应该是一个简单的修复,对吧?只需要将 plugin.rb 中的依赖项从 gem "jquery-rails", "4.4.0" 更新为 gem "jquery-rails", "4.5.0"?
感谢这个插件。
该插件似乎已失效。不过,您可能需要等到七月的第一周才能获得补丁。
很高兴得知您从新冠中康复。感谢您在这种情况下修复了插件…… :拥抱: 多休息!
很遗憾,此插件即将停用,因此带有#end-of-life标签。我不会深入探讨技术细节,但鉴于discourse/discourse的一些变化以及Pavilion内部的整体工作量和资源分配,继续维护它已不再有意义。
该插件可与最新的tests-passed配合使用,但它将不再随着discourse/discourse的任何更改而更新。如果将来有人希望接手此项目,我很乐意与他们合作。
感谢您为此付出的努力;使用它非常有趣。
有人能指出 discourse/discourse 中我们可以转而关注的未来变化吗?
我很高兴!
啊,抱歉,我并不是说 discourse/discourse 中会有替代方案(尽管页面发布可能适合某些用例)。我的意思是,Discourse 的技术结构已经发生了变化,使得这个插件在没有大量工作来改变其工作结构的情况下是不可行的。我们目前在 Pavilion 有很多其他工作要做,我不能凭良心承诺在 Discourse 的任何进一步变化中维护此插件。
Pavilion 正在开发我们自己的新登陆页面。我们将使用 Hugo 而不是这个插件。