chiark / gitweb /
Support navbar project / brand logo in all three themes.
authorVladimír Vondruš <mosra@centrum.cz>
Thu, 12 Sep 2019 20:54:33 +0000 (22:54 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Thu, 12 Sep 2019 20:56:25 +0000 (22:56 +0200)
26 files changed:
doc/documentation/doxygen.rst
doc/documentation/python.rst
documentation/doxygen.py
documentation/python.py
documentation/templates/doxygen/base.html
documentation/templates/python/base.html
documentation/test_doxygen/layout_navbar_project_logo/Doxyfile [new file with mode: 0644]
documentation/test_doxygen/layout_navbar_project_logo/index.html [new file with mode: 0644]
documentation/test_doxygen/layout_navbar_project_logo/indexpage.xml [new file with mode: 0644]
documentation/test_doxygen/layout_navbar_project_logo/mosra.jpg [new symlink]
documentation/test_doxygen/layout_navbar_project_logo_main_project_url/Doxyfile [new file with mode: 0644]
documentation/test_doxygen/layout_navbar_project_logo_main_project_url/index.html [new file with mode: 0644]
documentation/test_doxygen/layout_navbar_project_logo_main_project_url/indexpage.xml [new file with mode: 0644]
documentation/test_doxygen/layout_navbar_project_logo_main_project_url/mosra.jpg [new symlink]
documentation/test_doxygen/test_doxyfile.py
documentation/test_doxygen/test_layout.py
documentation/test_python/layout_project_logo/index.html [new file with mode: 0644]
documentation/test_python/layout_project_logo/mosra.jpg [new symlink]
documentation/test_python/layout_project_logo_main_project_url/index.html [new file with mode: 0644]
documentation/test_python/layout_project_logo_main_project_url/mosra.jpg [new symlink]
documentation/test_python/test_layout.py
pelican-theme/templates/base.html
pelican-theme/test/layout_brand_logo/index.html [new file with mode: 0644]
pelican-theme/test/layout_brand_logo/index.rst [new file with mode: 0644]
pelican-theme/test/layout_brand_logo/mosra.jpg [new symlink]
pelican-theme/test/test_layout.py

index 95e2c0c03ddea0475dde61107bf5e39b5bcb6d79..9388c3e805e550043464b5ec6767aec49dbd60ef 100644 (file)
@@ -264,6 +264,8 @@ Variable                        Description
                                 page title
 :ini:`PROJECT_BRIEF`            If set, appended in a thinner font to
                                 :ini:`PROJECT_NAME`
+:ini:`PROJECT_LOGO`             URL of an image file to use as a log in the top
+                                navbar. Default is none.
 :ini:`OUTPUT_DIRECTORY`         Used to discover where Doxygen generates the
                                 files
 :ini:`XML_OUTPUT`               Used to discover where Doxygen puts the
index ad4abcc5ff578750ea184e652998d7fa63d2080a..f539bbdd1ccb7eefed14acc28848f1991424e0c8 100644 (file)
@@ -138,6 +138,8 @@ Variable                            Description
                                     :py:`"My Python Project"` is used.
 :py:`PROJECT_SUBTITLE: str`         Project subtitle. If set, appended in a
                                     thinner font to :py:`PROJECT_TITLE`.
+:py:`PROJECT_LOGO: str`             URL of an image to use as a log in the top
+                                    navbar. Default is none.
 :py:`MAIN_PROJECT_URL: str`         If set and :py:`PROJECT_SUBTITLE` is also
                                     set, then :py:`PROJECT_TITLE` in the top
                                     navbar will link to this URL and
index 0e39cccf1111843080ac053a40d29a053391b69d..5257a520f4371e021c4e038cde33fecd63937cfb 100755 (executable)
@@ -3262,6 +3262,7 @@ def parse_doxyfile(state: State, doxyfile, config = None):
 
     default_config = {
         'PROJECT_NAME': ['My Project'],
+        'PROJECT_LOGO': [''],
         'OUTPUT_DIRECTORY': [''],
         'XML_OUTPUT': ['xml'],
         'HTML_OUTPUT': ['html'],
@@ -3387,6 +3388,7 @@ copy a link to the result using <span class="m-label m-dim">⌘</span>
     # String values that we want
     for i in ['PROJECT_NAME',
               'PROJECT_BRIEF',
+              'PROJECT_LOGO',
               'OUTPUT_DIRECTORY',
               'HTML_OUTPUT',
               'XML_OUTPUT',
@@ -3592,7 +3594,7 @@ def run(doxyfile, *, templates=default_templates, wildcard=default_wildcard, ind
                 f.write(b'\n')
 
     # Copy all referenced files
-    for i in state.images + state.doxyfile['HTML_EXTRA_STYLESHEET'] + state.doxyfile['HTML_EXTRA_FILES'] + ([state.doxyfile['M_FAVICON'][0]] if state.doxyfile['M_FAVICON'] else []) + ([] if state.doxyfile['M_SEARCH_DISABLED'] else ['search.js']):
+    for i in state.images + state.doxyfile['HTML_EXTRA_STYLESHEET'] + state.doxyfile['HTML_EXTRA_FILES'] + ([state.doxyfile['PROJECT_LOGO']] if state.doxyfile['PROJECT_LOGO'] else []) + ([state.doxyfile['M_FAVICON'][0]] if state.doxyfile['M_FAVICON'] else []) + ([] if state.doxyfile['M_SEARCH_DISABLED'] else ['search.js']):
         # Skip absolute URLs
         if urllib.parse.urlparse(i).netloc: continue
 
index 66d65b56201624422868fe4ff2552ccc9491fecf..a5fec0ad97eecf157efffbec5f9c67b72ebbec64 100755 (executable)
@@ -132,6 +132,7 @@ def default_id_formatter(type: EntryType, path: List[str]) -> str:
 default_config = {
     'PROJECT_TITLE': 'My Python Project',
     'PROJECT_SUBTITLE': None,
+    'PROJECT_LOGO': None,
     'MAIN_PROJECT_URL': None,
     'INPUT': None,
     'OUTPUT': 'output',
@@ -2586,7 +2587,7 @@ def run(basedir, config, *, templates=default_templates, search_add_lookahead_ba
                 f.write(b'\n')
 
     # Copy referenced files
-    for i in config['STYLESHEETS'] + config['EXTRA_FILES'] + ([config['FAVICON'][0]] if config['FAVICON'] else []) + list(state.external_data) + ([] if config['SEARCH_DISABLED'] else ['search.js']):
+    for i in config['STYLESHEETS'] + config['EXTRA_FILES'] + ([config['PROJECT_LOGO']] if config['PROJECT_LOGO'] else []) + ([config['FAVICON'][0]] if config['FAVICON'] else []) + list(state.external_data) + ([] if config['SEARCH_DISABLED'] else ['search.js']):
         # Skip absolute URLs
         if urllib.parse.urlparse(i).netloc: continue
 
index 69d77f635aae5c3aa3d227487828a5b6e41c726f..5c5a371a65a5b586ff21accabea5281b878b670e 100644 (file)
     <div class="m-row">
       {% if M_MAIN_PROJECT_URL and PROJECT_BRIEF %}
       <span id="m-navbar-brand" class="m-col-t-8 m-col-m-none m-left-m">
-        <a href="{{ M_MAIN_PROJECT_URL }}">{{ PROJECT_NAME }}</a> <span class="m-breadcrumb">|</span> <a href="index.html" class="m-thin">{{ PROJECT_BRIEF }}</a>
+        <a href="{{ M_MAIN_PROJECT_URL }}">{% if PROJECT_LOGO %}<img src="{{ PROJECT_LOGO|basename_or_url|e }}" />{% endif %}{{ PROJECT_NAME }}</a> <span class="m-breadcrumb">|</span> <a href="index.html" class="m-thin">{{ PROJECT_BRIEF }}</a>
       </span>
       {% else %}
-      <a href="index.html" id="m-navbar-brand" class="m-col-t-8 m-col-m-none m-left-m">{{ PROJECT_NAME }}{% if PROJECT_BRIEF %} <span class="m-thin">{{ PROJECT_BRIEF }}</span>{% endif %}</a>
+      <a href="index.html" id="m-navbar-brand" class="m-col-t-8 m-col-m-none m-left-m">{% if PROJECT_LOGO %}<img src="{{ PROJECT_LOGO|basename_or_url|e }}" />{% endif %}{{ PROJECT_NAME }}{% if PROJECT_BRIEF %} <span class="m-thin">{{ PROJECT_BRIEF }}</span>{% endif %}</a>
       {% endif %}
       {% if M_LINKS_NAVBAR1 or M_LINKS_NAVBAR2 or not M_SEARCH_DISABLED %}
       <div class="m-col-t-4 m-hide-m m-text-right m-nopadr">
index 09857cb8ae02b378a697bb4c5a53005449d0fbdd..11985d5aa4c25a1f9c9262e9bfbc2c01ed22bec0 100644 (file)
     <div class="m-row">
       {% if MAIN_PROJECT_URL and PROJECT_TITLE %}
       <span id="m-navbar-brand" class="m-col-t-8 m-col-m-none m-left-m">
-        <a href="{{ MAIN_PROJECT_URL }}">{{ PROJECT_TITLE }}</a> <span class="m-breadcrumb">|</span> <a href="{{ 'index'|path_to_url }}" class="m-thin">{{ PROJECT_SUBTITLE }}</a>
+        <a href="{{ MAIN_PROJECT_URL }}">{% if PROJECT_LOGO %}<img src="{{ PROJECT_LOGO|format_url|e }}" />{% endif %}{{ PROJECT_TITLE }}</a> <span class="m-breadcrumb">|</span> <a href="{{ 'index'|path_to_url }}" class="m-thin">{{ PROJECT_SUBTITLE }}</a>
       </span>
       {% else %}
-      <a href="{{ 'index'|path_to_url }}" id="m-navbar-brand" class="m-col-t-8 m-col-m-none m-left-m">{{ PROJECT_TITLE }}{% if PROJECT_SUBTITLE %} <span class="m-thin">{{ PROJECT_SUBTITLE }}</span>{% endif %}</a>
+      <a href="{{ 'index'|path_to_url }}" id="m-navbar-brand" class="m-col-t-8 m-col-m-none m-left-m">{% if PROJECT_LOGO %}<img src="{{ PROJECT_LOGO|format_url|e }}" />{% endif %}{{ PROJECT_TITLE }}{% if PROJECT_SUBTITLE %} <span class="m-thin">{{ PROJECT_SUBTITLE }}</span>{% endif %}</a>
       {% endif %}
       {% if LINKS_NAVBAR1 or LINKS_NAVBAR2 or not SEARCH_DISABLED %}
       <div class="m-col-t-4 m-hide-m m-text-right m-nopadr">
diff --git a/documentation/test_doxygen/layout_navbar_project_logo/Doxyfile b/documentation/test_doxygen/layout_navbar_project_logo/Doxyfile
new file mode 100644 (file)
index 0000000..c90504d
--- /dev/null
@@ -0,0 +1,10 @@
+XML_OUTPUT              =
+PROJECT_NAME            = "Your Brand"
+PROJECT_LOGO            = mosra.jpg
+
+##! M_PAGE_FINE_PRINT   =
+##! M_THEME_COLOR       =
+##! M_FAVICON           =
+##! M_LINKS_NAVBAR1     =
+##! M_LINKS_NAVBAR2     =
+##! M_SEARCH_DISABLED   = YES
diff --git a/documentation/test_doxygen/layout_navbar_project_logo/index.html b/documentation/test_doxygen/layout_navbar_project_logo/index.html
new file mode 100644 (file)
index 0000000..cdcf657
--- /dev/null
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8" />
+  <title>Your Brand</title>
+  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600" />
+  <link rel="stylesheet" href="m-dark+documentation.compiled.css" />
+  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+</head>
+<body>
+<header><nav id="navigation">
+  <div class="m-container">
+    <div class="m-row">
+      <a href="index.html" id="m-navbar-brand" class="m-col-t-8 m-col-m-none m-left-m"><img src="mosra.jpg" />Your Brand</a>
+    </div>
+  </div>
+</nav></header>
+<main><article>
+  <div class="m-container m-container-inflatable">
+    <div class="m-row">
+      <div class="m-col-l-10 m-push-l-1">
+        <h1>
+          Your Brand
+        </h1>
+      </div>
+    </div>
+  </div>
+</article></main>
+</body>
+</html>
diff --git a/documentation/test_doxygen/layout_navbar_project_logo/indexpage.xml b/documentation/test_doxygen/layout_navbar_project_logo/indexpage.xml
new file mode 100644 (file)
index 0000000..afdb7bf
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version='1.0' encoding='UTF-8' standalone='no'?>
+<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.14">
+  <compounddef id="indexpage" kind="page">
+    <compoundname>index</compoundname>
+    <title>Your Brand</title>
+    <briefdescription>
+    </briefdescription>
+    <detaileddescription>
+    </detaileddescription>
+  </compounddef>
+</doxygen>
diff --git a/documentation/test_doxygen/layout_navbar_project_logo/mosra.jpg b/documentation/test_doxygen/layout_navbar_project_logo/mosra.jpg
new file mode 120000 (symlink)
index 0000000..d474bc9
--- /dev/null
@@ -0,0 +1 @@
+../../../site/content/static/mosra.jpg
\ No newline at end of file
diff --git a/documentation/test_doxygen/layout_navbar_project_logo_main_project_url/Doxyfile b/documentation/test_doxygen/layout_navbar_project_logo_main_project_url/Doxyfile
new file mode 100644 (file)
index 0000000..0bd7b95
--- /dev/null
@@ -0,0 +1,12 @@
+XML_OUTPUT              =
+PROJECT_NAME            = "Your Brand"
+PROJECT_LOGO            = mosra.jpg
+PROJECT_BRIEF           = docs
+
+##! M_PAGE_FINE_PRINT   =
+##! M_THEME_COLOR       =
+##! M_FAVICON           =
+##! M_LINKS_NAVBAR1     =
+##! M_LINKS_NAVBAR2     =
+##! M_SEARCH_DISABLED   = YES
+##! M_MAIN_PROJECT_URL  = http://your.brand
diff --git a/documentation/test_doxygen/layout_navbar_project_logo_main_project_url/index.html b/documentation/test_doxygen/layout_navbar_project_logo_main_project_url/index.html
new file mode 100644 (file)
index 0000000..cd8cdf1
--- /dev/null
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8" />
+  <title>Your Brand docs</title>
+  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600" />
+  <link rel="stylesheet" href="m-dark+documentation.compiled.css" />
+  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+</head>
+<body>
+<header><nav id="navigation">
+  <div class="m-container">
+    <div class="m-row">
+      <span id="m-navbar-brand" class="m-col-t-8 m-col-m-none m-left-m">
+        <a href="http://your.brand"><img src="mosra.jpg" />Your Brand</a> <span class="m-breadcrumb">|</span> <a href="index.html" class="m-thin">docs</a>
+      </span>
+    </div>
+  </div>
+</nav></header>
+<main><article>
+  <div class="m-container m-container-inflatable">
+    <div class="m-row">
+      <div class="m-col-l-10 m-push-l-1">
+        <h1>
+          Your Brand
+        </h1>
+      </div>
+    </div>
+  </div>
+</article></main>
+</body>
+</html>
diff --git a/documentation/test_doxygen/layout_navbar_project_logo_main_project_url/indexpage.xml b/documentation/test_doxygen/layout_navbar_project_logo_main_project_url/indexpage.xml
new file mode 100644 (file)
index 0000000..afdb7bf
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version='1.0' encoding='UTF-8' standalone='no'?>
+<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.14">
+  <compounddef id="indexpage" kind="page">
+    <compoundname>index</compoundname>
+    <title>Your Brand</title>
+    <briefdescription>
+    </briefdescription>
+    <detaileddescription>
+    </detaileddescription>
+  </compounddef>
+</doxygen>
diff --git a/documentation/test_doxygen/layout_navbar_project_logo_main_project_url/mosra.jpg b/documentation/test_doxygen/layout_navbar_project_logo_main_project_url/mosra.jpg
new file mode 120000 (symlink)
index 0000000..d474bc9
--- /dev/null
@@ -0,0 +1 @@
+../../../site/content/static/mosra.jpg
\ No newline at end of file
index 3d8b8f0e691511b13d479070cccfe3b9c47b26a7..0a9a7adbbf2f312959a872dd13cd26a221f716a3 100644 (file)
@@ -77,6 +77,7 @@ copy a link to the result using <span class="m-label m-dim">⌘</span>
             'M_THEME_COLOR': '#22272e',
             'OUTPUT_DIRECTORY': '',
             'PROJECT_BRIEF': 'is cool',
+            'PROJECT_LOGO': '',
             'PROJECT_NAME': 'My Pet Project',
             'SHOW_INCLUDE_FILES': True,
             'XML_OUTPUT': 'xml'
index e9d7fb127ebf2805671dd629622bad5b2c617ac6..db48147c281aff869656df97bd87b89d533735a8 100644 (file)
@@ -92,6 +92,22 @@ class NavbarMainProjectUrl(BaseTestCase):
         self.run_doxygen(wildcard='indexpage.xml')
         self.assertEqual(*self.actual_expected_contents('index.html'))
 
+class NavbarProjectLogo(BaseTestCase):
+    def __init__(self, *args, **kwargs):
+        super().__init__(__file__, 'navbar_project_logo', *args, **kwargs)
+
+    def test(self):
+        self.run_doxygen(wildcard='indexpage.xml')
+        self.assertEqual(*self.actual_expected_contents('index.html'))
+
+class NavbarProjectLogoMainProjectUrl(BaseTestCase):
+    def __init__(self, *args, **kwargs):
+        super().__init__(__file__, 'navbar_project_logo_main_project_url', *args, **kwargs)
+
+    def test(self):
+        self.run_doxygen(wildcard='indexpage.xml')
+        self.assertEqual(*self.actual_expected_contents('index.html'))
+
 class SearchBinary(BaseTestCase):
     def __init__(self, *args, **kwargs):
         super().__init__(__file__, 'search_binary', *args, **kwargs)
diff --git a/documentation/test_python/layout_project_logo/index.html b/documentation/test_python/layout_project_logo/index.html
new file mode 100644 (file)
index 0000000..b6902a1
--- /dev/null
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8" />
+  <title>My Python Project | My Python Project</title>
+  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600" />
+  <link rel="stylesheet" href="m-dark+documentation.compiled.css" />
+  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+</head>
+<body>
+<header><nav id="navigation">
+  <div class="m-container">
+    <div class="m-row">
+      <a href="index.html" id="m-navbar-brand" class="m-col-t-8 m-col-m-none m-left-m"><img src="mosra.jpg" />My Python Project</a>
+    </div>
+  </div>
+</nav></header>
+<main><article>
+  <div class="m-container m-container-inflatable">
+    <div class="m-row">
+      <div class="m-col-l-10 m-push-l-1">
+        <h1>
+          My Python Project
+        </h1>
+      </div>
+    </div>
+  </div>
+</article></main>
+</body>
+</html>
diff --git a/documentation/test_python/layout_project_logo/mosra.jpg b/documentation/test_python/layout_project_logo/mosra.jpg
new file mode 120000 (symlink)
index 0000000..d474bc9
--- /dev/null
@@ -0,0 +1 @@
+../../../site/content/static/mosra.jpg
\ No newline at end of file
diff --git a/documentation/test_python/layout_project_logo_main_project_url/index.html b/documentation/test_python/layout_project_logo_main_project_url/index.html
new file mode 100644 (file)
index 0000000..cbd1618
--- /dev/null
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8" />
+  <title>My Python Project | My Python Project docs</title>
+  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600" />
+  <link rel="stylesheet" href="m-dark+documentation.compiled.css" />
+  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+</head>
+<body>
+<header><nav id="navigation">
+  <div class="m-container">
+    <div class="m-row">
+      <span id="m-navbar-brand" class="m-col-t-8 m-col-m-none m-left-m">
+        <a href="http://your.brand"><img src="mosra.jpg" />My Python Project</a> <span class="m-breadcrumb">|</span> <a href="index.html" class="m-thin">docs</a>
+      </span>
+    </div>
+  </div>
+</nav></header>
+<main><article>
+  <div class="m-container m-container-inflatable">
+    <div class="m-row">
+      <div class="m-col-l-10 m-push-l-1">
+        <h1>
+          My Python Project
+        </h1>
+      </div>
+    </div>
+  </div>
+</article></main>
+</body>
+</html>
diff --git a/documentation/test_python/layout_project_logo_main_project_url/mosra.jpg b/documentation/test_python/layout_project_logo_main_project_url/mosra.jpg
new file mode 120000 (symlink)
index 0000000..d474bc9
--- /dev/null
@@ -0,0 +1 @@
+../../../site/content/static/mosra.jpg
\ No newline at end of file
index 7afaa6f0413f7fd7bfc5579a866c26b1ae98a158..06f376c371011e9b341b351d5edc367fbd5b2926 100644 (file)
@@ -84,3 +84,19 @@ class SearchOpenSearch(BaseTestCase):
         self.assertEqual(*self.actual_expected_contents('index.html'))
         self.assertTrue(os.path.exists(os.path.join(self.path, 'output', 'search-v1.js')))
         self.assertEqual(*self.actual_expected_contents('opensearch.xml'))
+
+class ProjectLogo(BaseTestCase):
+    def test(self):
+        self.run_python({
+            'PROJECT_LOGO': 'mosra.jpg',
+        })
+        self.assertEqual(*self.actual_expected_contents('index.html'))
+
+class ProjectLogoMainProjectUrl(BaseTestCase):
+    def test(self):
+        self.run_python({
+            'PROJECT_LOGO': 'mosra.jpg',
+            'PROJECT_SUBTITLE': 'docs',
+            'MAIN_PROJECT_URL': 'http://your.brand'
+        })
+        self.assertEqual(*self.actual_expected_contents('index.html'))
index 71442dfbf3c120154b2ad021b1345e8693cdcd5e..789d31a248292be2d89e27dea4a9f3058c38fdca 100644 (file)
@@ -44,7 +44,7 @@
   <div class="m-container">
     <div class="m-row">
       <a href="{{ SITEURL }}/" id="m-navbar-brand" class="m-col-t-9 m-col-m-none m-left-m{% if page and page.landing and page.cover and page.hide_navbar_brand == 'True' %} m-navbar-brand-hidden{% endif %}">
-        {%- if M_SITE_LOGO %}<img src="{{ M_SITE_LOGO|e }}" />{% endif -%}
+        {%- if M_SITE_LOGO %}<img src="{{ M_SITE_LOGO|format_siteurl|e }}" />{% endif -%}
         {{- (M_SITE_LOGO_TEXT or SITENAME)|e -}}
       </a>
       {% if M_LINKS_NAVBAR1 or M_LINKS_NAVBAR2 %}
diff --git a/pelican-theme/test/layout_brand_logo/index.html b/pelican-theme/test/layout_brand_logo/index.html
new file mode 100644 (file)
index 0000000..0f2fc92
--- /dev/null
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html lang="en" prefix="og: http://ogp.me/ns#">
+<head>
+  <meta charset="UTF-8" />
+  <title>Brand Logo | A Pelican Blog</title>
+  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i" />
+  <link rel="stylesheet" href="static/m-dark.css" />
+  <link rel="canonical" href="pages/brand-logo.html" />
+  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+  <meta property="og:site_name" content="A Pelican Blog" />
+  <meta property="og:title" content="Brand Logo" />
+  <meta name="twitter:title" content="Brand Logo" />
+  <meta property="og:url" content="pages/brand-logo.html" />
+  <meta name="twitter:card" content="summary" />
+  <meta property="og:type" content="page" />
+</head>
+<body>
+<header><nav id="navigation">
+  <div class="m-container">
+    <div class="m-row">
+      <a href="./" id="m-navbar-brand" class="m-col-t-9 m-col-m-none m-left-m"><img src="mosra.jpg" />A Pelican Blog</a>
+    </div>
+  </div>
+</nav></header>
+<main>
+<article>
+  <div class="m-container m-container-inflatable">
+    <div class="m-row">
+      <div class="m-col-l-10 m-push-l-1">
+        <h1>Brand Logo</h1>
+      </div>
+    </div>
+  </div>
+</article>
+</main>
+</body>
+</html>
diff --git a/pelican-theme/test/layout_brand_logo/index.rst b/pelican-theme/test/layout_brand_logo/index.rst
new file mode 100644 (file)
index 0000000..345b81c
--- /dev/null
@@ -0,0 +1,4 @@
+Brand Logo
+##########
+
+:save_as: index.html
diff --git a/pelican-theme/test/layout_brand_logo/mosra.jpg b/pelican-theme/test/layout_brand_logo/mosra.jpg
new file mode 120000 (symlink)
index 0000000..d474bc9
--- /dev/null
@@ -0,0 +1 @@
+../../../site/content/static/mosra.jpg
\ No newline at end of file
index 9e59a97abb94de149d20e1dcda9af57831b09e3c..2abc9da6641e65c3450ab5fdc7e20dad4cdeebbc 100644 (file)
@@ -241,3 +241,28 @@ class GlobalSocialMeta(BaseTestCase):
         # different og:url but nothing else.
         self.assertEqual(*self.actual_expected_contents('index.html'))
         self.assertEqual(*self.actual_expected_contents('archives.html'))
+
+class BrandLogo(MinimalTestCase):
+    def __init__(self, *args, **kwargs):
+        super().__init__(__file__, 'brand_logo', *args, **kwargs)
+
+    def test(self):
+        self.run_pelican({
+            # This is the minimal that's required. Not even the M_THEME_COLOR
+            # is required.
+            'THEME': '.',
+            'PLUGIN_PATHS': ['../plugins'],
+            'PLUGINS': ['m.htmlsanity'],
+            'THEME_STATIC_DIR': 'static',
+            'M_CSS_FILES': ['https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i',
+               'static/m-dark.css'],
+            'M_SITE_LOGO': 'mosra.jpg',
+            'STATIC_PATHS': ['mosra.jpg'],
+            'ARTICLE_PATHS': ['articles'], # doesn't exist
+            # Supplying empty index.html to avoid excessive hello world markup
+            # we don't need
+            'PAGE_PATHS': ['.'],
+            'M_FINE_PRINT': ''})
+
+        # The archives and index page should be exactly the same
+        self.assertEqual(*self.actual_expected_contents('index.html'))