新的主题模板表单,是否像 GitHub Issue 模板?

Discourse 目前具有“分类模板”功能,可以预先填充“撰写器”。它很有用,但一个不错的改进是能够创建自定义的“新主题”表单,其中包含自定义字段,由 YAML 定义驱动,类似于 GitHub Issues 的定义

所以类似这样……

name: Bug Report
description: File a bug report
title: "[Bug]: "
labels: ["bug", "triage"]
assignees:
  - octocat
body:
  - type: markdown
    attributes:
      value: |
        Thanks for taking the time to fill out this bug report!
  - type: input
    id: contact
    attributes:
      label: Contact Details
      description: How can we get in touch with you if we need more info?
      placeholder: ex. email@example.com
    validations:
      required: false
  - type: textarea
    id: what-happened
    attributes:
      label: What happened?
      description: Also tell us, what did you expect to happen?
      placeholder: Tell us what you see!
      value: "A bug happened!"
    validations:
      required: true
  - type: dropdown
    id: version
    attributes:
      label: Version
      description: What version of our software are you running?
      options:
        - 1.0.2 (Default)
        - 1.0.3 (Edge)
    validations:
      required: true
  - type: dropdown
    id: browsers
    attributes:
      label: What browsers are you seeing the problem on?
      multiple: true
      options:
        - Firefox
        - Chrome
        - Safari
        - Microsoft Edge
  - type: textarea
    id: logs
    attributes:
      label: Relevant log output
      description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
      render: shell
  - type: checkboxes
    id: terms
    attributes:
      label: Code of Conduct
      description: By submitting this issue, you agree to follow our [Code of Conduct](https://example.com)
      options:
        - label: I agree to follow this project's Code of Conduct
          required: true

翻译成类似这样……

即使一个只支持一种字段类型(例如文本区域)的更基本版本,也将比当前的分类模板有很大的改进!

1 个赞

已经有这个了,有什么帮助吗?:

2 个赞

关于这个的自定义向导插件。

1 个赞

根据我的经验,Custom Wizard 插件并非此用例的理想解决方案。您会失去预览、主题建议弹出窗口以及其他一些功能。能够部分替代 Composer,同时保留整体流程和体验的方案,将是这里更好的解决方案。

1 个赞

请查看 Introducing Experimental Form Templates

2 个赞