Comments (7)
Update
@include($page->getRelativePath() . "/_links")
works just fine. The GenerateSitemap
listener was failing and my docker image wasn't dropping the errors for some reason. Thank you for your time on this - doesn't seem to be an issue with Jigsaw at all - rather something between my configuration and the Sitemap system. For now, I've just disabled the generator. When I get back to it, I'll update this thread with whatever issue I find.
Thanks again!
from jigsaw.
What exactly do $page->headerLinks()
and $page->getRelativePath() . '/_links'
output? If @include('docs/platform/_links')
works the only thing I can think of here is that the dynamic path generation isn't actually generating that exact path.
from jigsaw.
If I echo the output of either $page->headerLinks()
or $page->getRelativePath() . '/_links'
- in both scenarios, the output is docs/platform/_links
- I can copy the echoed output and replace the @include
value with that echoed output and it works as expected - but putting any variable in the @include
doesn't do anything. In fact, I'd have to confirm this, but I think it prevents the page from building at all.
from jigsaw.
Can you try assigning the value to a variable and passing it in? Could be something weird happening with parentheses inside the @include()
.
E.g.:
@php
$path = $page->getRelativePath() . '/_links';
@endphp
@include($path)
from jigsaw.
Yep. Tried that. Same exact result. In fact, even if I just do
@php
$headerLinks = 'docs/platform/_links';
@endphp
@include($headerLinks)
It still fails - doesn't even build the page. I get the ✔ Mix: Compiled successfully
but the page didn't compile (I know this by adding extra text, like asdf
on a different line and it not showing up).
from jigsaw.
Oh interesting, okay. This could be a limitation of Blade then, it looks like @include()
needs a string literal and can't handle any kind of expression. Or it could be something weird we're doing. Do either of these work?
@include({{ $page->getRelativePath() . '/_links' }})
@include('{{ $page->getRelativePath() . '/_links' }}')
from jigsaw.
They do not (tried swapping various quote patterns on the second option, as well). I even just tried passing 'links' back from my markdown - the variable makes it back but it seems to just refuse to include any means of it.
my_content.md
---
extends: _layouts.master
section: content
title: My Title
links: docs/platform/_links
---
_layouts.master
@include($page->links)
@include({{$page->links}})
@include('{{$page->links}}')
This page gives me hope that it's possible in newer versions - https://laracasts.com/discuss/channels/general-discussion/blade-include-variable-in-include-function - but I'm not sure of the disconnect between Jigsaw's implementation and Laravel's. I'll keep fighting with it, maybe go the full debug route (was avoiding that in general for the sake of "simplicity"), see if I can find the culprit.
from jigsaw.
Related Issues (20)
- 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
- `*.blade.php` files in collection folders break stuff HOT 7
- 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
- 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
- <x-dynamic-component /> support? HOT 7
- connect theme with laravel cms
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.