Browse Source

Move public asset files to the proper directory (#25907)

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 <teabot@gitea.io>
tags/v1.21.0-rc0
wxiaoguang 9 months ago
parent
commit
faa28b5a44
No account linked to committer's email address
100 changed files with 52 additions and 50 deletions
  1. 4
    4
      .dockerignore
  2. 1
    1
      .gitattributes
  3. 4
    4
      .gitignore
  4. 3
    3
      Makefile
  5. 1
    1
      README.md
  6. 1
    1
      README_ZH.md
  7. 7
    7
      build/generate-images.js
  8. 3
    3
      build/generate-svg.js
  9. 2
    2
      custom/conf/app.example.ini
  10. 3
    3
      docs/content/doc/administration/cmd-embedded.en-us.md
  11. 2
    2
      docs/content/doc/administration/config-cheat-sheet.en-us.md
  12. 15
    13
      docs/content/doc/administration/customizing-gitea.en-us.md
  13. 1
    1
      docs/content/doc/administration/external-renderers.en-us.md
  14. 1
    1
      docs/content/doc/development/hacking-on-gitea.en-us.md
  15. 1
    1
      docs/content/doc/help/faq.en-us.md
  16. 1
    1
      modules/public/public.go
  17. 2
    2
      modules/svg/svg.go
  18. 0
    0
      public/assets/img/404.png
  19. 0
    0
      public/assets/img/500.png
  20. 0
    0
      public/assets/img/apple-touch-icon.png
  21. 0
    0
      public/assets/img/avatar_default.png
  22. 0
    0
      public/assets/img/checkmark.png
  23. 0
    0
      public/assets/img/dingtalk.ico
  24. 0
    0
      public/assets/img/discord.png
  25. 0
    0
      public/assets/img/emoji/codeberg.png
  26. 0
    0
      public/assets/img/emoji/git.png
  27. 0
    0
      public/assets/img/emoji/gitea.png
  28. 0
    0
      public/assets/img/emoji/github.png
  29. 0
    0
      public/assets/img/emoji/gitlab.png
  30. 0
    0
      public/assets/img/emoji/gogs.png
  31. 0
    0
      public/assets/img/failed.png
  32. 0
    0
      public/assets/img/favicon.png
  33. 0
    0
      public/assets/img/favicon.svg
  34. 0
    0
      public/assets/img/feishu.png
  35. 0
    0
      public/assets/img/gitea.svg
  36. 0
    0
      public/assets/img/gogs.ico
  37. 0
    0
      public/assets/img/loading.png
  38. 0
    0
      public/assets/img/logo.png
  39. 0
    0
      public/assets/img/logo.svg
  40. 0
    0
      public/assets/img/msteams.png
  41. 0
    0
      public/assets/img/openid-16x16.png
  42. 0
    0
      public/assets/img/packagist.png
  43. 0
    0
      public/assets/img/repo_default.png
  44. 0
    0
      public/assets/img/slack.png
  45. 0
    0
      public/assets/img/svg/fontawesome-openid.svg
  46. 0
    0
      public/assets/img/svg/fontawesome-save.svg
  47. 0
    0
      public/assets/img/svg/fontawesome-send.svg
  48. 0
    0
      public/assets/img/svg/fontawesome-windows.svg
  49. 0
    0
      public/assets/img/svg/gitea-alpine.svg
  50. 0
    0
      public/assets/img/svg/gitea-azuread.svg
  51. 0
    0
      public/assets/img/svg/gitea-azureadv2.svg
  52. 0
    0
      public/assets/img/svg/gitea-bitbucket.svg
  53. 0
    0
      public/assets/img/svg/gitea-cargo.svg
  54. 0
    0
      public/assets/img/svg/gitea-chef.svg
  55. 0
    0
      public/assets/img/svg/gitea-codebase.svg
  56. 0
    0
      public/assets/img/svg/gitea-composer.svg
  57. 0
    0
      public/assets/img/svg/gitea-conan.svg
  58. 0
    0
      public/assets/img/svg/gitea-conda.svg
  59. 0
    0
      public/assets/img/svg/gitea-cran.svg
  60. 0
    0
      public/assets/img/svg/gitea-debian.svg
  61. 0
    0
      public/assets/img/svg/gitea-discord.svg
  62. 0
    0
      public/assets/img/svg/gitea-double-chevron-left.svg
  63. 0
    0
      public/assets/img/svg/gitea-double-chevron-right.svg
  64. 0
    0
      public/assets/img/svg/gitea-dropbox.svg
  65. 0
    0
      public/assets/img/svg/gitea-empty-checkbox.svg
  66. 0
    0
      public/assets/img/svg/gitea-exclamation.svg
  67. 0
    0
      public/assets/img/svg/gitea-facebook.svg
  68. 0
    0
      public/assets/img/svg/gitea-git.svg
  69. 0
    0
      public/assets/img/svg/gitea-gitbucket.svg
  70. 0
    0
      public/assets/img/svg/gitea-gitea.svg
  71. 0
    0
      public/assets/img/svg/gitea-gitlab.svg
  72. 0
    0
      public/assets/img/svg/gitea-go.svg
  73. 0
    0
      public/assets/img/svg/gitea-gogs.svg
  74. 0
    0
      public/assets/img/svg/gitea-google.svg
  75. 0
    0
      public/assets/img/svg/gitea-helm.svg
  76. 0
    0
      public/assets/img/svg/gitea-join.svg
  77. 0
    0
      public/assets/img/svg/gitea-lock-cog.svg
  78. 0
    0
      public/assets/img/svg/gitea-lock.svg
  79. 0
    0
      public/assets/img/svg/gitea-mastodon.svg
  80. 0
    0
      public/assets/img/svg/gitea-matrix.svg
  81. 0
    0
      public/assets/img/svg/gitea-maven.svg
  82. 0
    0
      public/assets/img/svg/gitea-microsoftonline.svg
  83. 0
    0
      public/assets/img/svg/gitea-nextcloud.svg
  84. 0
    0
      public/assets/img/svg/gitea-npm.svg
  85. 0
    0
      public/assets/img/svg/gitea-nuget.svg
  86. 0
    0
      public/assets/img/svg/gitea-onedev.svg
  87. 0
    0
      public/assets/img/svg/gitea-openid.svg
  88. 0
    0
      public/assets/img/svg/gitea-pub.svg
  89. 0
    0
      public/assets/img/svg/gitea-python.svg
  90. 0
    0
      public/assets/img/svg/gitea-rpm.svg
  91. 0
    0
      public/assets/img/svg/gitea-rubygems.svg
  92. 0
    0
      public/assets/img/svg/gitea-split.svg
  93. 0
    0
      public/assets/img/svg/gitea-swift.svg
  94. 0
    0
      public/assets/img/svg/gitea-twitter.svg
  95. 0
    0
      public/assets/img/svg/gitea-unlock.svg
  96. 0
    0
      public/assets/img/svg/gitea-vagrant.svg
  97. 0
    0
      public/assets/img/svg/gitea-vscode.svg
  98. 0
    0
      public/assets/img/svg/gitea-whitespace.svg
  99. 0
    0
      public/assets/img/svg/gitea-yandex.svg
  100. 0
    0
      public/assets/img/svg/material-invert-colors.svg

+ 4
- 4
.dockerignore View File

@@ -75,10 +75,10 @@ cpu.out
/yarn.lock
/yarn-error.log
/npm-debug.log*
/public/js
/public/css
/public/fonts
/public/img/webpack
/public/assets/js
/public/assets/css
/public/assets/fonts
/public/assets/img/webpack
/vendor
/web_src/fomantic/node_modules
/web_src/fomantic/build/*

+ 1
- 1
.gitattributes View File

@@ -1,7 +1,7 @@
* text=auto eol=lf
*.tmpl linguist-language=Handlebars
/assets/*.json linguist-generated
/public/img/svg/*.svg linguist-generated
/public/assets/img/svg/*.svg linguist-generated
/templates/swagger/v1_json.tmpl linguist-generated
/vendor/** -text -eol linguist-vendored
/web_src/fomantic/build/** linguist-generated

+ 4
- 4
.gitignore View File

@@ -72,10 +72,10 @@ cpu.out
/yarn.lock
/yarn-error.log
/npm-debug.log*
/public/js
/public/css
/public/fonts
/public/img/webpack
/public/assets/js
/public/assets/css
/public/assets/fonts
/public/assets/img/webpack
/vendor
/web_src/fomantic/node_modules
/web_src/fomantic/build/*

+ 3
- 3
Makefile View File

@@ -116,15 +116,15 @@ FOMANTIC_WORK_DIR := web_src/fomantic

WEBPACK_SOURCES := $(shell find web_src/js web_src/css -type f)
WEBPACK_CONFIGS := webpack.config.js
WEBPACK_DEST := public/js/index.js public/css/index.css
WEBPACK_DEST_ENTRIES := public/js public/css public/fonts public/img/webpack
WEBPACK_DEST := public/assets/js/index.js public/assets/css/index.css
WEBPACK_DEST_ENTRIES := public/assets/js public/assets/css public/assets/fonts public/assets/img/webpack

BINDATA_DEST := modules/public/bindata.go modules/options/bindata.go modules/templates/bindata.go
BINDATA_HASH := $(addsuffix .hash,$(BINDATA_DEST))

GENERATED_GO_DEST := modules/charset/invisible_gen.go modules/charset/ambiguous_gen.go

SVG_DEST_DIR := public/img/svg
SVG_DEST_DIR := public/assets/img/svg

AIR_TMP_DIR := .air


+ 1
- 1
README.md View File

@@ -1,6 +1,6 @@
<p align="center">
<a href="https://gitea.io/">
<img alt="Gitea" src="https://raw.githubusercontent.com/go-gitea/gitea/main/public/img/gitea.svg" width="220"/>
<img alt="Gitea" src="https://raw.githubusercontent.com/go-gitea/gitea/main/public/assets/img/gitea.svg" width="220"/>
</a>
</p>
<h1 align="center">Gitea - Git with a cup of tea</h1>

+ 1
- 1
README_ZH.md View File

@@ -1,6 +1,6 @@
<p align="center">
<a href="https://gitea.io/">
<img alt="Gitea" src="https://raw.githubusercontent.com/go-gitea/gitea/main/public/img/gitea.svg" width="220"/>
<img alt="Gitea" src="https://raw.githubusercontent.com/go-gitea/gitea/main/public/assets/img/gitea.svg" width="220"/>
</a>
</p>
<h1 align="center">Gitea - Git with a cup of tea</h1>

+ 7
- 7
build/generate-images.js View File

@@ -69,13 +69,13 @@ async function main() {
const faviconSvg = await readFile(new URL('../assets/favicon.svg', import.meta.url), 'utf8');

await Promise.all([
generate(logoSvg, '../public/img/logo.svg', {size: 32}),
generate(logoSvg, '../public/img/logo.png', {size: 512}),
generate(faviconSvg, '../public/img/favicon.svg', {size: 32}),
generate(faviconSvg, '../public/img/favicon.png', {size: 180}),
generate(logoSvg, '../public/img/avatar_default.png', {size: 200}),
generate(logoSvg, '../public/img/apple-touch-icon.png', {size: 180, bg: true}),
gitea && generate(logoSvg, '../public/img/gitea.svg', {size: 32}),
generate(logoSvg, '../public/assets/img/logo.svg', {size: 32}),
generate(logoSvg, '../public/assets/img/logo.png', {size: 512}),
generate(faviconSvg, '../public/assets/img/favicon.svg', {size: 32}),
generate(faviconSvg, '../public/assets/img/favicon.png', {size: 180}),
generate(logoSvg, '../public/assets/img/avatar_default.png', {size: 200}),
generate(logoSvg, '../public/assets/img/apple-touch-icon.png', {size: 180, bg: true}),
gitea && generate(logoSvg, '../public/assets/img/gitea.svg', {size: 32}),
]);
}


+ 3
- 3
build/generate-svg.js View File

@@ -44,7 +44,7 @@ async function processFile(file, {prefix, fullName} = {}) {
],
});

await writeFile(fileURLToPath(new URL(`../public/img/svg/${name}.svg`, import.meta.url)), data);
await writeFile(fileURLToPath(new URL(`../public/assets/img/svg/${name}.svg`, import.meta.url)), data);
}

function processFiles(pattern, opts) {
@@ -53,13 +53,13 @@ function processFiles(pattern, opts) {

async function main() {
try {
await mkdir(fileURLToPath(new URL('../public/img/svg', import.meta.url)), {recursive: true});
await mkdir(fileURLToPath(new URL('../public/assets/img/svg', import.meta.url)), {recursive: true});
} catch {}

await Promise.all([
...processFiles('node_modules/@primer/octicons/build/svg/*-16.svg', {prefix: 'octicon'}),
...processFiles('web_src/svg/*.svg'),
...processFiles('public/img/gitea.svg', {fullName: 'gitea-gitea'}),
...processFiles('public/assets/img/gitea.svg', {fullName: 'gitea-gitea'}),
]);
}


+ 2
- 2
custom/conf/app.example.ini View File

@@ -1200,11 +1200,11 @@ LEVEL = Info
;;
;; All available reactions users can choose on issues/prs and comments.
;; Values can be emoji alias (:smile:) or a unicode emoji.
;; For custom reactions, add a tightly cropped square image to public/img/emoji/reaction_name.png
;; For custom reactions, add a tightly cropped square image to public/assets/img/emoji/reaction_name.png
;REACTIONS = +1, -1, laugh, hooray, confused, heart, rocket, eyes
;;
;; Additional Emojis not defined in the utf8 standard
;; By default we support gitea (:gitea:), to add more copy them to public/img/emoji/emoji_name.png and add it to this config.
;; By default we support gitea (:gitea:), to add more copy them to public/assets/img/emoji/emoji_name.png and add it to this config.
;; Dont mistake it for Reactions.
;CUSTOM_EMOJIS = gitea, codeberg, gitlab, git, github, gogs
;;

+ 3
- 3
docs/content/doc/administration/cmd-embedded.en-us.md View File

@@ -47,7 +47,7 @@ for its glob syntax. Here are some examples:

- List all template files, in any virtual directory: `**.tmpl`
- List all mail template files: `templates/mail/**.tmpl`
- List all files inside `public/img`: `public/img/**`
- List all files inside `public/assets/img`: `public/assets/img/**`

Don't forget to use quotes for the patterns, as spaces, `*` and other characters might have
a special meaning for your command shell.
@@ -60,8 +60,8 @@ Listing all embedded files with `openid` in their path:

```sh
$ gitea embedded list '**openid**'
public/img/auth/openid_connect.svg
public/img/openid-16x16.png
public/assets/img/auth/openid_connect.svg
public/assets/img/openid-16x16.png
templates/user/auth/finalize_openid.tmpl
templates/user/auth/signin_openid.tmpl
templates/user/auth/signup_openid_connect.tmpl

+ 2
- 2
docs/content/doc/administration/config-cheat-sheet.en-us.md View File

@@ -224,9 +224,9 @@ The following configuration set `Content-Type: application/vnd.android.package-a
- `MAX_DISPLAY_FILE_SIZE`: **8388608**: Max size of files to be displayed (default is 8MiB)
- `REACTIONS`: All available reactions users can choose on issues/prs and comments
Values can be emoji alias (:smile:) or a unicode emoji.
For custom reactions, add a tightly cropped square image to public/img/emoji/reaction_name.png
For custom reactions, add a tightly cropped square image to public/assets/img/emoji/reaction_name.png
- `CUSTOM_EMOJIS`: **gitea, codeberg, gitlab, git, github, gogs**: Additional Emojis not defined in the utf8 standard.
By default, we support Gitea (:gitea:), to add more copy them to public/img/emoji/emoji_name.png and
By default, we support Gitea (:gitea:), to add more copy them to public/assets/img/emoji/emoji_name.png and
add it to this config.
- `DEFAULT_SHOW_FULL_NAME`: **false**: Whether the full name of the users should be shown where possible. If the full name isn't set, the username will be used.
- `SEARCH_REPO_DESCRIPTION`: **true**: Whether to search within description at repository search on explore page.

+ 15
- 13
docs/content/doc/administration/customizing-gitea.en-us.md View File

@@ -56,21 +56,22 @@ is set under the "Configuration" tab on the site administration page.

To make Gitea serve custom public files (like pages and images), use the folder
`$GITEA_CUSTOM/public/` as the webroot. Symbolic links will be followed.
At the moment, only files in the `public/assets/` folder are served.

For example, a file `image.png` stored in `$GITEA_CUSTOM/public/`, can be accessed with
For example, a file `image.png` stored in `$GITEA_CUSTOM/public/assets/`, can be accessed with
the url `http://gitea.domain.tld/assets/image.png`.

## Changing the logo

To build a custom logo and/or favicon clone the Gitea source repository, replace `assets/logo.svg` and/or `assets/favicon.svg` and run
`make generate-images`. `assets/favicon.svg` is used for the favicon only. This will update below output files which you can then place in `$GITEA_CUSTOM/public/img` on your server:
`make generate-images`. `assets/favicon.svg` is used for the favicon only. This will update below output files which you can then place in `$GITEA_CUSTOM/public/assets/img` on your server:

- `public/img/logo.svg` - Used for site icon, app icon
- `public/img/logo.png` - Used for Open Graph
- `public/img/avatar_default.png` - Used as the default avatar image
- `public/img/apple-touch-icon.png` - Used on iOS devices for bookmarks
- `public/img/favicon.svg` - Used for favicon
- `public/img/favicon.png` - Used as fallback for browsers that don't support SVG favicons
- `public/assets/img/logo.svg` - Used for site icon, app icon
- `public/assets/img/logo.png` - Used for Open Graph
- `public/assets/img/avatar_default.png` - Used as the default avatar image
- `public/assets/img/apple-touch-icon.png` - Used on iOS devices for bookmarks
- `public/assets/img/favicon.svg` - Used for favicon
- `public/assets/img/favicon.png` - Used as fallback for browsers that don't support SVG favicons

In case the source image is not in vector format, you can attempt to convert a raster image using tools like [this](https://www.aconvert.com/image/png-to-svg/).

@@ -102,7 +103,7 @@ Dont forget to restart your Gitea to apply the changes.
If all you want is to add extra links to the top navigation bar or footer, or extra tabs to the repository view, you can put them in `extra_links.tmpl` (links added to the navbar), `extra_links_footer.tmpl` (links added to the left side of footer), and `extra_tabs.tmpl` inside your `$GITEA_CUSTOM/templates/custom/` directory.

For instance, let's say you are in Germany and must add the famously legally-required "Impressum"/about page, listing who is responsible for the site's content:
just place it under your "$GITEA_CUSTOM/public/" directory (for instance `$GITEA_CUSTOM/public/impressum.html`) and put a link to it in either `$GITEA_CUSTOM/templates/custom/extra_links.tmpl` or `$GITEA_CUSTOM/templates/custom/extra_links_footer.tmpl`.
just place it under your "$GITEA_CUSTOM/public/assets/" directory (for instance `$GITEA_CUSTOM/public/assets/impressum.html`) and put a link to it in either `$GITEA_CUSTOM/templates/custom/extra_links.tmpl` or `$GITEA_CUSTOM/templates/custom/extra_links_footer.tmpl`.

To match the current style, the link should have the class name "item", and you can use `{{AppSubUrl}}` to get the base URL:
`<a class="item" href="{{AppSubUrl}}/assets/impressum.html">Impressum</a>`
@@ -132,7 +133,7 @@ The data is encoded and sent to the PlantUML server which generates the picture.
demo server at http://www.plantuml.com/plantuml, but if you (or your users) have sensitive data you
can set up your own [PlantUML server](https://plantuml.com/server) instead. To set up PlantUML rendering,
copy JavaScript files from https://gitea.com/davidsvantesson/plantuml-code-highlight and put them in your
`$GITEA_CUSTOM/public` folder. Then add the following to `custom/footer.tmpl`:
`$GITEA_CUSTOM/public/assets/` folder. Then add the following to `custom/footer.tmpl`:

```html
<script>
@@ -204,7 +205,7 @@ You can display STL file directly in Gitea by adding:

to the file `templates/custom/footer.tmpl`

You also need to download the content of the library [Madeleine.js](https://github.com/beige90/Madeleine.js) and place it under `$GITEA_CUSTOM/public/` folder.
You also need to download the content of the library [Madeleine.js](https://github.com/beige90/Madeleine.js) and place it under `$GITEA_CUSTOM/public/assets/` folder.

You should end-up with a folder structure similar to:

@@ -212,7 +213,8 @@ You should end-up with a folder structure similar to:
$GITEA_CUSTOM/templates
-- custom
`-- footer.tmpl
$GITEA_CUSTOM/public

$GITEA_CUSTOM/public/assets/
-- Madeleine.js
|-- LICENSE
|-- README.md
@@ -366,7 +368,7 @@ The list of themes a user can choose from can be configured with the `THEMES` va

To make a custom theme available to all users:

1. Add a CSS file to `$GITEA_CUSTOM/public/css/theme-<theme-name>.css`.
1. Add a CSS file to `$GITEA_CUSTOM/public/assets/css/theme-<theme-name>.css`.
The value of `$GITEA_CUSTOM` of your instance can be queried by calling `gitea help` and looking up the value of "CustomPath".
2. Add `<theme-name>` to the comma-separated list of setting `THEMES` in `app.ini`


+ 1
- 1
docs/content/doc/administration/external-renderers.en-us.md View File

@@ -191,7 +191,7 @@ And so you could write some CSS:
}
```

Add your stylesheet to your custom directory e.g `custom/public/css/my-style-XXXXX.css` and import it using a custom header file `custom/templates/custom/header.tmpl`:
Add your stylesheet to your custom directory e.g `custom/public/assets/css/my-style-XXXXX.css` and import it using a custom header file `custom/templates/custom/header.tmpl`:

```html
<link rel="stylesheet" href="{{AppSubUrl}}/assets/css/my-style-XXXXX.css" />

+ 1
- 1
docs/content/doc/development/hacking-on-gitea.en-us.md View File

@@ -218,7 +218,7 @@ REPO_INDEXER_CONN_STR = http://elastic:changeme@localhost:9200

### Building and adding SVGs

SVG icons are built using the `make svg` target which compiles the icon sources defined in `build/generate-svg.js` into the output directory `public/img/svg`. Custom icons can be added in the `web_src/svg` directory.
SVG icons are built using the `make svg` target which compiles the icon sources defined in `build/generate-svg.js` into the output directory `public/assets/img/svg`. Custom icons can be added in the `web_src/svg` directory.

### Building the Logo


+ 1
- 1
docs/content/doc/help/faq.en-us.md View File

@@ -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`


+ 1
- 1
modules/public/public.go View File

@@ -73,7 +73,7 @@ func setWellKnownContentType(w http.ResponseWriter, file string) {

func handleRequest(w http.ResponseWriter, req *http.Request, fs http.FileSystem, file string) bool {
// actually, fs (http.FileSystem) is designed to be a safe interface, relative paths won't bypass its parent directory, it's also fine to do a clean here
f, err := fs.Open(util.PathJoinRelX(file))
f, err := fs.Open(util.PathJoinRelX("assets", file))
if err != nil {
if os.IsNotExist(err) {
return false

+ 2
- 2
modules/svg/svg.go View File

@@ -27,7 +27,7 @@ const defaultSize = 16

// Init discovers SVGs and populates the `SVGs` variable
func Init() error {
files, err := public.AssetFS().ListFiles("img/svg")
files, err := public.AssetFS().ListFiles("assets/img/svg")
if err != nil {
return err
}
@@ -38,7 +38,7 @@ func Init() error {
if path.Ext(file) != ".svg" {
continue
}
bs, err := public.AssetFS().ReadFile("img/svg", file)
bs, err := public.AssetFS().ReadFile("assets/img/svg", file)
if err != nil {
log.Error("Failed to read SVG file %s: %v", file, err)
} else {

public/img/404.png → public/assets/img/404.png View File


public/img/500.png → public/assets/img/500.png View File


public/img/apple-touch-icon.png → public/assets/img/apple-touch-icon.png View File


public/img/avatar_default.png → public/assets/img/avatar_default.png View File


public/img/checkmark.png → public/assets/img/checkmark.png View File


public/img/dingtalk.ico → public/assets/img/dingtalk.ico View File


public/img/discord.png → public/assets/img/discord.png View File


public/img/emoji/codeberg.png → public/assets/img/emoji/codeberg.png View File


public/img/emoji/git.png → public/assets/img/emoji/git.png View File


public/img/emoji/gitea.png → public/assets/img/emoji/gitea.png View File


public/img/emoji/github.png → public/assets/img/emoji/github.png View File


public/img/emoji/gitlab.png → public/assets/img/emoji/gitlab.png View File


public/img/emoji/gogs.png → public/assets/img/emoji/gogs.png View File


public/img/failed.png → public/assets/img/failed.png View File


public/img/favicon.png → public/assets/img/favicon.png View File


public/img/favicon.svg → public/assets/img/favicon.svg View File


public/img/feishu.png → public/assets/img/feishu.png View File


public/img/gitea.svg → public/assets/img/gitea.svg View File


public/img/gogs.ico → public/assets/img/gogs.ico View File


public/img/loading.png → public/assets/img/loading.png View File


public/img/logo.png → public/assets/img/logo.png View File


public/img/logo.svg → public/assets/img/logo.svg View File


public/img/msteams.png → public/assets/img/msteams.png View File


public/img/openid-16x16.png → public/assets/img/openid-16x16.png View File


public/img/packagist.png → public/assets/img/packagist.png View File


public/img/repo_default.png → public/assets/img/repo_default.png View File


public/img/slack.png → public/assets/img/slack.png View File


public/img/svg/fontawesome-openid.svg → public/assets/img/svg/fontawesome-openid.svg View File


public/img/svg/fontawesome-save.svg → public/assets/img/svg/fontawesome-save.svg View File


public/img/svg/fontawesome-send.svg → public/assets/img/svg/fontawesome-send.svg View File


public/img/svg/fontawesome-windows.svg → public/assets/img/svg/fontawesome-windows.svg View File


public/img/svg/gitea-alpine.svg → public/assets/img/svg/gitea-alpine.svg View File


public/img/svg/gitea-azuread.svg → public/assets/img/svg/gitea-azuread.svg View File


public/img/svg/gitea-azureadv2.svg → public/assets/img/svg/gitea-azureadv2.svg View File


public/img/svg/gitea-bitbucket.svg → public/assets/img/svg/gitea-bitbucket.svg View File


public/img/svg/gitea-cargo.svg → public/assets/img/svg/gitea-cargo.svg View File


public/img/svg/gitea-chef.svg → public/assets/img/svg/gitea-chef.svg View File


public/img/svg/gitea-codebase.svg → public/assets/img/svg/gitea-codebase.svg View File


public/img/svg/gitea-composer.svg → public/assets/img/svg/gitea-composer.svg View File


public/img/svg/gitea-conan.svg → public/assets/img/svg/gitea-conan.svg View File


public/img/svg/gitea-conda.svg → public/assets/img/svg/gitea-conda.svg View File


public/img/svg/gitea-cran.svg → public/assets/img/svg/gitea-cran.svg View File


public/img/svg/gitea-debian.svg → public/assets/img/svg/gitea-debian.svg View File


public/img/svg/gitea-discord.svg → public/assets/img/svg/gitea-discord.svg View File


public/img/svg/gitea-double-chevron-left.svg → public/assets/img/svg/gitea-double-chevron-left.svg View File


public/img/svg/gitea-double-chevron-right.svg → public/assets/img/svg/gitea-double-chevron-right.svg View File


public/img/svg/gitea-dropbox.svg → public/assets/img/svg/gitea-dropbox.svg View File


public/img/svg/gitea-empty-checkbox.svg → public/assets/img/svg/gitea-empty-checkbox.svg View File


public/img/svg/gitea-exclamation.svg → public/assets/img/svg/gitea-exclamation.svg View File


public/img/svg/gitea-facebook.svg → public/assets/img/svg/gitea-facebook.svg View File


public/img/svg/gitea-git.svg → public/assets/img/svg/gitea-git.svg View File


public/img/svg/gitea-gitbucket.svg → public/assets/img/svg/gitea-gitbucket.svg View File


public/img/svg/gitea-gitea.svg → public/assets/img/svg/gitea-gitea.svg View File


public/img/svg/gitea-gitlab.svg → public/assets/img/svg/gitea-gitlab.svg View File


public/img/svg/gitea-go.svg → public/assets/img/svg/gitea-go.svg View File


public/img/svg/gitea-gogs.svg → public/assets/img/svg/gitea-gogs.svg View File


public/img/svg/gitea-google.svg → public/assets/img/svg/gitea-google.svg View File


public/img/svg/gitea-helm.svg → public/assets/img/svg/gitea-helm.svg View File


public/img/svg/gitea-join.svg → public/assets/img/svg/gitea-join.svg View File


public/img/svg/gitea-lock-cog.svg → public/assets/img/svg/gitea-lock-cog.svg View File


public/img/svg/gitea-lock.svg → public/assets/img/svg/gitea-lock.svg View File


public/img/svg/gitea-mastodon.svg → public/assets/img/svg/gitea-mastodon.svg View File


public/img/svg/gitea-matrix.svg → public/assets/img/svg/gitea-matrix.svg View File


public/img/svg/gitea-maven.svg → public/assets/img/svg/gitea-maven.svg View File


public/img/svg/gitea-microsoftonline.svg → public/assets/img/svg/gitea-microsoftonline.svg View File


public/img/svg/gitea-nextcloud.svg → public/assets/img/svg/gitea-nextcloud.svg View File


public/img/svg/gitea-npm.svg → public/assets/img/svg/gitea-npm.svg View File


public/img/svg/gitea-nuget.svg → public/assets/img/svg/gitea-nuget.svg View File


public/img/svg/gitea-onedev.svg → public/assets/img/svg/gitea-onedev.svg View File


public/img/svg/gitea-openid.svg → public/assets/img/svg/gitea-openid.svg View File


public/img/svg/gitea-pub.svg → public/assets/img/svg/gitea-pub.svg View File


public/img/svg/gitea-python.svg → public/assets/img/svg/gitea-python.svg View File


public/img/svg/gitea-rpm.svg → public/assets/img/svg/gitea-rpm.svg View File


public/img/svg/gitea-rubygems.svg → public/assets/img/svg/gitea-rubygems.svg View File


public/img/svg/gitea-split.svg → public/assets/img/svg/gitea-split.svg View File


public/img/svg/gitea-swift.svg → public/assets/img/svg/gitea-swift.svg View File


public/img/svg/gitea-twitter.svg → public/assets/img/svg/gitea-twitter.svg View File


public/img/svg/gitea-unlock.svg → public/assets/img/svg/gitea-unlock.svg View File


public/img/svg/gitea-vagrant.svg → public/assets/img/svg/gitea-vagrant.svg View File


public/img/svg/gitea-vscode.svg → public/assets/img/svg/gitea-vscode.svg View File


public/img/svg/gitea-whitespace.svg → public/assets/img/svg/gitea-whitespace.svg View File


public/img/svg/gitea-yandex.svg → public/assets/img/svg/gitea-yandex.svg View File


public/img/svg/material-invert-colors.svg → public/assets/img/svg/material-invert-colors.svg View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save