# 创建链接以用预填信息启动新主题

**URL:** https://meta.discourse.org/t/creating-a-link-to-start-a-new-topic-with-pre-filled-information/28074
**Category:** Using Discourse
**Tags:** how-to
**Created:** [2015年四月29日 08:13 UTC](https://meta.discourse.org/t/creating-a-link-to-start-a-new-topic-with-pre-filled-information/28074 "2015-04-29T08:13:45Z")
**Posts on this page:** 1
**Showing post:** 52

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [2024年九月10日 19:48 UTC](https://meta.discourse.org/t/creating-a-link-to-start-a-new-topic-with-pre-filled-information/28074/52 "2024-09-10T19:48:05Z")

</div>

这里有很多繁重且对普通人来说难以理解的技术工作；我敢打赌，我们可以创建一个“助手”网页，让人们轻松生成这些链接。

这可能是一个不错的项目，可以供某人实现：

```python
import urllib

site = 'meta.discourse.org'
title = '''My special checklist'''
category = 'todo'
tags = ['tag1', 'tag2']

template = '''\
# Important!

Do these things:

[] thing one
[] thing two
'''

query = urllib.parse.urlencode(dict(
    title = title,
    category = category,
    tags = ','.join(tags),
    body = template,
))
print(f'https://{site}/new-topic?{query}')

```

打印 [此链接](https://meta.discourse.org/new-topic?title=My+special+checklist&category=todo&tags=tag1%2Ctag2&body=%23+Important%21%0A%0ADo+these+things%3A%0A%0A%5B+%5D+thing+one%0A%5B+%5D+thing+two%0A)

---

_[View the full topic](https://meta.discourse.org/t/creating-a-link-to-start-a-new-topic-with-pre-filled-information/28074)._
