Giter VIP home page Giter VIP logo

Comments (7)

bakerkretzmar avatar bakerkretzmar commented on June 11, 2024

Do you need to have a file called .blade.php in your collection folder? Can you explain what breaks exactly, and what you would expect here?

from jigsaw.

husseinalhammad avatar husseinalhammad commented on June 11, 2024

I quickly tested this. It seems to me the blade file is rendered fine, but is not generated in the expected place when it doesn't extend a layout. This is easier to observe when you disable pretty URLs; the generated filename is just the extension .html and is saved to the root of build_*.


The docs indicate that collection items can be Blade files:

Collection items can be Markdown or Blade files, or even Blade/Markdown hybrid files.

from jigsaw.

simonhamp avatar simonhamp commented on June 11, 2024

Can you explain what breaks exactly

Everything - if you have a collection 'entry' file that you decide to use .blade.php for but you don't make it extend a layout, it's like it overrides all other output whatever URL you look at. If the file is empty (like what I did when I was just starting), that results in just a blank view for every valid page

and what you would expect here?

I'd expect a little more detail in the docs so if you choose to use a .blade.php file, it's clear that you can't just use empty files, you need to configure them.

Even better than that though, would be that this doesn't have this weird side-effect, that you could use any file type at this point and it not completely break the builds.

from jigsaw.

bakerkretzmar avatar bakerkretzmar commented on June 11, 2024

Oh I thought you meant one file literally called .blade.php. I can't reproduce this, empty Blade files or Blade files that don't @extend anything work fine for me in a fresh site. Can you share a repo or more of you site config so I can try to reproduce and debug this?

from jigsaw.

simonhamp avatar simonhamp commented on June 11, 2024

Ah, sorry. No I meant any *.blade.php files.

empty Blade files or Blade files that don't @extend anything work fine for me in a fresh site.

Are they in a collection? If you create a collection called posts and a collection folder called _posts and in that folder place an empty test.blade.php... what do you see in the browser for /index.html?

from jigsaw.

bakerkretzmar avatar bakerkretzmar commented on June 11, 2024

Oof okay yeah it's blank. I'll dig into this, thanks πŸ‘πŸ»

from jigsaw.

bakerkretzmar avatar bakerkretzmar commented on June 11, 2024

@simonhamp thanks again for reporting this. The intended behaviour is that omitting @extends renders nothing, because the extends metadata is basically how you tell Jigsaw 'this item has a parent template and should be rendered'.

This is mentioned in the docs: https://jigsaw.tighten.com/docs/collections-extending-parent-templates/#collection-items-with-no-parent-template

This makes a bit more sense with Markdownβ€”if the file doesn't have an extends then it's basically just data, and you can still use it as a collection item, render it manually (e.g. in a list on another page), etc. but it doesn't automatically render its own page. The same is true for Blade files, which is a bit counter-intuitive because using Blade files as 'data' and not rendering them isn't really a thing.

The bug here (and it's a doozy) is that those Blade collection items are just completely overwriting other pages. I've fixed that and will open the PR in a sec.

Do you have a specific use case in mind here for Blade collection items that are rendered and do not extend a parent template? Why don't you have a layout? One thing that you can do with Markdown files is set extends in the collection config so you don't need to repeat it in every file, that's never worked for Blade but we could look into it.

from jigsaw.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.