Comments (7)
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.
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.
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.
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.
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.
Oof okay yeah it's blank. I'll dig into this, thanks ππ»
from jigsaw.
@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)
- Installation Error, Docs Starter Template: Failed to open stream: Permission denied HOT 2
- Refactor container and bootstrapping
- Browsersync does not appear to be working by default HOT 1
- permalink doesn't update the path in $page->getUrl() HOT 1
- feature request: allow output extension to be changed from .html HOT 4
- Setting collection item data through config.php HOT 1
- Unknown error being thrown after webpack compiling successfully HOT 3
- Collection items can't have same basename HOT 1
- Using starter template. HOT 3
- Allow formatting of pretty URL with trailing slash HOT 8
- Docs build process not working HOT 1
- Fresh install, error mix: command not found HOT 1
- Remote collection nested array returning null in page object HOT 6
- @include dynamic template from $page method in layout HOT 7
- Build process removes certain directories HOT 1
- Different build environment causing build error using Mix
- No share image defined
- Organize Posts By Year in Subdirectory
- Looping through collection items without site variables
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jigsaw.