徽标/品牌未显示在 Python 的 Quarto html 文档中

问题描述 投票:0回答:1

使用

python
内核并在
vscode
中运行来渲染其中包含
quarto html
logo
文档,但即使在文档成功渲染后,也无法在其中显示徽标。我指的是四开支持文档是link

我正在使用的 qmd 标头部分:

title: "Test Report" author: "HQ" format: html: fontsize: 10pt code-overflow: wrap embed-resources: true smooth-scroll: true code-tools: source: false toggle: false caption: none toc: true toc-location: right echo: False warning: False message: false jupyter: python3 theme: light: lux dark: slate brand: brand/_brand.yml include-in-header: - text: | <style> .cell-output-stdout code { word-break: break-wor !important; white-space: pre-wrap !important; } </style>
我在这个项目中有品牌文件夹,它正在运行,并且在其中保留 

_brand.yml

 文件和 
logos
 
png
 文件
enter image description here

_brand.yml 文件内容:

color: palette: blue: "#ddeaf1" background: blue logo: medium: light: brand/logo-HQ.png dark: brand/logo-HQ-dark.png
终端日志:

pandoc --output Test_branding.html to: html standalone: true embed-resources: true section-divs: true html-math-method: mathjax wrap: none default-image-extension: png toc: true metadata document-css: false link-citations: true date-format: long lang: en title: Test Report author: HQ smooth-scroll: true toc-location: right message: false jupyter: python3 theme: light: lux dark: slate brand: brand/_brand.yml fontsize: 10pt Output created: Test_branding.html
我不确定这有什么问题,因为我是第一次尝试并遵循了文档。

更新:添加渲染文档首页的屏幕截图

enter image description here

python html quarto graphical-logo
1个回答
0
投票
您需要定义

html

 徽标应出现的文档内容。一种可能性是,您设置了一个 
_quarto.yml
,定义了一个具有 
project
type: website
,并且您定义了一个 
navbar
。然后徽标将出现在页面的左上角。下面是一个基于您提供的代码构建的示例,其中 
brand
 定义包含在 
_quarto.yml
 中,此外还有一个 
sidebar
 也使用了徽标。

enter image description here

_quarto.yml

project: type: website website: title: "Simple Brand Example" navbar: title: "Demo for Brand and Logo" sidebar: search: true brand: brand/_brand.yml
_brand.yml

color: palette: blue: "#ddeaf1" background: blue logo: medium: light: brand/logo-HQ.png dark: brand/logo-HQ-dark.png
index.qmd

--- title: "Test Report" author: "HQ" format: html: fontsize: 10pt code-overflow: wrap embed-resources: true smooth-scroll: true code-tools: source: false toggle: false caption: none toc: true toc-location: right echo: False warning: False message: false jupyter: python3 theme: light: lux dark: slate include-in-header: - text: | <style> .cell-output-stdout code { word-break: break-wor !important; white-space: pre-wrap !important; } </style> --- ## Overview This is a document themed using [**brand.yml**](https://posit-dev.github.io/brand-yml/) ## Subheading {{< lipsum 1 >}} ::: {.content-visible when-format="dashboard"} :::
    
© www.soinside.com 2019 - 2024. All rights reserved.