You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* upstream/main:
docs: template variables (go-gitea#26547)
[skip ci] Updated translations via Crowdin
Rewrite the DiffFileTreeItem and fix misalignment (go-gitea#26565)
Allow text selection in actions step header (go-gitea#26588)
Bump xgo to go-1.21.x and node to 20 in release-version (go-gitea#26589)
Add minimum polyfill to support "relative-time-element" in PaleMoon (go-gitea#26575)
Copy file name to clipboardExpand all lines: docs/content/administration/customizing-gitea.en-us.md
+12-2Lines changed: 12 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -126,7 +126,17 @@ Apart from `extra_links.tmpl` and `extra_tabs.tmpl`, there are other useful temp
126
126
-`body_outer_post.tmpl`, before the bottom `<footer>` element.
127
127
-`footer.tmpl`, right before the end of the `<body>` tag, a good place for additional JavaScript.
128
128
129
-
#### Example: PlantUML
129
+
### Using Gitea variables
130
+
131
+
It's possible to use various Gitea variables in your custom templates.
132
+
133
+
First, _temporarily_ enable development mode: in your `app.ini` change from `RUN_MODE = prod` to `RUN_MODE = dev`. Then add `{{ $ | DumpVar }}` to any of your templates, restart Gitea and refresh that page; that will dump all available variables.
134
+
135
+
Find the data that you need, and use the corresponding variable; for example, if you need the name of the repository then you'd use `{{.Repository.Name}}`.
136
+
137
+
If you need to transform that data somehow, and aren't familiar with Go, an easy workaround is to add the data to the DOM and add a small JavaScript script block to manipulate the data.
138
+
139
+
### Example: PlantUML
130
140
131
141
You can add [PlantUML](https://plantuml.com/) support to Gitea's markdown by using a PlantUML server.
132
142
The data is encoded and sent to the PlantUML server which generates the picture. There is an online
@@ -162,7 +172,7 @@ Alice <-- Bob: Another authentication Response
162
172
163
173
The script will detect tags with `class="language-plantuml"`, but you can change this by providing a second argument to `parsePlantumlCodeBlocks`.
164
174
165
-
####Example: STL Preview
175
+
### Example: STL Preview
166
176
167
177
You can display STL file directly in Gitea by adding:
<!--title instead of tooltip above as the tooltip needs too much work with the current methods, i.e. not being loaded or staying open for "too long"-->
<!--title instead of tooltip above as the tooltip needs too much work with the current methods, i.e. not being loaded or staying open for "too long"-->
0 commit comments