Skip to content

Commit b0971ae

Browse files
techknowlogicklafriks
authored andcommitted
Reduce overhead of upgrades for users with custom stylesheets/JS (#3051)
1 parent 4947cfb commit b0971ae

File tree

5 files changed

+4
-0
lines changed

5 files changed

+4
-0
lines changed

docs/content/doc/advanced/customizing-gitea.en-us.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ When you find the correct .tmpl file, you need to copy it in the `custom/templat
4949
You can now customize the template you copied in `custom/templates`, being carefully to not break the Gitea syntax.
5050
Any statement contained inside `{{` and `}}` are Gitea templete's syntax and shouldn't be touch, unless you know what are you doing.
5151

52+
To add in custom HTML to the header or the footer of the page, in the `templates/custom` directory there are `header.tmpl` and `footer.tmpl` that can be modified. This is useful if you want to add in custom CSS files, or additional Javascript.
53+
5254
## Customizing gitignores, labels, licenses, locales, and readmes.
5355

5456
Place your own files in corresponding sub-folder under `custom/options`.

templates/base/footer.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,6 @@
6666
<!-- JavaScript -->
6767
<script src="{{AppSubUrl}}/vendor/plugins/semantic/semantic.min.js"></script>
6868
<script src="{{AppSubUrl}}/js/index.js?v={{MD5 AppVer}}"></script>
69+
{{template "custom/footer" .}}
6970
</body>
7071
</html>

templates/base/head.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@
122122
<meta property="og:url" content="{{AppUrl}}" />
123123
<meta property="og:description" content="{{MetaDescription}}">
124124
{{end}}
125+
{{template "custom/header" .}}
125126
</head>
126127
<body>
127128
<div class="full height">

templates/custom/footer.tmpl

Whitespace-only changes.

templates/custom/header.tmpl

Whitespace-only changes.

0 commit comments

Comments
 (0)