-
Notifications
You must be signed in to change notification settings - Fork 25.6k
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
Question - Archive layout items #285
Comments
Where were you adding To use the For example if in layout: default
author_profile: true
your_variable: "Some data here." To access it you'd use I haven't worked much with layout variables but I have seen a lot of weird behaviors with them. Depending on which version of Jekyll you're using it may or may not work... and/or inherit properly in other layouts. Just something to be mindful of. |
Yup, I changed author_profile from false to true and it doesn't seem to make a difference. If it matters, here's my archives section from _config.yml
|
Also, if it matters - versions: jekyll 3.1.3, jekyll-archives 2.1.0 |
Not sure if this will make a difference but you forgot to uncomment a few things.. specifically the categories and tags options. This is what I used in my quick test. # Archives
# Type
# - GitHub Pages compatible archive pages built with Liquid ~> type: liquid (default)
# - Jekyll Archives plugin archive pages ~> type: jekyll-archives
# Path (examples)
# - Archive page should exist at path when using Liquid method or you can
# expect broken links (especially with breadcrumbs enabled)
# - <base_path>/tags/my-awesome-tag/index.html ~> path: /tags/
# - <base_path/categories/my-awesome-category/index.html ~> path: /categories/
# - <base_path/my-awesome-category/index.html ~> path: /
categories:
type: jekyll-archives
path: /categories/
tags:
type: jekyll-archives
path: /tags/
# https://github.com/jekyll/jekyll-archives
jekyll-archives:
enabled:
- categories
- tags
layouts:
category: archive-taxonomy
tag: archive-taxonomy
permalinks:
category: /categories/:name/
tag: /tags/:name/ Do you have a public repo somewhere that I could look at? It's probably something simple you're missing as I was able to get it working without much effort. |
Yes - I just put it up here: https://github.com/dpron/dpron.com-2016 |
Ok figured it out. As mentioned up a few responses The conditional that evaluates 1. In {% include base_path %}
{% if page.author_profile or layout.author_profile or page.sidebar %}
<div class="sidebar sticky">
{% if page.author_profile or layout.author_profile %}{% include author-profile.html %}{% endif %}
{% if page.sidebar %}
{% for s in page.sidebar %}
{% if s.image %}
<img src=
{% if s.image contains "http" %}
"{{ s.image }}"
{% else %}
"{{ s.image | prepend: "/images/" | prepend: base_path }}"
{% endif %}
alt="{% if s.image_alt %}{{ s.image_alt }}{% endif %}">
{% endif %}
{% if s.title %}<h3>{{ s.title }}</h3>{% endif %}
{% if s.text %}{{ s.text | markdownify }}{% endif %}
{% endfor %}
{% if page.sidebar.nav %}
{% include nav_list nav=page.sidebar.nav %}
{% endif %}
{% endif %}
</div>
{% endif %} Thanks for helping to identify this bug. 😄 |
Thanks! I wonder why it worked on your test above though? Always glad to help find bugs |
Could have been the version of Jekyll I was using. When I tried your repo you had a newer version that I updated to. I know at one point YAML Front Matter in a layout worked with That's probably why I didn't notice it originally. |
I'm using jekyll-archives and am trying to get the archive-taxonomy layout to include the author sidebar as well as a default header image.
Unfortunately, when I set author_profile: true, it doesn't include the author sidebar.
I also tried adding the block of includes around page__hero that is present in other layouts, but it doesn't seem to pick up the values from adding header:/image: to the yaml of the archive-taxonomy.html layout.
Any hints?
The text was updated successfully, but these errors were encountered: