Skip to content
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

Rename StaticUrlPrefix to AssetUrlPrefix #15779

Merged
merged 2 commits into from
May 8, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/templates/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func NewFuncMap() []template.FuncMap {
"AppSubUrl": func() string {
return setting.AppSubURL
},
"StaticUrlPrefix": func() string {
"AssetUrlPrefix": func() string {
return setting.StaticURLPrefix + "/assets"
},
"AppUrl": func() string {
Expand Down
18 changes: 9 additions & 9 deletions templates/admin/hook_new.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@
{{end}}
<div class="ui right">
{{if eq .HookType "gitea"}}
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/gitea.svg">
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/gitea.svg">
{{else if eq .HookType "gogs"}}
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/gogs.ico">
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/gogs.ico">
{{else if eq .HookType "slack"}}
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/slack.png">
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/slack.png">
{{else if eq .HookType "discord"}}
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/discord.png">
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/discord.png">
{{else if eq .HookType "dingtalk"}}
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/dingtalk.ico">
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/dingtalk.ico">
{{else if eq .HookType "telegram"}}
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/telegram.png">
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/telegram.png">
{{else if eq .HookType "msteams"}}
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/msteams.png">
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/msteams.png">
{{else if eq .HookType "feishu"}}
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/feishu.png">
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/feishu.png">
{{else if eq .HookType "matrix"}}
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/matrix.svg">
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/matrix.svg">
{{end}}
</div>
</h4>
Expand Down
12 changes: 6 additions & 6 deletions templates/base/footer.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@

{{template "base/footer_content" .}}
{{if .RequireSimpleMDE}}
<script src="{{StaticUrlPrefix}}/js/easymde.js?v={{MD5 AppVer}}"></script>
<script src="{{StaticUrlPrefix}}/vendor/plugins/codemirror/addon/mode/loadmode.js"></script>
<script src="{{StaticUrlPrefix}}/vendor/plugins/codemirror/mode/meta.js"></script>
<script src="{{AssetUrlPrefix}}/js/easymde.js?v={{MD5 AppVer}}"></script>
<script src="{{AssetUrlPrefix}}/vendor/plugins/codemirror/addon/mode/loadmode.js"></script>
<script src="{{AssetUrlPrefix}}/vendor/plugins/codemirror/mode/meta.js"></script>
<script>
CodeMirror.modeURL = '{{StaticUrlPrefix}}/vendor/plugins/codemirror/mode/%N/%N.js';
CodeMirror.modeURL = '{{AssetUrlPrefix}}/vendor/plugins/codemirror/mode/%N/%N.js';
</script>
{{end}}

<!-- Third-party libraries -->
{{if .RequireU2F}}
<script src="{{StaticUrlPrefix}}/vendor/plugins/u2f/index.js"></script>
<script src="{{AssetUrlPrefix}}/vendor/plugins/u2f/index.js"></script>
{{end}}
{{if .EnableCaptcha}}
{{if eq .CaptchaType "recaptcha"}}
Expand All @@ -32,7 +32,7 @@
<script src='https://hcaptcha.com/1/api.js' async></script>
{{end}}
{{end}}
<script src="{{StaticUrlPrefix}}/js/index.js?v={{MD5 AppVer}}"></script>
<script src="{{AssetUrlPrefix}}/js/index.js?v={{MD5 AppVer}}"></script>
{{template "custom/footer" .}}
</body>
</html>
2 changes: 1 addition & 1 deletion templates/base/footer_content.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{{end}}
</div>
</div>
<a href="{{StaticUrlPrefix}}/js/licenses.txt">{{.i18n.Tr "licenses"}}</a>
<a href="{{AssetUrlPrefix}}/js/licenses.txt">{{.i18n.Tr "licenses"}}</a>
{{if .EnableSwagger}}<a href="{{AppSubUrl}}/api/swagger">API</a>{{end}}
<a target="_blank" rel="noopener noreferrer" href="https://gitea.io">{{.i18n.Tr "website"}}</a>
{{template "custom/extra_links_footer" .}}
Expand Down
16 changes: 8 additions & 8 deletions templates/base/head.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
window.config = {
AppVer: '{{AppVer}}',
AppSubUrl: '{{AppSubUrl}}',
StaticUrlPrefix: '{{StaticUrlPrefix}}',
AssetUrlPrefix: '{{AssetUrlPrefix}}',
UseServiceWorker: {{UseServiceWorker}},
csrf: '{{.CsrfToken}}',
HighlightJS: {{if .RequireHighlightJS}}true{{else}}false{{end}},
Expand Down Expand Up @@ -61,12 +61,12 @@
{{end}}
};
</script>
<link rel="icon" href="{{StaticUrlPrefix}}/img/logo.svg" type="image/svg+xml">
<link rel="alternate icon" href="{{StaticUrlPrefix}}/img/favicon.png" type="image/png">
<link rel="icon" href="{{AssetUrlPrefix}}/img/logo.svg" type="image/svg+xml">
<link rel="alternate icon" href="{{AssetUrlPrefix}}/img/favicon.png" type="image/png">
{{if .RequireSimpleMDE}}
<link rel="stylesheet" href="{{StaticUrlPrefix}}/css/easymde.css?v={{MD5 AppVer}}">
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/easymde.css?v={{MD5 AppVer}}">
{{end}}
<link rel="stylesheet" href="{{StaticUrlPrefix}}/css/index.css?v={{MD5 AppVer}}">
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/index.css?v={{MD5 AppVer}}">
<noscript>
<style>
.dropdown:hover > .menu { display: block; }
Expand Down Expand Up @@ -105,17 +105,17 @@
{{else}}
<meta property="og:title" content="{{AppName}}">
<meta property="og:type" content="website" />
<meta property="og:image" content="{{StaticUrlPrefix}}/img/logo.png" />
<meta property="og:image" content="{{AssetUrlPrefix}}/img/logo.png" />
<meta property="og:url" content="{{AppUrl}}" />
<meta property="og:description" content="{{MetaDescription}}">
{{end}}
<meta property="og:site_name" content="{{AppName}}" />
{{if .IsSigned }}
{{ if ne .SignedUser.Theme "gitea" }}
<link rel="stylesheet" href="{{StaticUrlPrefix}}/css/theme-{{.SignedUser.Theme}}.css?v={{MD5 AppVer}}">
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/theme-{{.SignedUser.Theme}}.css?v={{MD5 AppVer}}">
{{end}}
{{else if ne DefaultTheme "gitea"}}
<link rel="stylesheet" href="{{StaticUrlPrefix}}/css/theme-{{DefaultTheme}}.css?v={{MD5 AppVer}}">
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/theme-{{DefaultTheme}}.css?v={{MD5 AppVer}}">
{{end}}
{{template "custom/header" .}}
</head>
Expand Down
2 changes: 1 addition & 1 deletion templates/base/head_navbar.tmpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="ui container" id="navbar">
<div class="item brand" style="justify-content: space-between;">
<a href="{{AppSubUrl}}/">
<img class="ui mini image" with="30" height="30" src="{{StaticUrlPrefix}}/img/logo.svg">
<img class="ui mini image" with="30" height="30" src="{{AssetUrlPrefix}}/img/logo.svg">
</a>
<div class="ui basic icon button mobile-only" id="navbar-expand-toggle">
<i class="sidebar icon"></i>
Expand Down
2 changes: 1 addition & 1 deletion templates/home.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="ui stackable middle very relaxed page grid">
<div class="sixteen wide center aligned centered column">
<div>
<img class="logo" width="220" height="220" src="{{StaticUrlPrefix}}/img/logo.svg"/>
<img class="logo" width="220" height="220" src="{{AssetUrlPrefix}}/img/logo.svg"/>
</div>
<div class="hero">
<h1 class="ui icon header title">
Expand Down
2 changes: 1 addition & 1 deletion templates/install.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -321,5 +321,5 @@
</div>
</div>
</div>
<img style="display: none" src="{{StaticUrlPrefix}}/img/loading.png"/>
<img style="display: none" src="{{AssetUrlPrefix}}/img/loading.png"/>
{{template "base/footer" .}}
18 changes: 9 additions & 9 deletions templates/org/settings/hook_new.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@
{{if .PageIsSettingsHooksNew}}{{.i18n.Tr "repo.settings.add_webhook"}}{{else}}{{.i18n.Tr "repo.settings.update_webhook"}}{{end}}
<div class="ui right">
{{if eq .HookType "gitea"}}
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/gitea.svg">
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/gitea.svg">
{{else if eq .HookType "gogs"}}
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/gogs.ico">
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/gogs.ico">
{{else if eq .HookType "slack"}}
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/slack.png">
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/slack.png">
{{else if eq .HookType "discord"}}
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/discord.png">
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/discord.png">
{{else if eq .HookType "dingtalk"}}
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/dingtalk.ico">
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/dingtalk.ico">
{{else if eq .HookType "telegram"}}
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/telegram.png">
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/telegram.png">
{{else if eq .HookType "msteams"}}
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/msteams.png">
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/msteams.png">
{{else if eq .HookType "feishu"}}
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/feishu.png">
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/feishu.png">
{{else if eq .HookType "matrix"}}
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/matrix.svg">
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/matrix.svg">
{{end}}
</div>
</h4>
Expand Down
2 changes: 1 addition & 1 deletion templates/post-install.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="ui stackable middle very relaxed page grid">
<div id="repo_migrating" class="sixteen wide center aligned centered column">
<div>
<img src="{{StaticUrlPrefix}}/img/loading.png"/>
<img src="{{AssetUrlPrefix}}/img/loading.png"/>
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions templates/repo/migrate/migrating.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
<div class="ui stackable middle very relaxed page grid">
<div id="repo_migrating" class="sixteen wide center aligned centered column" task="{{.MigrateTask.ID}}">
<div>
<img src="{{StaticUrlPrefix}}/img/loading.png"/>
<img src="{{AssetUrlPrefix}}/img/loading.png"/>
</div>
</div>
<div id="repo_migrating_failed_image" class="sixteen wide center aligned centered column" style="display: none;">
<div>
<img src="{{StaticUrlPrefix}}/img/failed.png"/>
<img src="{{AssetUrlPrefix}}/img/failed.png"/>
</div>
</div>
</div>
Expand Down
18 changes: 9 additions & 9 deletions templates/repo/settings/webhook/base_list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,31 @@
<div class="ui blue tiny button">{{.i18n.Tr "repo.settings.add_webhook"}}</div>
<div class="menu">
<a class="item" href="{{.BaseLinkNew}}/gitea/new">
<img width="20" height="20" src="{{StaticUrlPrefix}}/img/gitea.svg">Gitea
<img width="20" height="20" src="{{AssetUrlPrefix}}/img/gitea.svg">Gitea
</a>
<a class="item" href="{{.BaseLinkNew}}/gogs/new">
<img width="20" height="20" src="{{StaticUrlPrefix}}/img/gogs.ico">Gogs
<img width="20" height="20" src="{{AssetUrlPrefix}}/img/gogs.ico">Gogs
</a>
<a class="item" href="{{.BaseLinkNew}}/slack/new">
<img width="20" height="20" src="{{StaticUrlPrefix}}/img/slack.png">Slack
<img width="20" height="20" src="{{AssetUrlPrefix}}/img/slack.png">Slack
</a>
<a class="item" href="{{.BaseLinkNew}}/discord/new">
<img width="20" height="20" src="{{StaticUrlPrefix}}/img/discord.png">Discord
<img width="20" height="20" src="{{AssetUrlPrefix}}/img/discord.png">Discord
</a>
<a class="item" href="{{.BaseLinkNew}}/dingtalk/new">
<img width="20" height="20" src="{{StaticUrlPrefix}}/img/dingtalk.ico">Dingtalk
<img width="20" height="20" src="{{AssetUrlPrefix}}/img/dingtalk.ico">Dingtalk
</a>
<a class="item" href="{{.BaseLinkNew}}/telegram/new">
<img width="20" height="20" src="{{StaticUrlPrefix}}/img/telegram.png">Telegram
<img width="20" height="20" src="{{AssetUrlPrefix}}/img/telegram.png">Telegram
</a>
<a class="item" href="{{.BaseLinkNew}}/msteams/new">
<img width="20" height="20" src="{{StaticUrlPrefix}}/img/msteams.png">Microsoft Teams
<img width="20" height="20" src="{{AssetUrlPrefix}}/img/msteams.png">Microsoft Teams
</a>
<a class="item" href="{{.BaseLinkNew}}/feishu/new">
<img width="20" height="20" src="{{StaticUrlPrefix}}/img/feishu.png">Feishu
<img width="20" height="20" src="{{AssetUrlPrefix}}/img/feishu.png">Feishu
</a>
<a class="item" href="{{.BaseLinkNew}}/matrix/new">
<img width="20" height="20" src="{{StaticUrlPrefix}}/img/matrix.svg">Matrix
<img width="20" height="20" src="{{AssetUrlPrefix}}/img/matrix.svg">Matrix
</a>
</div>
</div>
Expand Down
18 changes: 9 additions & 9 deletions templates/repo/settings/webhook/new.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@
{{if .PageIsSettingsHooksNew}}{{.i18n.Tr "repo.settings.add_webhook"}}{{else}}{{.i18n.Tr "repo.settings.update_webhook"}}{{end}}
<div class="ui right">
{{if eq .HookType "gitea"}}
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/gitea.svg">
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/gitea.svg">
{{else if eq .HookType "gogs"}}
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/gogs.ico">
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/gogs.ico">
{{else if eq .HookType "slack"}}
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/slack.png">
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/slack.png">
{{else if eq .HookType "discord"}}
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/discord.png">
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/discord.png">
{{else if eq .HookType "dingtalk"}}
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/dingtalk.ico">
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/dingtalk.ico">
{{else if eq .HookType "telegram"}}
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/telegram.png">
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/telegram.png">
{{else if eq .HookType "msteams"}}
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/msteams.png">
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/msteams.png">
{{else if eq .HookType "feishu"}}
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/feishu.png">
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/feishu.png">
{{else if eq .HookType "matrix"}}
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/matrix.svg">
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/matrix.svg">
{{end}}
</div>
</h4>
Expand Down
2 changes: 1 addition & 1 deletion templates/repo/view_file.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<strong>{{.i18n.Tr "repo.audio_not_supported_in_browser"}}</strong>
</audio>
{{else if .IsPDFFile}}
<iframe width="100%" height="600px" src="{{StaticUrlPrefix}}/vendor/plugins/pdfjs/web/viewer.html?file={{EscapePound $.RawFileLink}}"></iframe>
<iframe width="100%" height="600px" src="{{AssetUrlPrefix}}/vendor/plugins/pdfjs/web/viewer.html?file={{EscapePound $.RawFileLink}}"></iframe>
{{else}}
<a href="{{EscapePound $.RawFileLink}}" rel="nofollow" class="btn btn-gray btn-radius">{{.i18n.Tr "repo.file_view_raw"}}</a>
{{end}}
Expand Down
2 changes: 1 addition & 1 deletion templates/status/404.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="page-content ui container center full-screen-width {{if .IsRepo}}repository{{end}}">
{{if .IsRepo}}{{template "repo/header" .}}{{end}}
<div class="ui container center">
<p style="margin-top: 100px"><img class="ui centered image" src="{{StaticUrlPrefix}}/img/404.png" alt="404"/></p>
<p style="margin-top: 100px"><img class="ui centered image" src="{{AssetUrlPrefix}}/img/404.png" alt="404"/></p>
<div class="ui divider"></div>
<br>
<p>{{.i18n.Tr "error404" | Safe}}
Expand Down
2 changes: 1 addition & 1 deletion templates/status/500.tmpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{template "base/head" .}}
<div class="page-content ui container full-screen-width center">
<p style="margin-top: 100px"><img class="ui centered image" src="{{StaticUrlPrefix}}/img/500.png" alt="500"/></p>
<p style="margin-top: 100px"><img class="ui centered image" src="{{AssetUrlPrefix}}/img/500.png" alt="500"/></p>
<div class="ui divider"></div>
<br>
{{if .ErrorMsg}}<p>{{.i18n.Tr "error.occurred"}}:</p>
Expand Down
4 changes: 2 additions & 2 deletions templates/swagger/ui.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<head>
<meta charset="UTF-8">
<title>Gitea API</title>
<link href="{{StaticUrlPrefix}}/css/swagger.css?v={{MD5 AppVer}}" rel="stylesheet">
<link href="{{AssetUrlPrefix}}/css/swagger.css?v={{MD5 AppVer}}" rel="stylesheet">
</head>
<body>
<a class="swagger-back-link" href="{{AppUrl}}">{{svg "octicon-reply"}}{{.i18n.Tr "return_to_gitea"}}</a>
<div id="swagger-ui" data-source="{{AppUrl}}swagger.{{.APIJSONVersion}}.json"></div>
<script src="{{StaticUrlPrefix}}/js/swagger.js?v={{MD5 AppVer}}"></script>
<script src="{{AssetUrlPrefix}}/js/swagger.js?v={{MD5 AppVer}}"></script>
</body>
</html>
4 changes: 2 additions & 2 deletions web_src/js/features/emoji.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import emojis from '../../../assets/emoji.json';

const {StaticUrlPrefix} = window.config;
const {AssetUrlPrefix} = window.config;

const tempMap = {gitea: ':gitea:'};
for (const {emoji, aliases} of emojis) {
Expand All @@ -24,7 +24,7 @@ for (const key of emojiKeys) {
export function emojiHTML(name) {
let inner;
if (name === 'gitea') {
inner = `<img alt=":${name}:" src="${StaticUrlPrefix}/img/emoji/gitea.png">`;
inner = `<img alt=":${name}:" src="${AssetUrlPrefix}/img/emoji/gitea.png">`;
} else {
inner = emojiString(name);
}
Expand Down
2 changes: 1 addition & 1 deletion web_src/js/features/serviceworker.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default async function initServiceWorker() {

if (UseServiceWorker) {
try {
// normally we'd serve the service worker as a static asset from StaticUrlPrefix but
// normally we'd serve the service worker as a static asset from AssetUrlPrefix but
// the spec strictly requires it to be same-origin so it has to be AppSubUrl to work
await Promise.all([
checkCacheValidity(),
Expand Down
4 changes: 2 additions & 2 deletions web_src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {renderMarkupContent} from './markup/content.js';
import {stripTags, mqBinarySearch} from './utils.js';
import {svg, svgs} from './svg.js';

const {AppSubUrl, StaticUrlPrefix, csrf} = window.config;
const {AppSubUrl, AssetUrlPrefix, csrf} = window.config;

let previewFileModes;
const commentMDEditors = {};
Expand Down Expand Up @@ -3132,7 +3132,7 @@ function initVueComponents() {
finalPage: 1,
searchQuery,
isLoading: false,
staticPrefix: StaticUrlPrefix,
staticPrefix: AssetUrlPrefix,
counts: {},
repoTypes: {
all: {
Expand Down
6 changes: 3 additions & 3 deletions web_src/js/publicpath.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// This sets up the URL prefix used in webpack's chunk loading.
// This file must be imported before any lazy-loading is being attempted.
const {StaticUrlPrefix} = window.config;
const {AssetUrlPrefix} = window.config;

if (StaticUrlPrefix) {
__webpack_public_path__ = StaticUrlPrefix.endsWith('/') ? StaticUrlPrefix : `${StaticUrlPrefix}/`;
if (AssetUrlPrefix) {
__webpack_public_path__ = AssetUrlPrefix.endsWith('/') ? AssetUrlPrefix : `${AssetUrlPrefix}/`;
} else {
const url = new URL(document.currentScript.src);
__webpack_public_path__ = url.pathname.replace(/\/[^/]*?\/[^/]*?$/, '/');
Expand Down