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

[Enhancement]: Collection of external links in sidebar #110

Closed
rpodcast opened this issue Jun 1, 2017 · 3 comments
Closed

[Enhancement]: Collection of external links in sidebar #110

rpodcast opened this issue Jun 1, 2017 · 3 comments

Comments

@rpodcast
Copy link
Contributor

rpodcast commented Jun 1, 2017

One of the customizations I made to my (now pretty outdated) fork of this theme was the ability to specify a custom layout called sidebar_links that gives another container in the sidebar with links to other sites. You can see this in action on my podcast site under the Subscribe box. I've gotten positive feedback on this from my listeners (even with my previous version of the site based on Nikola) so I'm wondering if it would be worthwhile to add in some capacity here. As far as implementing this, here's what I did (acknowledging that it is rather cludgy and not easy to generalize):

  • Separate out the subscribe and links portions of the sidebar layout as separate partials (sidebar_subscribe.html and sidebar_links.html) and have the sidebar.html simply include them. Note that the sidebar_links.html is empty
  • Within my site files, populate a partial sidebar_links.html following a similar format as the subscribe RSS layout but with the links hard-coded as typical <li> list items.

Ideally if there was an easy way to define say an array of site links as a configuration option in config.toml and have a layout dynamically populate the links in the custom layout that would be far more optimal, but when I made this enhancement I was just beginning to learn Hugo and just needed something quick. Hope all of this makes sense!

@mattstratton
Copy link
Owner

I've already been sorta thinking of making partials for each widget anyway, so this should be fairly straightforward.

Doing this in config.toml wouldn't be too very bad; I consider it similar to the author/host thing. In the theme that inspired this I had shortcodes for making links for books, podcasts, etc, but shortcodes only really work in a content file.

This should be pretty easy to implement, and I'll try to work on it today :)

@mattstratton
Copy link
Owner

Take a look at #112 - you can also see it in action here - https://deploy-preview-112--sample-castanet.netlify.com/

Let me know what you think.

@rpodcast
Copy link
Contributor Author

rpodcast commented Jun 2, 2017

Looks great to me! Easy to define in the config and sure beats my hard-coding method from before.

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

No branches or pull requests

2 participants