Re: [Doxygen-develop] Adding canonical links to HTML documentation
Brought to you by:
dimitri
From: Philipp M. <phi...@ge...> - 2012-09-30 14:12:28
|
Dimitri van Heesch <do...@gm...> writes: > Hi Philipp, > > On Sep 21, 2012, at 15:26 , Philipp Moeller <phi...@ge...> wrote: > >> Hi, >> >> I'm looking for a way to inject <link rel="canonical" href=""/> tags >> into doxygen HTML output. >> >> The obvious way is to do it in a post-processing, but having the ability >> to access the filename of the currently generated file (incl. it's path >> when CREATE_SUBDIRS is enabled) inside the HTML_HEADER seems like a >> better solution. >> >> It seems to be straight-forward to implement by adding another >> substitution to substituteHtmlKeywords in htmlgen.cpp > > If it is for the header and footer, then yes that would work > (similar to $relpath$, which is the relative path to the root of the documentation set). > >> >> Would it be possible to add something like that? I could provide a patch >> if wanted. That is exactly the way I did it. > Yes please, but I would like to understand what you would be using this for. We serve our documentation in a style like this: https://www.example.com/manual/versionnumber/index.html and always have a special directory https://www.example.com/manual/latest/index.html that always has the documentation of the latest release. To prevent search engines from showing links to specific versions of the documentation we use a <link rel="canonical"> tag to always point to the version found at latest. Hope this makes the use case clearer. Cheers, Philipp |