Closed talha131 closed 5 years ago
It looks like this might be another Pelican 4.0 thing.
From the settings documentation (search "Direct Templates")
DIRECT_TEMPLATES
work a bit differently than noted above. Only the_SAVE_AS
settings are available, but it is available for any direct template.
Example: ARCHIVES_SAVE_AS = 'archives.html'
This is a bit confusing though as another section on the same page says this:
URLs for direct template pages are theme-dependent. Some themes use corresponding
*_URL
setting as string, while others hard-code them:'archives.html'
,'authors.html'
,'categories.html'
,'tags.html'
.
I've asked for clarification in https://github.com/getpelican/pelican/issues/2490
Thank @AWegnerGitHub. I have assigned the issue to you.
Please also see this issue
Theoretically the defaults should be valid (pelican defaults), thing is that we shouldn't hardcode them or reference to hardcode them.
So probably yes, 4.x issue let's see what we do get on the issue you raised!
pelican itself doesn't use or generate
*_URL
variables for direct templates.
https://github.com/getpelican/pelican/issues/2490#issuecomment-446666400
So, either we define the *_URL
values in the config file, or we need to utilize another option? The comment linked above gives an example. Would this be a good idea for us?
+1 on defining them in our 'elegant setup guide'
We should strive for making Elegant work for the user out of the box. We already have too many options to configure. We should,
The example here is pretty good.
<a href='{{ SITEURL }}/{{ ARCHIVES_URL or 'archives' }}'>Link to archives</a>
I think it covers both the points.
@AWegnerGitHub, if @iranzo does not disagree or bring up a counter point, please open up a PR in elegant repo with the fixes.
I did a quick test locally and it worked
<li {% if page_name == 'categories' %} class="active"{% endif %}><a href="{{ SITEURL }}/{{ CATEGORIES_URL or 'categories' }}">Categories</a></li>
<li {% if page_name == 'tags' %} class="active"{% endif %}><a href="{{ SITEURL }}/{{ TAGS_URL or 'tags' }}">Tags</a></li>
<li {% if page_name == 'archives' %} class="active"{% endif %}><a href="{{ SITEURL }}/{{ ARCHIVES_URL or 'archives'}}">Archives</a></li>
Validated in live website after elegant merge that triggered documentation rebuild
Thank you @iranzo for testing it for me.
Categories, archives, and tags menu items, they all point to the home page.
I suspect its due to this commit https://github.com/Pelican-Elegant/elegant/pull/186/