How do I get the logo path? I am creating custom theme for Drupal 8. I am uploading the logo from theme setting, but I am not able to print the path of that logo. What I am doing to print the full path of logo is using {{ logo }}, but it is not working.

In Drupal 7 we can get the full path of logo with the following code.

 &lt;img src="&lt;?php print $logo; ?&gt;" alt="&lt;?php print t('Home'); ?&gt;" /&gt;


What is the equivalent for Drupal 8?
The class implementing the block showing the theme logo, in SystemBrandingBlock::build() contains the following code.

  $build['site_logo'] = array(
    '#theme' =&gt; 'image',
    '#uri' =&gt; theme_get_setting('logo.url'),
    '#alt' =&gt; $this-&gt;t('Home'),
    '#access' =&gt; $this-&gt;configuration['use_site_logo'],
  );


So, for the path of the logo, you can simply use theme_get_setting('logo.url'), which returns "/core/themes/bartik/logo.svg", in my test site.

If you want a relative URL for the logo file, for example because you want to use it for the src attribute of the &lt;img&gt; tag, you can do as template_preprocess_image() does.

$relative_url = file_url_transform_relative(file_create_url(theme_get_setting('logo.url')));


For an absolute URL, you can use the following code.

$absolute_url = file_create_url(theme_get_setting('logo.url'));


That code needs to go in a preprocess function, where it initializes a variable. For example, if I wanted the relative URL of the logo file in html.html.twig, I would use the following code.

function mytheme_preprocess_html(&amp;$variables) {
  $variables['relative_logo_url'] = file_url_transform_relative(file_create_url(theme_get_setting('logo.url')));
}


And in the template, you would just use {{ relative_logo_url }} to get it.