[webgen-users] webgen-1.0: making links to current page inactive

25 views
Skip to first unread message

Mikhail Yakshin

unread,
Oct 7, 2013, 5:06:45 PM10/7/13
to webgen...@rubyforge.org
Hi,

In previous versions of webgen (0.4.x, 0.5.x) there was some sort of
magic in programmatically created links, such as menus, breadcrumbs or
language selection links that made links on a certain page to itself
appear as

<span>Link text</span>

while links to other pages (not itself) appeared as proper <a> tag links:

<a href="some-other-page.html">Link text</a>

However, since upgrade to webgen 1.0, this functionality disappeared
and all links, including links from current page to itself, appear the
same. Is it possible to return to older behavior? May be I've
overlooked some option I need to turn on or off?

--
WBR, Mikhail Yakshin
_______________________________________________
webgen-users mailing list
webgen...@rubyforge.org
http://rubyforge.org/mailman/listinfo/webgen-users

Mikhail Yakshin

unread,
Oct 8, 2013, 4:59:22 AM10/8/13
to webgen...@rubyforge.org
Hi again,

> In previous versions of webgen (0.4.x, 0.5.x) there was some sort of
> magic in programmatically created links, such as menus, breadcrumbs or
> language selection links that made links on a certain page to itself
> appear as
>
> <span>Link text</span>
>
> while links to other pages (not itself) appeared as proper <a> tag links:
>
> <a href="some-other-page.html">Link text</a>
>
> However, since upgrade to webgen 1.0, this functionality disappeared
> and all links, including links from current page to itself, appear the
> same. Is it possible to return to older behavior? May be I've
> overlooked some option I need to turn on or off?

Well, it seems that it was "website.link_to_current_page" option,
which is missing now and "generated links now always use the HTML <a>
tag", as "Upgrading from 0.5.x" says.

Any rationale for this change of behavior? Is there any way to revert
to behavior of "website.link_to_current_page = false"?

Thomas Leitner

unread,
Oct 10, 2013, 3:25:24 PM10/10/13
to webgen...@rubyforge.org
On 2013-10-08 12:59 +0400 Mikhail Yakshin wrote:
> Well, it seems that it was "website.link_to_current_page" option,
> which is missing now and "generated links now always use the HTML <a>
> tag", as "Upgrading from 0.5.x" says.
>
> Any rationale for this change of behavior? Is there any way to revert
> to behavior of "website.link_to_current_page = false"?

No, it is currently not possible to this.

I have looked through some CMS and saw that most of them format a link
to the current page as `<a>` element which is probably the 'right way'
to do it since one did want to have a link in the first place.

It also simplified many CSS rules for the (former) built-in templates
because the `<span>` tags did need to be handled differently.

However, if this functionality is needed again I can re-introduce it in
the next update.

-- Thomas

Mikhail Yakshin

unread,
Oct 10, 2013, 9:26:12 PM10/10/13
to webgen...@rubyforge.org
Hi,

>> Well, it seems that it was "website.link_to_current_page" option,
>> which is missing now and "generated links now always use the HTML <a>
>> tag", as "Upgrading from 0.5.x" says.
>>
>> Any rationale for this change of behavior? Is there any way to revert
>> to behavior of "website.link_to_current_page = false"?
>
> No, it is currently not possible to this.
>
> I have looked through some CMS and saw that most of them format a link
> to the current page as `<a>` element which is probably the 'right way'
> to do it since one did want to have a link in the first place.

It's debatable whether it's a good idea or not to remove self-links,
but I guess at least the opportunity to do so is definitely a good
thing. Especially if this feature was available in previous versions.

Generally, right now there's only one major misunderstanding with this
change: pre-webgen-1.0 templates that relied on <span> behavior to
highlight current language in langbar should be rewritten to use CSS
class "webgen-langbar-current-lang" to designate current language.

> It also simplified many CSS rules for the (former) built-in templates
> because the `<span>` tags did need to be handled differently.
>
> However, if this functionality is needed again I can re-introduce it in
> the next update.

So far I've solved my problem with postprocessing - just running sed
that blatantly replaces <a href="file.html">...</a> to
<span>...</span> for any given file.html, iterating it for every file
in the output.

Probably it's possible to do so without external processing, with
proper modification of webgen rendering pipeline, but I still haven't
figured it out how to do it.

--
WBR, Mikhail Yakshin

Thomas Leitner

unread,
Oct 26, 2013, 3:47:53 AM10/26/13
to webgen...@rubyforge.org
On 2013-10-11 05:26 +0400 Mikhail Yakshin wrote:
> > However, if this functionality is needed again I can re-introduce
> > it in the next update.
>
> So far I've solved my problem with postprocessing - just running sed
> that blatantly replaces <a href="file.html">...</a> to
> <span>...</span> for any given file.html, iterating it for every file
> in the output.
>
> Probably it's possible to do so without external processing, with
> proper modification of webgen rendering pipeline, but I still haven't
> figured it out how to do it.

I have re-implemented support for 'webgen.link_to_current_page' and it
will be available with the next release.

-- Thomas
Reply all
Reply to author
Forward
0 new messages