Browse Source

Reduce overhead of upgrades for users with custom stylesheets/JS (#3051)

techknowlogick 1 year ago
parent
commit
b0971ae37c

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

@@ -49,6 +49,8 @@ When you find the correct .tmpl file, you need to copy it in the `custom/templat
49 49
 You can now customize the template you copied in `custom/templates`, being carefully to not break the Gitea syntax.
50 50
 Any statement contained inside `{{` and `}}` are Gitea templete's syntax and shouldn't be touch, unless you know what are you doing.
51 51
 
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
+
52 54
 ## Customizing gitignores, labels, licenses, locales, and readmes.
53 55
 
54 56
 Place your own files in corresponding sub-folder under `custom/options`.

+ 1 - 0
templates/base/footer.tmpl

@@ -66,5 +66,6 @@
66 66
 	<!-- JavaScript -->
67 67
 	<script src="{{AppSubUrl}}/vendor/plugins/semantic/semantic.min.js"></script>
68 68
 	<script src="{{AppSubUrl}}/js/index.js?v={{MD5 AppVer}}"></script>
69
+{{template "custom/footer" .}}
69 70
 </body>
70 71
 </html>

+ 1 - 0
templates/base/head.tmpl

@@ -122,6 +122,7 @@
122 122
 	<meta property="og:url" content="{{AppUrl}}" />
123 123
 	<meta property="og:description" content="{{MetaDescription}}">
124 124
 {{end}}
125
+{{template "custom/header" .}}
125 126
 </head>
126 127
 <body>
127 128
 	<div class="full height">

+ 0 - 0
templates/custom/footer.tmpl


+ 0 - 0
templates/custom/header.tmpl