After upgrade from 1.17.3 to 1.18.3 home landing page gives 500 error

I upgraded gitea from 1.17.3 to 1.18.3.
Now the when I visit the landing page while not being signed in it shows me a 500 error.
The logs show the same:

14:18:44 code gitea[657586]: 2023/02/02 14:18:44 cmd/web.go:106:runWeb() [I] Starting Gitea on PID: 657586
Feb  2 14:18:44 code gitea[657586]: 2023/02/02 14:18:44 cmd/web.go:160:runWeb() [I] Global init
Feb  2 14:18:44 code gitea[657586]: 2023/02/02 14:18:44 routers/init.go:116:GlobalInitInstalled() [I] Git Version: 2.25.1, Wire Protocol Version 2 Enabled (home: /var/lib/gitea/data/home)
Feb  2 14:18:44 code gitea[657586]: 2023/02/02 14:18:44 routers/init.go:117:GlobalInitInstalled() [I] AppPath: /usr/local/bin/gitea
Feb  2 14:18:44 code gitea[657586]: 2023/02/02 14:18:44 routers/init.go:118:GlobalInitInstalled() [I] AppWorkPath: /var/lib/gitea
Feb  2 14:18:44 code gitea[657586]: 2023/02/02 14:18:44 routers/init.go:119:GlobalInitInstalled() [I] Custom path: /var/lib/gitea/custom
Feb  2 14:18:44 code gitea[657586]: 2023/02/02 14:18:44 routers/init.go:120:GlobalInitInstalled() [I] Log path: /var/lib/gitea/log
Feb  2 14:18:44 code gitea[657586]: 2023/02/02 14:18:44 routers/init.go:121:GlobalInitInstalled() [I] Configuration file: /etc/gitea/app.ini
Feb  2 14:18:44 code gitea[657586]: 2023/02/02 14:18:44 routers/init.go:122:GlobalInitInstalled() [I] Run Mode: Prod
Feb  2 14:18:49 code gitea[657586]: 2023/02/02 14:18:49 [63dbb839] router: started   GET / for xxxxxx:60806
Feb  2 14:18:49 code gitea[657586]: 2023/02/02 14:18:49 [63dbb839] router: completed GET / for xxxx:60806, 500 Internal Server Error in 8.5ms @ web/home.go:33(web.Home)

When I click explore that works just fine.
When I change the landing page to for example explore that works to.
I changed our custom template to the default template but that does not change anything.

Any ideas how to trouble shoot or what the problem could be?

So I found the problem.
First of all I took the default template from the main branch tho check if the custom template is causing the problems. This is a mistake I’m running 1.18.3 and that is not the main branch. And the default template from the main branch did not work and give a 500 error to.
Which messed up my trouble shooting process thinking that its not the template because its still giving the same error. Not realizing its giving the same error because of the same reason again a faulty template, another mistake.

So after finding out I got the wrong default template I got the right default in place an hey my problems are over.
Next step is where is the mistake in my custom template.
Well that is the weird thing. Its in the section I commented out.
Apparently something changed around the way or interpretation of commented out sections.
Is anybody aware of this? What changed? Or is it a bug?

The faulty template with bits commented out by

{{template "base/head" .}}
<div class="page-content home">
        <div class="ui stackable middle very relaxed page grid">
                <div class="sixteen wide center aligned centered column">
                        <div>
                                <img src="assets/logo.jpg" />
                        </div>
                        <div class="hero">
                                <h1 class="ui icon header title">
                                        {{AppName}}
                                </h1>
                                <h2>Press <a href="explore/repos">Explore</a> to view the public repositories</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-flame" 16}} {{.i18n.Tr "startpage.install"}}
                        </h1>
                        <p class="large">
                                {{.i18n.Tr "startpage.install_desc" | Str2html}}
                        </p>
                </div>
                <div class="eight wide center column">
                        <h1 class="hero ui icon header">
                                {{svg "octicon-device-desktop" 16}} {{.i18n.Tr "startpage.platform"}}
                        </h1>
                        <p class="large">
                                {{.i18n.Tr "startpage.platform_desc" | Str2html}}
                        </p>
                </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-rocket" 16}} {{.i18n.Tr "startpage.lightweight"}}
                        </h1>
                        <p class="large">
                                {{.i18n.Tr "startpage.lightweight_desc" | Str2html}}
                        </p>
                </div>
                <div class="eight wide center column">
                        <h1 class="hero ui icon header">
                                {{svg "octicon-code" 16}} {{.i18n.Tr "startpage.license"}}
                        </h1>
                        <p class="large">
                                {{.i18n.Tr "startpage.license_desc" | Str2html}}
                        </p>
                </div>
        </div>-->
</div>
{{template "base/footer" .}}

Are you using any custom templates, especially for the landing page?

Yes I do use a custom landing page and that was the problem. I posted an update but it got marked as spam an now a moderator has to approve the post. → aah its has been approved. See the post from feb 3
TLDR:
In the custom template was a section commented out. Turns out it failed on something in the commented section which is kinda weird.