网站Logo newfree

记录下Gitea自定义问题

newfree
7
2025-06-12

关于Gitea首页自定义

官网写的有点模糊了,其实步骤很简单

在映射的目录下找到/gitea/conf/app.ini

添加一行

GITEA_CUSTOM=/data/gitea

然后在gitea目录下,也就是conf同目录

新建一个templates文件夹

里面新建home.tmpl文件,下面是我的首页内容

{{template "base/head" .}}
<div role="main" aria-label="{{if .IsSigned}}{{.locale.Tr "dashboard"}}{{else}}{{.locale.Tr "home"}}{{end}}" class="page-content home">
	<div class="gt-mb-5 gt-px-5">
		<div class="center">
			<img class="logo" width="220" height="220" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{.locale.Tr "logo"}}">
			<div class="hero">
				<h1 class="ui icon header title">
					{{AppName}}
				</h1>
				<h2>The one and only one personal Git service for newfree.</h2>
			</div>
		</div>
	</div>
	<div class="ui stackable middle very relaxed page grid">
		<div class="eight wide center column">
			<h1 class="hero ui icon header">
				{{svg "octicon-squirrel"}} Code Playground
			</h1>
			<p class="large">
				Code playground to easily write, test and share some interesting snippets, scripts and projects.
			</p>
		</div>
		<div class="eight wide center column">
			<h1 class="hero ui icon header">
				{{svg "octicon-database"}} Cloud Storage
			</h1>
			<p class="large">
				Cloud Storage to sync, save and archive codes from other platforms like GitHub, GitLab and so on.
			</p>
		</div>
	</div>
</div>
{{template "base/footer" .}}

其他的自定义可以看官网说明 说明文档

动物装饰