Re: once more: documentation search indexing
От | Andres Freund |
---|---|
Тема | Re: once more: documentation search indexing |
Дата | |
Msg-id | 20220317191509.ocwl6qngfcbpgpvc@alap3.anarazel.de обсуждение исходный текст |
Ответ на | Re: once more: documentation search indexing ("Jonathan S. Katz" <jkatz@postgresql.org>) |
Ответы |
Re: once more: documentation search indexing
("Jonathan S. Katz" <jkatz@postgresql.org>)
|
Список | pgsql-www |
Hi, On 2022-03-17 14:41:47 -0400, Jonathan S. Katz wrote: > On 3/17/22 9:42 AM, Daniel Gustafsson wrote: > > > On 16 Mar 2022, at 15:19, Jonathan S. Katz <jkatz@postgresql.org> wrote: > > > > > -- but I want to ensure the other folks on the web team are comfortable or at > > > least willing to try it out and see. > > > > > > I won't oppose to trying it. > > So let's timebox this. If there are no objections, by Mon, Mar 21, I will > apply this version of the patch (attached), pending any additional feedback > or review. Cool! I think a shorter waiting period would also be fine, we've been stuck on this forever and we can change course if we find out the rel=canon approach doesn't work. Don't make much out of the review comments below, this is not my area of expertise... > diff --git a/pgweb/docs/views.py b/pgweb/docs/views.py > index c2d00c8..162776f 100644 > --- a/pgweb/docs/views.py > +++ b/pgweb/docs/views.py > @@ -120,11 +120,30 @@ def docpage(request, version, filename): > else: > contentpreview = '' > > + # determine the canonical version of the page > + # if the doc page is in the current version, then we set it to current > + # otherwise, check the supported and unsupported versions and find the > + # last version that the page appeared > + # we exclude "devel" as development docs are disallowed in robots.txt Not related to this, but I think we should change this at some point. It's nice to be able to find a documentation page for a new tool. > diff --git a/templates/docs/docspage.html b/templates/docs/docspage.html > index f5f3e3b..7a4e2fc 100644 > --- a/templates/docs/docspage.html > +++ b/templates/docs/docspage.html > @@ -27,6 +27,9 @@ > {%endif%} > <link rel="stylesheet" type="text/css" href="/dyncss/base.css?{{gitrev}}"> > {%block extrahead%}{%endblock%} > + {% if canonical_version %} > + <link rel="canonical" href="https://www.postgresql.org/docs/{{ canonical_version }}/{{ ver.file }}" /> > + {% endif %} > </head> What's the reason to put this after extrahead, rather than before? > diff --git a/templates/docs/index.html b/templates/docs/index.html > index cfcc2f8..63e4559 100644 > --- a/templates/docs/index.html > +++ b/templates/docs/index.html > @@ -27,6 +27,9 @@ > <tr> > <td> > <a href="/docs/{{v.numtree}}/index.html">{{v.treestring}}</a> > + {% if v.current %} > + (<a href="/docs/current/index.html">Current</a>) > + {% endif %} > </td> > <td> > {%if v.a4pdf or v.uspdf%} So this is just going to a separate link for the html docs, not the pdf docs. Which do not seem to be available under a 'current' style link anyway? I guess that's good enough for now... Perhaps some non-link visual separation between e.g. "14" and "current" would make sense? Even just a " / " might help. Otherwise it might not be obvious that they're different link targets. Greetings, Andres Freund
В списке pgsql-www по дате отправления: