Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More discriminant page title when browsing repository #2694

Closed
1 task done
ypnos opened this issue Oct 13, 2017 · 5 comments
Closed
1 task done

More discriminant page title when browsing repository #2694

ypnos opened this issue Oct 13, 2017 · 5 comments
Labels
issue/stale type/enhancement An improvement of existing functionality

Comments

@ypnos
Copy link

ypnos commented Oct 13, 2017

This is a feature request to improve the page title (<title>, seen in browser tab and history) when browsing a repository. The current page title is composed of the repository name and its description. It does not tell where in the repository you are currently are.

In comparison, in the wiki, the page title is just the name of the wiki page (e.g. 'Home').

I would suggest to replace the description of the repository with the path within that repository (eg. '/README.md'.
I don't really see the description as a good choice for the page title in general.

@lunny
Copy link
Member

lunny commented Oct 13, 2017

I think the path is right of the drop down menus of branches?

@ypnos
Copy link
Author

ypnos commented Oct 13, 2017

I am sorry for the confusion. I am talking about the <title> tag of the page. So the text you see in the tab, taskbar, browser history.

In github for example:

It would be great if in the second case we would get a title similar to github.

@lafriks lafriks added the type/enhancement An improvement of existing functionality label Oct 13, 2017
@lafriks lafriks added this to the 1.x.x milestone Oct 13, 2017
@bkcsoft
Copy link
Member

bkcsoft commented Oct 15, 2017

Easy enough to just inject .Title in the controller. Templates already have support for it :)

<title>{{if .Title}}{{.Title}} - {{end}}{{AppName}}</title>

Adding it here would suffice for the second example:

gitea/routers/repo/view.go

Lines 147 to 150 in 32ca299

ctx.Data["FileSize"] = blob.Size()
ctx.Data["FileName"] = blob.Name()
ctx.Data["HighlightClass"] = highlight.FileNameToHighlightClass(blob.Name())
ctx.Data["RawFileLink"] = rawLink + "/" + ctx.Repo.TreePath

@stale
Copy link

stale bot commented Feb 12, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale stale bot added the issue/stale label Feb 12, 2019
@stale
Copy link

stale bot commented Feb 26, 2019

This issue has been automatically closed because of inactivity. You can re-open it if needed.

@stale stale bot closed this as completed Feb 26, 2019
@lafriks lafriks removed this from the 1.x.x milestone Feb 26, 2019
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/stale type/enhancement An improvement of existing functionality
Projects
None yet
Development

No branches or pull requests

4 participants