This repository has been archived by the owner on Jan 11, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 432
Reset layout inheritance if there is a _reset.svelte in the directory. #1141
Closed
joycollector
wants to merge
2
commits into
sveltejs:master
from
joycollector:reset-leyout-inheritance
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -145,16 +145,15 @@ export default function create_manifest_data(cwd: string, extensions: string = ' | |
|
||
if (item.is_dir) { | ||
const component = find_layout('_layout', `${get_slug(item.file)}__layout`, item.file); | ||
const reset = find_layout('_reset', null, item.file); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about ...
...? Seems to nestle better with our current convention, and you'd know what reset was referring to. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would personally prefer to keep things simple. But if that's a showstopper we can change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
if (component) components.push(component); | ||
|
||
walk( | ||
path.join(dir, item.basename), | ||
segments, | ||
params, | ||
component | ||
? stack.concat({ component, params }) | ||
: stack.concat(null) | ||
(reset ? [] : stack).concat(component ? { component, params } : null) | ||
); | ||
} | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't quite clear to me. Is
_reset.svelte
an empty file? Do you put a new layout in it or if you want additional layout do you place alayout.svelte
alongside it?