Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An option to embed a link on sidebar logo #77

Closed
gaow opened this issue Jan 10, 2019 · 4 comments · Fixed by #79
Closed

An option to embed a link on sidebar logo #77

gaow opened this issue Jan 10, 2019 · 4 comments · Fixed by #79

Comments

@gaow
Copy link
Contributor

gaow commented Jan 10, 2019

I've got a feature request: is it possible to add to _config.yml an option to embed a link to sidebar logo? There is currently a logo on the side bar without any embedded link. For my case I'd like to point it to the github repository. Does it sound reasonable?

@choldgraf
Copy link
Collaborator

That's a great idea - it seems this could be done with a yaml config option like sidebar_logo_link: "". Then in the sidebar.html template, do something like:

{% if site.sidebar_logo_link | length < 1 %}
{% capture sidebar_logo %}{{ site.baseurl | relative_url }}
{% else %}
{% capture sidebar_logo_link %}{{ site.sidebar_logo_link }}
{% endif %}

then

wrap the logo in <a href="{{ sidebar_logo_link }}">...

I can try to look into this in the next few days, though a PR is most-welcome! :-)

@gaow
Copy link
Contributor Author

gaow commented Jan 10, 2019

Thank you @choldgraf your pointer above seems perfectly clear even though I'm not familiar with jekyll at all. I tried to add those relevant code in _layouts/sidebar.html but got this error:

  Liquid Exception: Liquid syntax error (/home/gaow/Documents/GIT/wiki/dsc-wiki/jupyter-book/_includes/sidebar.html line 19): capture tag does not expect 'else' tag included in /_layouts/default.html

in any case would be nice if you could take a look at when you get a chance. Or else I can certainly give it a stab at when I have a chance to learn some more of it later ...

@choldgraf
Copy link
Collaborator

I think I got it figured out - wanna give it a shot? :-)

@gaow
Copy link
Contributor Author

gaow commented Jan 10, 2019

Thank you @choldgraf it works flawlessly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants