15 changed files with 1823 additions and 142 deletions
@ -0,0 +1,9 @@
@@ -0,0 +1,9 @@
|
||||
/* |
||||
* Welcome to your app's main JavaScript file! |
||||
* |
||||
* This file will be included onto the page via the importmap() Twig function, |
||||
* which should already be in your base.html.twig. |
||||
*/ |
||||
import './styles/app.css'; |
||||
|
||||
console.log('This log comes from assets/app.js - welcome to AssetMapper! 🎉'); |
||||
@ -0,0 +1,2 @@
@@ -0,0 +1,2 @@
|
||||
// register any custom, 3rd party controllers here
|
||||
// app.register('some_controller_name', SomeImportedController);
|
||||
@ -0,0 +1,14 @@
@@ -0,0 +1,14 @@
|
||||
{ |
||||
"controllers": { |
||||
"@symfony/ux-live-component": { |
||||
"live": { |
||||
"enabled": true, |
||||
"fetch": "eager", |
||||
"autoimport": { |
||||
"@symfony/ux-live-component/dist/live.min.css": true |
||||
} |
||||
} |
||||
} |
||||
}, |
||||
"entrypoints": [] |
||||
} |
||||
@ -0,0 +1,16 @@
@@ -0,0 +1,16 @@
|
||||
import { Controller } from '@hotwired/stimulus'; |
||||
|
||||
/* |
||||
* This is an example Stimulus controller! |
||||
* |
||||
* Any element with a data-controller="hello" attribute will cause |
||||
* this controller to be executed. The name "hello" comes from the filename: |
||||
* hello_controller.js -> "hello" |
||||
* |
||||
* Delete this file or adapt it for your use! |
||||
*/ |
||||
export default class extends Controller { |
||||
connect() { |
||||
this.element.textContent = 'Hello Stimulus! Edit me in assets/controllers/hello_controller.js'; |
||||
} |
||||
} |
||||
@ -0,0 +1,3 @@
@@ -0,0 +1,3 @@
|
||||
body { |
||||
background-color: skyblue; |
||||
} |
||||
@ -0,0 +1,11 @@
@@ -0,0 +1,11 @@
|
||||
framework: |
||||
asset_mapper: |
||||
# The paths to make available to the asset mapper. |
||||
paths: |
||||
- assets/ |
||||
missing_import_mode: strict |
||||
|
||||
when@prod: |
||||
framework: |
||||
asset_mapper: |
||||
missing_import_mode: warn |
||||
@ -0,0 +1,28 @@
@@ -0,0 +1,28 @@
|
||||
<?php |
||||
|
||||
/** |
||||
* Returns the importmap for this application. |
||||
* |
||||
* - "path" is a path inside the asset mapper system. Use the |
||||
* "debug:asset-map" command to see the full list of paths. |
||||
* |
||||
* - "entrypoint" (JavaScript only) set to true for any module that will |
||||
* be used as an "entrypoint" (and passed to the importmap() Twig function). |
||||
* |
||||
* The "importmap:require" command can be used to add new entries to this file. |
||||
*/ |
||||
return [ |
||||
'app' => [ |
||||
'path' => './assets/app.js', |
||||
'entrypoint' => true, |
||||
], |
||||
'@hotwired/stimulus' => [ |
||||
'version' => '3.2.2', |
||||
], |
||||
'@symfony/stimulus-bundle' => [ |
||||
'path' => './vendor/symfony/stimulus-bundle/assets/dist/loader.js', |
||||
], |
||||
'@symfony/ux-live-component' => [ |
||||
'path' => './vendor/symfony/ux-live-component/assets/dist/live_controller.js', |
||||
], |
||||
]; |
||||
@ -0,0 +1,36 @@
@@ -0,0 +1,36 @@
|
||||
<!DOCTYPE html> |
||||
<html lang="en"> |
||||
<head> |
||||
<meta charset="UTF-8"> |
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
||||
<title>{% block title %}Newsroom{% endblock %}</title> |
||||
|
||||
{# Link to CSS using the asset manager #} |
||||
<link rel="stylesheet" href="{{ asset('build/styles.css') }}"> |
||||
|
||||
{% block stylesheets %} |
||||
{# Additional styles can be added by child templates here #} |
||||
{% endblock %} |
||||
</head> |
||||
<body> |
||||
<header> |
||||
</header> |
||||
|
||||
<main> |
||||
{% block body %} |
||||
{# Main content goes here #} |
||||
{% endblock %} |
||||
</main> |
||||
|
||||
<footer> |
||||
<p>© {{ "now"|date("Y") }} Newsroom</p> |
||||
</footer> |
||||
|
||||
{# Link to JavaScript using the asset manager #} |
||||
<script src="{{ asset('build/scripts.js') }}"></script> |
||||
|
||||
{% block javascripts %} |
||||
{# Additional scripts can be added by child templates here #} |
||||
{% endblock %} |
||||
</body> |
||||
</html> |
||||
Loading…
Reference in new issue