Closed ghost closed 6 years ago
Since the page meta only shows if page.date
is true
, did you try taking the simpler route and just add date: false
to your collection documents?
You could put it in all of their YAML Front Matter or use front matter defaults in your _config.yml
to assign it to all the documents in your collection.
I thought that there was a setting like that, but I am new to yaml so I wasn't sure and I couldn't find it when I did a lazy look on the internet. The thing is that I really think that page-intro.html was trying to do too much and made for a lot of repetition and inflexibility. I mean your code is really good as far as it goes, there are just some things that I think could be better.
That's not the main reason I fixed the code, my main reason was the issue with the collections, but there are a few things I'd like to fix.
The only other real thing I want to fix in the code is your inner
class. All it really does is put a .5 rem
on the element, but you have it being used in multiple (really complex [selector]) ways. And because of that, you have to put the footer inside of the main
tag, which isn't semantical. Plus, because you use a different style of inner on the page.html and cv.html, it makes it difficult to just remove the offensive divs and add everything to default.
In my mind the .5 rem
should be added on the container and the page should have no inner's whatsoever.
It would be a lot cleaner, more semantical and more flexible.
Don't get me wrong your code is great, but that damn inner crap is frustrating. :)
The inner
s are there to add flexibility to the theme as there are cases where content might be null
and the layout will look like crap due to inconsistent spacing.
You have valid point about moving footer
from main
to make it semantically correct. Something I've already taken care of in 6914f7e53bfd11803df821a71fc199ece3a1b114
I just figured out that I did not put my code in the right spot, it should be below <div class="initial-content">
if anybody decides to use this code instead of your solution. The one thing I will say is that turning off dates in collections could have adverse affects to your ability to sort the items.
Also, glad you fixed the footer. I will have to look into adding that to my code. But I am still looking to figure out everything with inner. I still think it is too opinionated and makes you have to write too much duplicate code. At the very least, the inner used on the canvas should be renamed so that if we have to keep that that we can at least not be required to include it in our layouts for every single page.
All my themes are opinionated. They were made for me at some point.
This issue has been automatically marked as stale because it has not had recent activity.
If this is a bug and you can still reproduce this error on the master
branch, please reply with any additional information you have about it in order to keep the issue open.
If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.
This issue will automatically be closed in 7 days if no further activity occurs. Thank you for all your contributions.
So I have been working on adapting this theme to my needs, and I found a slight bug in the theme (or in Jekyll itself, how you like), the issue is that when you create a collection and you use the Boolean
output: true
which will create a hyperlink/permalink based on title: it also creates an invisible date. That date is then seen by the page-intro.html 'page.date` IF statement and thus all of my collection html pages had an author name, date of creation and read time. Not what I needed.In theory, there should not be been an IF statement created for the blog meta since there is only one case when you want it to be posted, which is on the articles themselves.
Solving the issues required some working out of the code. I first broke down the page-intro.html into component parts.
I did this in order to isolate the page-meta.html. I then took the common code along with my new pages and added it to default.html in _layouts:
At this point this was my page.meta.html file.
After that I needed to create an if statement to only add the meta file if it was a post. So I added this around the include (page.layout == 'post'):
Which says if this is a post, add this.
The other problem I had was that the CV file has it's own intro.html file which mimics a lot of the page-intro.html file, but changes the title filter to include the json title filter. I ended up removing that file entirely from the control flow and took the parts that were necessary and included them back into the default.html. I mainly took the includes out of the CV.html _layout file like this. heads-up: The {% include cv/intro.html %} was removed.
I was then able to create an IF statement that would only show the CV title when it was actually the CV page. I also made an if statement for the CV subtitle filter that included an AND statement (see below). I know it seems like a lot, but in the end it works. Here is the new default.html. (one other thing of importance- I needed to re-add the variable {% assign cv = site.data.cv %} to the default.html file above the CV title string for this to work): My new code begins on like 43 just below:
<div class="initial-content">
and ends on line 73 in the default.html file.