From 6705e389b385f2a3c7a34ecae863cceaea0261d4 Mon Sep 17 00:00:00 2001 From: tuutti Date: Thu, 12 Jan 2023 12:13:58 +0200 Subject: [PATCH] Update README.md --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index e93bb5e..95c7c60 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,16 @@ location ~ ^/(?:.*)-assets/(.*)$ { ``` or something equivalent to your web server configuration. +Custom "assets" must be run through `file_url_generator` service. For example: + +```php + /** @var \Drupal\Core\File\FileUrlGeneratorInterface $service */ +$service = \Drupal::service('file_url_generator'); +$default_image = $service->generate("{$theme->getPath()}/src/images/og-global.png") + ->toString(TRUE) + ->getGeneratedUrl(); +``` + ### Disallow search engines/robots from indexing the site Set `helfi_proxy.settings.robots_header_enabled` configuration to `TRUE`.