Closed Kentoseth closed 10 years ago
I can't tell for sure without seeing the rest of the code. You can read more on developing a theme for Pelican here: http://docs.getpelican.com/en/3.3.0/themes.html
Also, if you need any help with a general problem with Pelican, #pelican on Freenode is great place to get help.
Hello @hdra , I am using the Cait theme you have developed. All the other code is the same, I am simply adding a "categories.html" file to the /templates/ folder.
How do you call upon categories to display on their own using your theme?
Okay I got it to work now, using the same styling as the index.html page. It seems that the categories will show using the normal code, but it has to be placed in an HTML tag using the - class="post-container"- otherwise it will be there, but not be seen (I assume it is on the left side of the page, hiding under the sidebar).
If you'd like to see my code, I can paste it here. Let me know.
Thanks for the help :-)
I assume you got it to work? One way to debug when developing a theme is by checking the HTML source generated instead of checking it visually on the browser. This way, you would know if the issue is with the generator, or just a mistake in styling.
Yeah, it's working.
I ended up doing that (checking the output files) to make sure that the correct output is being generated.
I am using the same styling for entry headers on each category and it looks quite nice. Here is the code for categories.html:
{% extends "base.html" %}
{% block title %}
{{ SITENAME }} - Categories
{% endblock %}
{% block stylesheets %}
{{ super() }}
<link rel="stylesheet" href="{{ SITEURL }}/theme/css/blog.css">
<link rel="stylesheet" href="{{ SITEURL }}/theme/css/github.css">
{% endblock stylesheets %}
{% block content %}
{% include "sidebar.html" %}
<div id="post-container">
<ul class="entry-header">
{% for category, articles in categories %}
<h2><li><a href="{{ SITEURL }}/{{ category.url }}">{{ category }}</a></li></h2>
{% endfor %}
</ul>
</div>
{% endblock content %}
Hello,
I am trying to create a categories.html page in the /templates/ directory, but when generating output for that template, I get no categories displayed.
Here is the code:
I have tried multiple varieties to display the categories, including a simple:
However, nothing has worked so far. I suspect that it has something to do with how categories are generated. Any help will be appreciated.
The goal is to display all the categories on the same blog layout where articles appear (meaning sidebar on the left and a list of categories on the right).