hughbris / grav-theme-landed

Grav port of Landed theme by HTML5 UP
MIT License
15 stars 8 forks source link

The images should be part of the content / banner image home page #15

Closed ganar closed 4 months ago

ganar commented 5 months ago

The way Landed handles images in key parts of the templates is bogus.

It took me a long while perusing the code and doing tests to understand that the banner image in the front page only works if it is within the image folder inside the theme.

This ensures that the images that form part of the content will get erased with the template by an update.

Would you consider setting those paths to the images in the top YAML or even being able set an external image on the content path on the template configuration?

hughbris commented 5 months ago

Thanks for this.

This probably is bogus. I try something different every time I make a theme. Some of my older themes have quite poor architecture.

But I don't think it's bogus for the reason you give. Are you using (a) just Landed, (b) a cloned copy of this theme, or (c) a child theme that inherits? How do you customise CSS when you use a theme?

So I always inherit my themes for the reason you talk about. I want to upgrade themes without losing customisations.

It's possible for the theme's creator to add more options in the theme's frontmatter to improve flexibility. For your example, I could accept a full path in frontmatter rather than requiring the /images path. I just checked where I once built a site with this theme, using the inheritance system. I have a my banner image filename specified in homepage frontmatter, but that image is in the "child" theme's /images folder, not Landed's.

So I do think this could be improved but at the same time it seems you are limiting yourself by using themes directly.

If you inherit the theme and you really don't even want to put your banner images in the images folder, you could override the banner template and use your own logic with your own frontmatter structure. It gives you lots of flexibility!

ganar commented 5 months ago

Let me start by saying that I truly appreciate the effort done to port the template for GravCMS, that in itself is an important work to keep the platform going.

But I don't think it's bogus for the reason you give. Are you using (a) just Landed, (b) a cloned copy of this theme, or (c) a child theme that inherits? How do you customise CSS when you use a theme?

It depends on the use case: Who is this template for? How much time is needed from downloading the template to actually being able to use it? In my case I spent two full days wrangling with it and had to abandone the effort.

I've done complex templates myself, and have used the techniques that you mentioned above. Sometimes, even for a developer, you have limited time, just want to test an idea and this was not possible with Landed.

It is important to shorten the time between wanting a digital product and being able to extract its value (paraphrasing Luke Wroblewski).

I understand the caveats that this imply: this is a free download and doing a complete theme does take a lot of time, specially if you strive to make it adaptable and easy to use.

Suggestions on what can be done about it:

hughbris commented 5 months ago

Thanks, I don't mind this conversation. Sometimes I think someone else reading will just wonder why one of us didn't just spend the time putting this feature in! My reply would be that these are interesting meta questions.

However, just to be clear on your original question whether I would be open to modifying the theme: yes I would and it sounds like you have the expertise, so a PR would be accepted. I only ask that you maintain backwards compatibility.

It depends on the use case: Who is this template for? How much time is needed from downloading the template to actually being able to use it? In my case I spent two full days wrangling with it and had to abandone the effort.

So the background is that I built this for a friend's website. It was totally focused on that task. I decided to share it. It's sad that site never launched and I'm not using it any more, or I would probably be making more improvements.

I'm sorry you spent two days. That is frustrating and should never happen just because of opaque design and poor docs. But I have spent much more time than that hacking on open source projects that are poorly supported. I've just spent months without income, and all the stress that comes with that, trying to make Fullcalendar do things that aren't described. (It was more the JS library than the Grav plugin but it started with the plugin.)

I have started to think that's normal and developed some strategies for integrating my modified plugins into sites when the plugin developer is unresponsive or won't accept my PRs. For example, in my dependencies files I have entries like:

    sitemap:
        url: https://github.com/hughbris/grav-plugin-sitemap
        path: user/plugins/sitemap
        branch: collected-mods

I've done complex templates myself, and have used the techniques that you mentioned above. Sometimes, even for a developer, you have limited time, just want to test an idea and this was not possible with Landed.

So I have to ask why you spent two days with a problem you had enough knowledge to circumvent?

I mean, it is possible and I gave you a couple of ways. The theme could be more flexible but it sounds like you don't need that yourself. We get back to the question of who this is for. It was for me primarily and I offered it to everyone.

So I struggle enough with questions of perfectionism. It's a question of time for me. I have many more projects I would like to make perfect before this theme which am not currently using. If I was selling this, maybe.

  • Try to come up with a couple of use cases for the template

It was for an artist to showcase work. I haven't thought much about what else it could target.

  • Publish a squeleton for this template

OK, sorry no. Skeletons were intended to be bundled starter sites for use cases not themes. The proliferation of skeletons of "XTheme Site" are a misreading of what skeletons are for. Skeletons should be like "School site", "Tradesperson for hire", or "Artist folio". Functional, not style driven.

You already know about theme demo content. That is essentially all that theme skeletons are. They add no value except for a slight convenience.

Your other suggestions would be great if I had lots of time or if this was a commercial product. I'm just not that ambitious for this theme. Let me also say that I am very happy others are using it.


I hope with the cultural differences we find on this global platform that you don't think I'm angry. Like I said, I enjoy this conversation and welcome your input :) I just think we need to put this project in perspective.

Please let me know if you will create a PR. I must admit I kind of want to fix this now, so I may do it if you don't.

hughbris commented 4 months ago

I've added a branch which, if merged, will add homepage banner details using page media, as you originally suggested. I agree that this is the most intuitive and unsurprising location for them. I looked at similar banner features in other themes I've built. They also reference homepage media as page media.

The current approach is definitely bogus, but I have maintained support for it so that sites don't break. It means I need to support both a new and an old frontmatter structure for a while.

I only added homepage blueprint support for the new frontmatter structure. We want to deprecate the old.

Please let me know what you think. I may merge this in a few days if I don't hear back.