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

Add Mustache template support #60

Closed
ghost opened this issue Aug 26, 2013 · 23 comments
Closed

Add Mustache template support #60

ghost opened this issue Aug 26, 2013 · 23 comments

Comments

@ghost
Copy link

ghost commented Aug 26, 2013

Mustache is langugage independent template system. If you implement mustache support I think more people migrated from other static site generators.

Thanks,

@spf13
Copy link
Contributor

spf13 commented Aug 26, 2013

I agree and it shouldn't be very difficult. Could seamlessly support both
based on template extension. Pull request anyone?

Steve Francia
spf13.com
@spf13

On Aug 26, 2013, at 5:08 PM, Xavier [email protected] wrote:

Mustache is langugage independent template system. If you implement
mustache support I think more people migrated from other static site
generators.

Thanks,


Reply to this email directly or view it on
GitHubhttps://github.com//issues/60
.

@ghost
Copy link
Author

ghost commented Aug 27, 2013

If I were Go programmer, I will do, but right now, I'm just user of static content generators. I tried several: nanoc, acrylamid, hakyll, but all of these have an issue: 'if you want to use me, you have to learn new template syntax'.

Very nice if someone could implement it,

Thanks,

@spf13
Copy link
Contributor

spf13 commented Aug 28, 2013

I'm all in favor of supporting mustache and any other templating language
people want to include. As I've already demonstrated with support for yaml,
json and toml I think Hugo should be pluggable to handle a variety of
different content and format and all without any additional configuration.
It just works when you use a supported file. For the first iteration I
choose go templates because that had the best support in go. mustache
support is decent in go and should be next. As far as I know there aren't
any other template formats supported yet.

The catch is for any of these additional formats I need someone to be the
maintainer of their support. I'm already maintaining the set we currently
support, but doubt I could keep track of many more.

Anyone up for taking on mustache?

Steve Francia
http://stevefrancia.com
http://spf13.com
http://twitter.com/spf13

On Tue, Aug 27, 2013 at 5:07 AM, Xavier [email protected] wrote:

If I were Go programmer, I will do, but right now, I'm just user of static
content generators. I tried several: nanoc, acrylamid, hakyll, but all of
these have an issue: 'if you want to use me, you have to learn new template
syntax'.

Very nice if someone could implement it,

Thanks,


Reply to this email directly or view it on GitHubhttps://github.com//issues/60#issuecomment-23322269
.

@yobennett
Copy link

I'll take a stab at putting together support for Mustache. I haven't made any contributions to a Go project yet so it'd be great to get some feedback once I submit a pull request.

@spf13
Copy link
Contributor

spf13 commented Aug 28, 2013

I'd love to help provide feedback and even help code it, just can't
maintain long term.

Steve Francia
http://stevefrancia.com
http://spf13.com
http://twitter.com/spf13

On Tue, Aug 27, 2013 at 11:34 PM, Bennett [email protected] wrote:

I'll take a stab at putting together support for Mustache. I haven't made
any contributions to a Go project yet so it'd be great to get some feedback
once I submit a pull request.


Reply to this email directly or view it on GitHubhttps://github.com//issues/60#issuecomment-23387691
.

@yobennett
Copy link

Awesome! I'd gladly maintain, @spf13. I'll have some free time next week to get started.

@Mistobaan
Copy link
Contributor

I would like to add amber as template engine: https://github.com/eknkc/amber

@avidal
Copy link

avidal commented Apr 4, 2014

Should this issue be closed? There's already a dependency on the eknkc/amber package in template/bundle/template.go

@spf13
Copy link
Contributor

spf13 commented Apr 4, 2014

Amber came out of this, mustache still hasn’t… I suppose it’s still open.

@avidal
Copy link

avidal commented Apr 4, 2014

Ah, I see. I'm looking to contribute so I poked to the back of the issue list and saw this one; wasn't sure if it was a sign of lack of triaging/caretaking or not :)

@mohae
Copy link
Contributor

mohae commented Sep 9, 2014

Looking into this, it appears that the mustache package in Go, hoisie/mustache, is no longer maintained. The last commit was May 13, 2013, with pending pull requests.

There are more recent forks out there, but I didn't check what changes they made.

Is mustache something that should be a milestone given its state in Go?

@spf13
Copy link
Contributor

spf13 commented Sep 11, 2014

I suppose not. It's sad there isn't better mustache support in Go. Until there is we should mark this as future.

@mohae
Copy link
Contributor

mohae commented Oct 2, 2014

I forked what seemed to be the best version of mustache: Wuvist/mustache, went through all the pull requests on https://github.com/hosie/mustache, and updated the tests.

I didn't integrate all of the outstanding pull requests.

I used the updated tests from @adammck but had to update a signifcant amount of their expectations to meet what I though mustache expected. They all pass, though that doesn't mean they are all correct. I have a list of the failed test lines that were changed and will post that as an issue on my repo.

Beyond that, I haven't had a chance to do much with it, but I will probably set up a Hugo site using it to see what breaks on the mustache side.

Hopefully, it support for it will be added to Hugo soon.

@adammck
Copy link

adammck commented Oct 2, 2014

The tests in hoisie/mustache/pull/43 were generated from the Mustache spec by this little tool. I believe that the expectations are correct, but the Mustache library is non-compliant.

