Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-16166

Allow better customization of link tags for easier site design and SEO

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • None
    • 11.1-rc-1
    • Skin
    • None
    • Unknown

    Description

      In the htmlheader.vm template, there is a couple of link tags that prevent easy customization of the design and SEO behavior of XWiki, without overriding this risky VM, since making mistakes in there could lead to very broken site.

      The first piece is related to the management of the favicon:

          <link rel="shortcut icon" href="$xwiki.getSkinFile('icons/xwiki/favicon.ico')" />
          <link rel="icon" href="$xwiki.getSkinFile('icons/xwiki/favicon16.png')" type="image/png" />
          <link rel="icon" href="$xwiki.getSkinFile('icons/xwiki/favicon.svg')" type="image/svg+xml" />
          <link rel="apple-touch-icon" href="$xwiki.getSkinFile('icons/xwiki/favicon144.png')" />
      

      So currently, the only way to manage the favicon is to provide all the alternative set there, which might be cumbersome for some users.

      Second is this alternate link for the universal button:

          #if($xcontext.action=="view")
            <link rel="alternate" type="application/x-wiki" title="Edit" href="$doc.getURL("edit")" />
          #end
      

      This fancy universal edit button setting is a bit lazy, since it doesn't even care about the ability of the currently logged user to edit anything. This cause public read-only website to advertize a useless editing feature.

      Third is the management of the canonical URL, and SEO in general.

          <link rel="canonical" href="$doc.getURL('view')" />
      

      In some case, you might want to have more absolute URL, when your site is multi-domain hosted. In more custom situation, you might even want to de-duplicate different documents of the wiki. Or you might also have the opposite case, where a single page is representing multiple pages using a querystring parameter. So you need to customize that canonical URL, and this should be ideally in the end of the page itself.
      Also missing here, it the alternate links for languages on a multilingual wiki (hreflang). And also, the language querystring should be added to the canonical URL to ensure proper URL for each language page.

      All the above code is followed by the inclusion of the Meta field in XWikiPreferences, which by default introduce some meta tags, that are this way well customizable. I wonder why all the above code has not been provided in a similar way, or even simply put in that Meta field.
      This would have been an easy way to customize it.

      Attachments

        Activity

          People

            Unassigned Unassigned
            softec Denis Gervalle
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: