-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add /assets
as root dir of public files
#15219
Conversation
Signed-off-by: a1012112796 <[email protected]>
I think this is a great idea - just need to double check that this is all of the things. I do wonder if we should however migrate our URLs to use a non user name allowed character as the root (and explicitly exclude it in the reserved list for future safety) RFC 3986 allows the following in segments:
Although I think of these characters |
I think Is the PR complete? I think after it there should only be |
I think we can put serviceworker.js into https://developers.google.com/web/ilt/pwa/introduction-to-service-worker#registration_and_scope
Meaning the serviceworker is restricted to manage files under |
yes, If we want all words are useable user org, or repo name. we should make sure all One or two levels of routing has |
suggest remove some reserved words. Please check again. Thanks.
|
This could be another PR. |
@a1012112796 No, of some I know that they are used, the others should be very thoughly checked. |
I think there should be something missing, at least oauth2 login logos. maybe you can search "/img to find more. |
Patch to fix loading of webpack assets (like label color picker image): diff --git a/webpack.config.js b/webpack.config.js
index 53d553825..44d50a45e 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -185,17 +185,17 @@ export default {
test: /\.(ttf|woff2?)$/,
type: 'asset/resource',
generator: {
filename: 'fonts/[name][ext]',
- publicPath: '/', // required to remove css/ path segment
+ publicPath: '/assets/', // required to remove css/ path segment
}
},
{
test: /\.png$/i,
type: 'asset/resource',
generator: {
filename: 'img/webpack/[name][ext]',
- publicPath: '/', // required to remove css/ path segment
+ publicPath: '/assets/', // required to remove css/ path segment
}
},
],
}, |
Co-authored-by: silverwind <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hope we didn't miss any. Guess we will find out later if we did.
Codecov Report
@@ Coverage Diff @@
## master #15219 +/- ##
==========================================
+ Coverage 42.21% 43.83% +1.62%
==========================================
Files 767 677 -90
Lines 81624 81339 -285
==========================================
+ Hits 34458 35657 +1199
+ Misses 41531 39910 -1621
- Partials 5635 5772 +137
Continue to review full report at Codecov.
|
make lgtm work |
Codecov Report
@@ Coverage Diff @@
## master #15219 +/- ##
==========================================
- Coverage 43.91% 43.91% -0.01%
==========================================
Files 678 678
Lines 81741 81742 +1
==========================================
- Hits 35900 35895 -5
- Misses 39987 39998 +11
+ Partials 5854 5849 -5
Continue to review full report at Codecov.
|
Fixes regression from go-gitea#15219
Fixes another regression from go-gitea#15219.
Fixes another regression from #15219.
This PR moves root directory of public files from
/
to/assets
All pages and resources rendered from
custom/public
will now be rendered at/assets
instead of/
. This means that if you have aimpressum.html
- you need to update links to this to/assets/impressum.html
. Similarly for users of STL renderers and external markup renderers.Administrators should check custom templates to ensure that these are correct.
If you have previously placed
robots.txt
withincustom/public
you must move it tocustom
instead.