@mohae
Copy link
Contributor

mohae commented Oct 2, 2014

@adammck Thanks for your input!

I had read the Mustache docs, but they were unclear on what should occur in certain situations, the ones which the Mustache library failed on. I couldn't find anything clearer in other tests I looked at so I did a combination of looking at the strings and what I thought the resulting substitutions would look like, which got rough on the tests that tended to fail, and the output, for simpler cases, from trymustache.com. The results tended to match the results from the library, but I did not attach any validity to that coincidence, hence my comments about passing and correctness.

I wish I had seen the specs and your tool earlier. I'll go through the spec and your tool to get a better understanding of Mustache and what needs to be done to the library.

@mohae
Copy link
Contributor

mohae commented Oct 2, 2014

After review of the spec objects, I have reverted the Mustache tests to @adammck's version. I will update when the Mustache library is compliant to the current set of tests.

@mohae
Copy link
Contributor

mohae commented Nov 23, 2014

@spf13 can this be pushed to 'Future' instead of .13 milestone?

There is a chance I will get this done sooner than that, but I still wouldn't be comfortable having it as part of the next release, esp. since there's enough changes in it already.

When I originally said I'd add support it was based on using the existing Go mustache package, but that is not a workable solution imo, or there seems to be a reason, or reasons, why there are so many abandoned forks. That coupled with the original author's response to using the Mustache spec tests led me to decide that a different package should be used.

Unfortunately that meant writing one from scratch. The package, when completed, being so new, is the reason why I wouldn't be comfortable having it as part of the next release, even if it were completed before then.

@spf13
Copy link
Contributor

spf13 commented Nov 24, 2014

Totally valid reasons. Bumping.

@spf13 spf13 modified the milestones: future, v0.13 Nov 24, 2014
@bep bep changed the title Put support of mustache template system Add mustache template support Aug 22, 2015
@bep bep changed the title Add mustache template support Add Mustache template support Aug 22, 2015
@bep
Copy link
Member

bep commented Jun 11, 2016

@mohae status?

@bep
Copy link
Member

bep commented Feb 28, 2017

This issue has been automatically marked as stale because it has not been commented on for at least four months.

The resources of the Hugo team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, and you feel that it is still valuable, please open a proposal at https://discuss.gohugo.io/.

This issue will automatically be closed in four months if no further activity occurs. Thank you for all your contributions.

@bep bep added the Stale label Feb 28, 2017
@bep
Copy link
Member

bep commented Mar 1, 2017

Note/Update: This issue is marked as stale, and I may have said something earlier about "opening a thread on the discussion forum". Please don't.

If this is a bug and you can still reproduce this error on the latest release or the master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.

@bep
Copy link
Member

bep commented Mar 1, 2017

I would say that, this issue being so old, and no one has stepped up to the task of implementing it: If someone wants to create a PR with this feature, he/she should create a new tracking issue.

@bep bep closed this as completed Mar 1, 2017
moorereason pushed a commit to moorereason/hugo that referenced this issue Sep 13, 2019
A change was made in response to gohugoio#60 (fork/exec: exec format error) on the wiki that would be useful to also propagate to the readme.
bep added a commit that referenced this issue Nov 27, 2020
1de7a358c Clarify that "with" blocks do not render with empty values (#1287)
b48de8b0a Update js.md
e0124e4b1 Update js.md
087b39d74 Update hosting-on-render.md (#1286)
8f02b5412 Update js.md (#1284)
8dd8a8d1d Add link to "Build Websites with Hugo" book (#1174)
ae2dc138a Fix typo in page bundles (#1283)
ab14bfec3 Update configuration directory section
17da77ff1 Update multilingual.md (#1280)
5bce8db3a Fix for site-hierarchy image, issue #60
9d7a2366d Fix typo
ad4210c41 Fix typo
c88bc0383 Fix orphan branch url (#1262)
1cf6cf5b3 Hugo 0.78.2
538c3cb86 Merge branch 'tempv0.78.2'
e5e07fc81 releaser: Add release notes to /docs for release of 0.78.2
120a61a47 Fixed wrong var assignment example
4cebbb1a7 Ignore remote JSON errors (for now)
618fcf9ba Add a link to modules config option 'replacements'
e12722779 Fix typo ("wil" -> "will") (#1273)
0670e9894 Update js.md
5bde834cf Update GH docs to say "main" as default branch
26312f93d Update index.md
eb6f51df1 Update js.md
b890dc84d Merge branch 'tempv0.78.1'
6b73ea450 releaser: Add release notes to /docs for release of 0.78.1
46e582112 Update starter-kits.md (#1268)
a62786235 Update 404 docs: GitLab auto-detects 404.html (#1173)
cbd4fd2d9 Fix typo (#1271)
2ba3f9386 Update js.md
7b5109d90 Update js.md
bc75bc962 Release 0.78.0
0b2e8b0f1 releaser: Add release notes to /docs for release of 0.78.0
9ecba8480 Merge commit 'b74591123eac47a20d1f26ff3e2d291cd9c5cfc0'
60a475df7 js: Add avoidTDZ option
3b895261f Make js.Build fully support modules

git-subtree-dir: docs
git-subtree-split: 1de7a358cac94ac09a513456bdaae65e6ae94859
@github-actions
Copy link

This issue 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 Mar 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants