Link Company/Author name to Website in Copyright footer

478 views
Skip to first unread message

Monami Bhattacharya

unread,
May 21, 2015, 4:02:20 AM5/21/15
to sphinx...@googlegroups.com
Hi,

Is there an easy way of hyperlinking the company or author name displayed in the HTML footer without hardcoding it in the CSS?

The conf.py seems to furnish these details, but if one adds an href there, it is displayed as is, with the copyright text.

copyright = u'2015, <a href="www.example.com">NameGoesHere</a>'


The theme.css seems to contain the directive, but I'm wondering if there's a way to do this without hardcoding it in there.

fa-copyright:before{content:""}


In footer.html

<div role="contentinfo"> <p> {%- if show_copyright %} {%- if hasdoc('copyright') %} {% trans path=pathto('copyright'), copyright=copyright|e %}&copy; <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %} {%- else %} {% trans copyright=copyright|e %}&copy; Copyright {{ copyright }}.{% endtrans %} {%- endif %} {%- endif %} </div>

Appreciate all inputs, thanks!
M

Luc Saffre

unread,
May 21, 2015, 5:45:45 AM5/21/15
to sphinx...@googlegroups.com
Monami,

"without hardcoding it in the CSS"?

Do you know that you can override the templates? For me it seems an
acceptable task to use a custom layout.html when I want to fine-tune the
HTML output. Here is an example:

https://github.com/lsaffre/lino/blob/master/docs/.templates/layout.html

And do you know that if you have a page "copyright.rst" (at the top of
the document tree), then the "Copyright" text will be clickable and lead
to that page.

Luc

On 21/05/15 10:09, Monami Bhattacharya wrote:
> Hi,
>
> Is there an easy way of hyperlinking the company or author name
> displayed in the HTML footer without hardcoding it in the CSS?
>
> The conf.py seems to furnish these details, but if one adds an href
> there, it is displayed as is, with the copyright text.
>
> |
> copyright =u'2015, <a href="www.example.com">NameGoesHere</a>'
> |
>
>
> The theme.css seems to contain the directive, but I'm wondering if
> there's a way to do this without hardcoding it in there.
>
> |
> fa-copyright:before{content:""}
> |
>
>
> In footer.html
>
> |
> <divrole="contentinfo"><p>{%- if show_copyright %} {%- if
> hasdoc('copyright') %} {% trans path=pathto('copyright'),
> copyright=copyright|e %}&copy; <ahref="{{ path }}">Copyright</a>{{
> copyright }}.{% endtrans %} {%- else %} {% trans copyright=copyright|e
> %}&copy; Copyright {{ copyright }}.{% endtrans %} {%- endif %} {%- endif
> %} </div>
> |
>
> Appreciate all inputs, thanks!
> M
>
> --
> You received this message because you are subscribed to the Google
> Groups "sphinx-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to sphinx-users...@googlegroups.com
> <mailto:sphinx-users...@googlegroups.com>.
> To post to this group, send email to sphinx...@googlegroups.com
> <mailto:sphinx...@googlegroups.com>.
> Visit this group at http://groups.google.com/group/sphinx-users.
> For more options, visit https://groups.google.com/d/optout.

Monami Bhattacharya

unread,
May 26, 2015, 5:01:31 AM5/26/15
to sphinx...@googlegroups.com
Hey, Luc.

Considered the copyright.rst way  before posting here, but that's not what I want. Want to keep it where it is, by default, and hyperlink it. Thanks for the layout.html pointer - will give that a shot!

-M 
Reply all
Reply to author
Forward
0 new messages