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

📚 Doc: Add detailed documentation for the templates guide #3108

Closed
3 tasks done
grivera64 opened this issue Aug 22, 2024 · 4 comments · Fixed by #3113
Closed
3 tasks done

📚 Doc: Add detailed documentation for the templates guide #3108

grivera64 opened this issue Aug 22, 2024 · 4 comments · Fixed by #3113

Comments

@grivera64
Copy link
Contributor

Maintenance Task Description

This issue proposes to provide more snippets of ways to use templates in Go Fiber’s templates guide.

This would include adding information on how to:

  • Render dynamic html content (e.g. convert string into html)
  • Iterate through arrays/slices/map in templates
  • Any other common use cases for templates

Impact on the Project

Adding more detailed documentation of common use cases will help make Go Fiber easier to adopt for newcomers interested in using templates. While guides on templates can be found on other websites, providing this information within GoFiber’s own docs will make it easier to get started.

Adding this might require re-ordering the headings within the gofiber.io templates guide to avoid cluttering the page, but we can follow the format of similar pages (view additional context).

Additional Context (optional)

The goal is to have a more detailed guide for templates like in the routing guide:

Thank you for your time and consideration.

Checklist:

  • I have confirmed that this maintenance task is currently not being addressed.
  • I understand that this task will be evaluated by the maintainers and prioritized accordingly.
  • I am available to provide further information if needed.
@efectn
Copy link
Member

efectn commented Aug 23, 2024

Feel free to create a PR. I agree with you, we need more detailed guides for templates. We can add common usecases into templates section and specific usecases to template itself

@grivera64
Copy link
Contributor Author

Sounds good! I made a draft PR to work on this issue.

I am currently working on adding a few advanced use cases, (such as using engine.AddFunc()). We can also consider adding the use cases featured in the gofiber/template README.md, though we should only include generic features provided by all template engines.

@ReneWerner87 ReneWerner87 linked a pull request Aug 28, 2024 that will close this issue
13 tasks
@grivera64
Copy link
Contributor Author

I also added a link to the gofiber/template GitHub repository to help guide newcomers to find engine-related code.

I believe the PR is ready to be pulled, please let me know if I should make any changes or if you have any recommended additions.

@grivera64
Copy link
Contributor Author

Thanks @ReneWerner87 for merging my pull request to v2 and adapting it for v3! Marking this issue as completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants