Set title of static HTML export

Is there any way to default the title of the static HTML export to the title of the first tiddler being exported? I often export single tiddlers or small groups and forward them to others. The HTML title gets set to that of the whole wiki, which doesn’t match the content (a banal “notes” type title instead of the entry).

I am sure it can be, I presume you use both the export from tiddlers (single tiddlers are correctly named), or the page control export all in story?

I am researching a solution but you need to give more details about how you export.

  • What is the resultant filename
  • How do you select some tiddlers, one tiddler or do you export all.
  • Do you export from the Advanced search filter?
  • If more than one the title is visible on the page so do you mean filename?

Sure thing. I tend to export in one of two ways:

  1. Single tiddler
    1. Navigate to a specific tiddler.
    2. Click the more actions button.
    3. Choose export tiddler.
    4. Choose static HTML.
  2. Multiple tiddlers.
    1. Go to advanced search.
    2. Enter a filter (generally based on tags).
    3. Choose export tiddler.
    4. Choose static HTML.

The download of the resulting file prompts for a filename (at least on TiddlyDesktop; it could be configured either way on a standalone browser) and that part works fine.

The title I am referencing is the <title> tag on the resulting HTML. Without manually updating the markup, it references the whole wiki rather than the specific tiddler(s) that are there.

We seem to be in quite different timezones, I will respond sometime in the next 8 hours.

One thing you could do is change the line in https://tiddlywiki.com/#%24%3A%2Fcore%2Ftemplates%2Fstatic.template.html (search the template on your wiki for $:/core/templates/static.template.html) to reflect what you want. So search for this template and go to the line:
<title>{{$:/core/wiki/title}}</title> and change to what you want. This is not recommended because you are changing a shadow tiddler.

You could also do something like make a clone of the template renamed to whatever you like and have the title referred to by a field that you change as needed. Something like:
<title>{{!!mytitle}}</title>

That would be the better option so you aren’t changing a shadow tiddler.

An explanation for using your own template is here

If I remember correctly it’s a two step process: create the export format tiddler as shown in the link with the tag $:/tags/Exporter that refers to your new template. The title of the export format tiddler will appear in the list of export formats on the dropdown for ‘export tiddler’.

This is probably not complete - ie I’m not sure you can refer to a field of the template itself, you may have to create a tiddler and refer to that, such as using the text of a tiddler titled My Title and then referring to it with <title>{{My Title}}</title>