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

Already on GitHub? Sign in to your account

Title override syntax #539

Closed
bootstraponline opened this Issue Oct 13, 2012 · 16 comments

Comments

Projects
None yet
5 participants
Owner

bootstraponline commented Oct 13, 2012

A title override syntax (not rendered in page content) will enable the title to change while retaining the URL.

I'm not sure about the syntax. Here's one possibility.
<!-- title: The new title! -->

As mentioned on #536

@ghost ghost assigned bootstraponline Oct 18, 2012

Contributor

roman-zaharenkov commented Nov 6, 2012

It would be great if I can override title somehow. I want to use Latin symbols for URL but Cyrillic for title.

+1

nilcolor commented Nov 6, 2012

Different languages for page name and page title would be great.
👍

Owner

bootstraponline commented Nov 7, 2012

What do you think about this for the title override syntax?

```title:New Title```

nilcolor commented Nov 7, 2012

🆗

Contributor

roman-zaharenkov commented Nov 7, 2012

From my point of view it would be nice if I can specify title by first h1. In this case auto generated title (by filename) should appear only when page body is not begging with h1.

But title:New Title is better then nothing :)

nilcolor commented Nov 7, 2012

I was wrong - there is no problem with file name in web. So - @roman-zaharenkov idea is very good. First h1 should be used as page title. While file name will be given via new page dialog or from a link to non-existent page. Or by hand when editing locally.

Owner

bootstraponline commented Nov 8, 2012

h1 as page title has a number of problems which is why it was removed.

  • How do you change the title without adding a h1?
  • How do you retain the existing title and still use a h1?
  • How do you prevent double rendering of title in page and then the h1?

This issue calls for a title override syntax (not rendered in page content) and h1 doesn't meet that criteria.

nilcolor commented Nov 8, 2012

OK. Here is current state of GH Wiki:

GH Wiki - Page Title

What's do we have here? First h1 doesn't show at rendered page at all. So - it can be used as a Page Title. There is no problem with double rendering because there is no First h1 title right now.
OK, there is no problem with first h1 because it doesn't render. So we can use it as Page Title without any problems. Is it?

Owner

bootstraponline commented Nov 8, 2012

@nilcolor We're not talking about the GH wiki. Try again in open source gollum and you'll see a different result.

Deleting the first h1 is a massive bug on part of .com.

nilcolor commented Nov 8, 2012

@bootstraponline ic...
So, maybe something like modeline directives?

<!-- gollum: title="Page Title" syntax=markdown -->

etc?

Owner

bootstraponline commented Nov 9, 2012

The syntax has to be unique enough that it won't conflict with text a user might enter normally while remaining easy to type. Some alternatives:

<title:Page Title>.

<!-- gollum: title="Page Title" -->

[[title:Page Title]]

`gollum:title:Page Title`

I'm not sure any of these are particularly compelling.

Member

dekimsey commented Nov 9, 2012

The [[title:Page Title]] at least matches the syntax used for [[_TOC_]]. But the metadata that was implemented in #419 might be an even better place to put it.

Owner

bootstraponline commented Nov 9, 2012

If we use the metadata syntax it'd look like this:

<!-- --- title: Page Title -->

Owner

bootstraponline commented Nov 11, 2012

I think the metadata syntax as pointed out by @dekimsey is the way to go. As discussed on #576, there will also be a --h1-title flag so if you want h1 to define the title that'll be available. It's behind a flag because if it were default, there'd be no way to use a h1 without changing the title of a page. <h1> != <title>

Owner

bootstraponline commented Nov 11, 2012

The default header that appears in the page is now replaced by the first h1 #576. The <title> tag can be overridden using metadata. I opened #579 to track overriding the <title> tag with the first h1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment