From faa28b5a44912f1c63afddab9396bae9e6fe061c Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Wed, 19 Jul 2023 00:06:43 +0800 Subject: Move public asset files to the proper directory (#25907) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move `public/*` to `public/assets/*` Some old PRs (like #15219) introduced inconsistent directory system. For example: why the local directory "public" is accessed by `http://site/assets`? How to serve the ".well-known" files properly in the public directory? For convention rules, the "public" directory is widely used for the website's root directory. It shouldn't be an exception for Gitea. So, this PR makes the things consistent: * `http://site/assets/foo` means `{CustomPath}/public/assets/foo`. * `{CustomPath}/public/.well-known` and `{CustomPath}/public/robots.txt` can be used in the future. This PR is also a prerequisite for a clear solution for: * #21942 * #25892 * discourse.gitea.io: [.well-known path serving custom files behind proxy?](https://discourse.gitea.io/t/well-known-path-serving-custom-files-behind-proxy/5445/1) This PR is breaking for users who have custom "public" files (CSS/JS). After getting approvals, I will update the documents. ---- ## ⚠️ BREAKING ⚠️ If you have files in your "custom/public/" folder, please move them to "custom/public/assets/". --------- Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Giteabot --- docs/content/doc/help/faq.en-us.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/content/doc/help') diff --git a/docs/content/doc/help/faq.en-us.md b/docs/content/doc/help/faq.en-us.md index ae59a9b880..d0c4de61f5 100644 --- a/docs/content/doc/help/faq.en-us.md +++ b/docs/content/doc/help/faq.en-us.md @@ -192,7 +192,7 @@ To add your own theme, currently the only way is to provide a complete theme (no As an example, let's say our theme is `arc-blue` (this is a real theme, and can be found [in this issue](https://github.com/go-gitea/gitea/issues/6011)) -Name the `.css` file `theme-arc-blue.css` and add it to your custom folder in `custom/public/css` +Name the `.css` file `theme-arc-blue.css` and add it to your custom folder in `custom/public/assets/css` Allow users to use it by adding `arc-blue` to the list of `THEMES` in your `app.ini` -- cgit v1.2.3