Skip to content

Add TwigBundle 6.4 with file_name_pattern: *.twig #1256

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

Merged
merged 3 commits into from
Jan 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions symfony/twig-bundle/6.4/config/packages/twig.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
twig:
default_path: '%kernel.project_dir%/templates'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this the default already in TwigBundle ? If yes, I suggest removing the explicit config duplicating it, to simplify things.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it's already the case

Copy link
Member Author

@GromNaN GromNaN Nov 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a few settings that are just the defaults to show how to override things. This is one of them. Maybe not that frequent, I just wanted to highlight why it was there.

file_name_pattern: '*.twig'

when@test:
twig:
strict_variables: true
12 changes: 12 additions & 0 deletions symfony/twig-bundle/6.4/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"bundles": {
"Symfony\\Bundle\\TwigBundle\\TwigBundle": ["all"]
},
"copy-from-recipe": {
"config/": "%CONFIG_DIR%/",
"templates/": "templates/"
},
"conflict": {
"symfony/framework-bundle": "<5.3"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it still necessary? The bundle has a conflict rule with symfony/framework-bundle <5.4

}
}
16 changes: 16 additions & 0 deletions symfony/twig-bundle/6.4/templates/base.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>{% block title %}Welcome!{% endblock %}</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text></svg>">
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know why we use this sober emoji instead of something more fun like ⭐ or 🎯.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the sf logo... but without sf 😂

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, projects must change their favicon to use their own anyway. Having a default one here avoids getting 404 errors when browsers try to load a default favicon.ico file otherwise.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh! Let's add the sf then.

Suggested change
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text></svg>">
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text><text y=%221.3em%22 x=%220.2em%22 font-size=%2276%22 fill=%22%23fff%22>sf</text></svg>">

Chrome
image

Firefox
image

Copy link
Member Author

@GromNaN GromNaN Jan 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of making a icon from an emoji. It makes it very easy to anyone starting a project to use something from the existing emojis.

{% block stylesheets %}
{% endblock %}

{% block javascripts %}
{% endblock %}
</head>
<body>
{% block body %}{% endblock %}
</body>
</html>