tiddlywiki.com icon indicating copy to clipboard operation
tiddlywiki.com copied to clipboard

Improved header for pages on tiddlywiki.com/static/xx.html

Open jho1965us opened this issue 9 years ago • 5 comments

Currently it have a link to http://tiddlywiki.com/ it would be nice if there also was a link to the actual page e.g. : http://tiddlywiki.com/#WikiText ~~.html~~ for http://tiddlywiki.com/static/WikiText.html

jho1965us avatar Nov 22 '15 11:11 jho1965us

Are you asking for a mechanism that redirects from a wiki to a static page? That would mean to load a 2MB wiki so as to then redirect to 20k page. Why?

tobibeer avatar Nov 22 '15 15:11 tobibeer

No I am suggesting a mechanism that redirect from the static page to the wiki, opening the wiki on exactly that tiddler.

As it is now you need several steps to accomplishing that: starting on http://tiddlywiki.com/static/WikiText.html

  1. copy tiddler title
  2. click link to wiki
  3. in address bar add # and paste previous copied title now you are on WikiText tiddler in http://tiddlywiki.com (http://tiddlywiki.com/#WikiText)

Maybe a $:/StaticBanner like this:

<div class="tc-static-alert"><div class="tc-static-alert-inner">This page is part of a static HTML representation of the ~TiddlyWiki at http://tiddlywiki.com/ representing the Tiddler: 
<$link to="http://tiddlywiki.com/#{{!!title}}">{{!!title}}</$link></div></div>

In which case I think http://tiddlywiki.com/static/WikiText.html would get the following header

This page is part of a static HTML representation of the TiddlyWiki at http://tiddlywiki.com/ representing the Tiddler: WikiText

jho1965us avatar Nov 23 '15 23:11 jho1965us

@jho1965us, of course, the other way around. :D

A banner sounds like a great improvement.

I presume the way to go about this is to create a dedicated macro placed in the static template, which knows how to create those external links as either relative and/or absolute paths to the wiki document, as a parametric option, e.g.:

<a href=<<link-static ref:"relative" tiddler:"foo">> title="link to foo" target="_blank">Foo</a>

Not sure if hardcoding paths in templates is a good idea, but this could work too:

<a href=<<link-static path:"../../">> title="link to foo" target="_blank">Foo</a>

An absolute path constructed as:

<a href=<<link-static path:"http://foo.bar">> title="link to foo" target="_blank">Foo</a>

tobibeer avatar Nov 24 '15 06:11 tobibeer

@tobibeer, Not sure if it was clear in previous post but $:/StaticBanner is actual a shadow tiddler in TiddlerWiki that I modified slightly. I agree about absolute path is not ideal but that is how $:/StaticBanner is today.

Note: I am fairly new to TiddlyWiki and didn't know about TiddlerWiki - $:/StaticBanner when I original made this issue, seems like it is not part of the initial empty.html I am wondering if $:/StaticBanner was added to TiddlerWiki manualy or if it is part of some export process.

jho1965us avatar Nov 24 '15 09:11 jho1965us

@jho1965us

Searching for StaticBanner on tiddlywiki.com yields no results. It appears to be used as a placeholder in templates used for generating static pages, that is only implemented by a handful of editions that actually generate static output.

As used for individual tiddlers in $:/core/templates/static.template.html, it should possibly read:

<div class="tc-static-alert">
<div class="tc-static-alert-inner">
This page is part of a static HTML representation of the ~TiddlyWiki at http://tiddlywiki.com.
To visit this tiddler in the wiki go to:
<a href=<<link-static>>>
<$view field="title"/>
</a>
</div>
</div>

...with an eventually link-static macro producing the proper url, whichever parameters may be needed / implemented.

tobibeer avatar Nov 24 '15 09:11 tobibeer