Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call partials with specific prefixes #2684

Closed
wants to merge 1 commit into from

Conversation

lebarde
Copy link
Contributor

@lebarde lebarde commented Nov 12, 2016

You can now call a partial template with a prefix by doing this:

{{ partial $SomePartialName $SomePrefix . }}

Fixes #2683

You can now call a partial template with a prefix by doing this:

```
{ partial $SomePartialName $SomePrefix . }}
```

Fixes gohugoio#2683
@lebarde
Copy link
Contributor Author

lebarde commented Nov 12, 2016

Sorry, I don't know much about travis, which is not passing.

@bep
Copy link
Member

bep commented Nov 12, 2016

You need to run gofmt on your code.

What do you need this prefix for? Can you give a concrete example that isn't solved without it?

@lebarde
Copy link
Contributor Author

lebarde commented Nov 12, 2016

Thanks for your answer, I'll run that.
Actually it is to implement the widgets mechanism (#2535): I've done some work since my last message (sorry…).

Widget templates are called from an _internal template. Those templates are gathered from the widgets/ directory, so I have to prefix them.

What do you think?

@lebarde lebarde closed this Nov 12, 2016
@lebarde lebarde deleted the partialPrefix branch November 12, 2016 11:46
@lebarde lebarde restored the partialPrefix branch November 12, 2016 11:49
@lebarde lebarde deleted the partialPrefix branch November 12, 2016 11:49
@lebarde lebarde restored the partialPrefix branch November 12, 2016 11:49
@lebarde lebarde reopened this Nov 12, 2016
@lebarde
Copy link
Contributor Author

lebarde commented Nov 12, 2016

Ooops that was a mistake. I am trying to get travis work.

@bep
Copy link
Member

bep commented Nov 12, 2016

What do you think?

I think at widget feature would have to be accepted or rejected as a whole, and not a lot of small pieces. I will close this now.

@bep bep closed this Nov 12, 2016
@lebarde
Copy link
Contributor Author

lebarde commented Nov 13, 2016

You're totally right, as I can see no use case for that excepted for widgets.

@lebarde lebarde deleted the partialPrefix branch November 13, 2016 06:43
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dynamic call to template: partial call with prefix
2 participants