Closed tshepang closed 5 years ago
That would be great. How can this be done? Jinja discourages and doesn't let you put logic into template. There is no straight forward way to do it in Elegant theme.
Possible solutions are to create a Pelican Plugin or change Pelican code base.
If user has a page with slug about
or about-me
, it might be very easy to include the page content in index template.
Hmm, so Elegant will have to iterate over the pages and find the one that
has about-me
slug and then put its content into "About me" section. Cool
idea, seems workable.
What if user wants to use this slug but don't want it to be put in Elegant's section?
She can make use of LANDING_PAGE_ABOUT
, maybe set it to False or None.
This will not stop Pelican from generating "About Me" page. It will also be present in Pages variable so "about-me" will have to be skipped where ever Pages is used.
What if we miss skipping some where? How will this filtering affect performance?
IMHO, a cleaner way is to have a About Me plugin. It can call Pelican classes and methods to convert the markup into html.
Shouldn't there be a way in Pelican to create any particular section of text (like the About Me) from markdown? What if I wanted, say, a Message of the Day to appear in the right column of each page? How would I go about putting this md content in its own file, and have it treated as a "section", rather than a page?
Figured out an easy way to do this. Put "About Me" markdown in a page, but make it status: hidden
. Then in the index.html template (class="article-content"
), just look in the list hidden_pages
for the page which has the correct title, and insert the page.content
.
@codecachet very cool. Love it. Let me know if you can open a PR.
@iranzo can you find time to implement what @codecachet has suggested?
This is in Q3 milestone, it's not as urgent as tasks in Q2 milestone.
I was having a look at this yesterday night, I need to find how to loop in jinja for this and then extract the data and make the relevant code changes
Talha, do you have a pointer on how to perform the loop against the filter for articles? Not familiar enough with pelican templates for writing the loop for this :-/
Can you try
{% for article in articles %}
{% if article.status == blah and article.title == "Landing Page About Me" %}
I think we need a specific title for the article we are going to use for about me.
@tshepang and @calfzhou, it took five years 😆 but the feature is finally here. Currently in beta.
https://next.elegant.oncrashreboot.com/customize-home-page
(You may have to add ssl error exception to visit the page. Netlify SSL has some issue.)
It gives me immense pleasure to close a five year old feature request.
@all-contributors please add @codecachet for ideas
@talha131
I've put up a pull request to add @codecachet! :tada:
:tada: This issue has been resolved in version 3.0.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
Curremtly,
LANDING_PAGE_ABOUT
is used for that, which is not ideal, especially since it needs (I think) to be written in raw html. Perhaps a solution where this file is read off some file somewhere?(encouraged by https://github.com/talha131/pelican-elegant/pull/77#issuecomment-29552207 to request a feature before 2.0 gets released)