From 8d85fefa5797109246b0c29df32d8acf28cdfca0 Mon Sep 17 00:00:00 2001 From: Ilya Kreymer Date: Thu, 27 Jan 2022 11:06:08 -0800 Subject: [PATCH] ui: logo: don't require '/static/' before logo in old ui - consistent with new ui, update docs --- docs/manual/ui-guide.rst | 5 +++-- pywb/static/default_banner.js | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/manual/ui-guide.rst b/docs/manual/ui-guide.rst index 45c1d8ae..edc68a16 100644 --- a/docs/manual/ui-guide.rst +++ b/docs/manual/ui-guide.rst @@ -25,12 +25,13 @@ To enable the logo set the ``ui.logo`` property in ``config.yaml`` to point to t The URL can be any image URL, including a URL served from the static directory. -For example, to add the default pywb logo to the banner, use the following in the config: +For example, to add the default pywb logo to the banner, use the following in the config, which will +load the logo from ``./static/pywb-logo-sm.png`` .. code:: yaml ui: - logo: /static/pywb-logo-sm.png + logo: pywb-logo-sm.png New Vue-based UI (Alpha) diff --git a/pywb/static/default_banner.js b/pywb/static/default_banner.js index b1f8e015..915c4a91 100644 --- a/pywb/static/default_banner.js +++ b/pywb/static/default_banner.js @@ -160,8 +160,9 @@ This file is part of pywb, https://github.com/webrecorder/pywb logo.setAttribute("class", "_wb_linked_logo"); var logoContents = ""; - logoContents += "" + window.banner_info.logoAlt + ""; - logoContents += "" + window.banner_info.logoAlt + ""; + var logoUrl = window.banner_info.staticPrefix + "/" + window.banner_info.logoImg; + logoContents += "" + window.banner_info.logoAlt + ""; + logoContents += "" + window.banner_info.logoAlt + ""; logo.innerHTML = logoContents; this.banner.appendChild(logo);