如何更改GitLab< title> ;? [英] How do I change GitLab <title>?
问题描述
我看了看又找不到了..我想更改页面标题
I've looked and looked and can't find it..I want to change the page title
<title>GitLab</title>
以包含更多信息.我似乎找不到任何可以执行此操作的地方,因为我已经搜索了github并且看不到任何答案.
to include more information. I can't seem to find anywhere to do this as i've scoured github and don't see any answers.
推荐答案
When you consider a page like app/views/layouts/devise.html.haml
, you see:
!!! 5
%html{ lang: "en"}
= render "layouts/head" <=====
%body.ui_basic.login-page
= render "layouts/flash"
.container
.content
%center
%h1 GitLab
这意味着html结果的<head>
部分由 app/views/layouts/_head.html.haml
:
That means the <head>
part of the html result is generated by app/views/layouts/_head.html.haml
:
%head
%meta{charset: "utf-8"}
%title
= "#{title} | " if defined?(title)
GitLab
这就是GitLab的来源.
That is where that GitLab comes from.
如该 haml参考文档中所述,标题已修改与@title
:
As explained in this haml reference document, the title is modified with @title
:
# file: app/controllers/movies_controller.rb
class MoviesController < ApplicationController
def index
@title = "Teen Wolf"
end
end
例如,GitLab源' app/controllers/users_controller.rb
'修改标题.
For instance, the GitLab source 'app/controllers/users_controller.rb
' modifies the title.
但是我看不到将 default 标题作为参数放置的任何方法,默认标题是在控制器未定义标题时放置的.
因此,您可能必须直接修改该_head.html.haml
文件.
But I don't see any way to put as a parameter the default title which is put when a controller doesn't define a title.
So you may have to modify directly that _head.html.haml
file.
这篇关于如何更改GitLab< title> ;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!