Statisch bestand genereren in Discourse

AI-generated summary

The discussion revolves around uploading and making a static file publicly accessible in Discourse. Caesar_Chi asks how to upload a plain text or CSS file for public download, wondering if admin permissions are required. pfaffman suggests checking Page Publishing but notes there’s no easy way. awesomerobot explains that code can be formatted using backticks for syntax highlighting, but Caesar_Chi clarifies he wants a pure text file, like a raw GitHub link. pfaffman suggests adding file types to the authorized extensions setting, though this may cause downloads rather than rendering. Caesar_Chi concludes that the goal may not be achievable and mentions needing the sitemap.html plugin. codinghorror adds that sitemap is a business-level plugin not available on standard hosting.

Hi,

I want to know how to upload a static file, and make this file public for all guest download.
Do I need the admin permission? or normal user can upload it ?

Please give us the feedback,
Thanks,
Caesar

There isn’t an easy way.

What problem is that solving?

You might check out Page Publishing.

Thanks for the reply, but in my hope, I want to write down or upload a CSS or pure text in the discourse without any style.

It seems the publish post with the default styling, not pure text.

I might be misunderstanding, but do you want it formatted as code and not standard text?

html {
  background: red;
}

You can do that by surrounding your CSS with backticks like this:

```css
html {
background: red;
}
```

Maybe there is a little misunderstanding, my expectation like user enter the public link can see totally pure text, for example,

https://raw.githubusercontent.com/hakimel/css/master/device-loop/style.css

How can I do this by publishing post or any suggestion?

I’m still not clear just what you want, but perhaps you want to allow users to upload other file types? To do that you’d add to the authorized extensions site setting.

But if you want Discourse to serve a file like the github link that you linked to, I’m not aware of a way to have a user do that. (I’m not quite sure what happens if you make css an authorized extension–I think that the browser will download rather than render the page).

thanks everyone reply, seem that can not reach, i still need to install the https://www.discourse.org/plugins/sitemap.html

If you are on our hosting, sitemap is a business level plugin – it’s not offered on the standard tier.