How to replace the DBT logo with some other image in the website header, generated by dbt docs generate command.
2 Answers
The documentation consists of an index.html
file, which loads data from the artifact files (source).
If you edit the index.html
file you will be able to customise it as you wish. Note that each time you run dbt docs generate
the file will be re-copied into your target folder, so you’ll need some mechanism for either copying the artifacts to wherever your new index.html` is located or overwriting the file with your customised version.
If you change the file in the source folder, I believe the index.html
file is copied from the dbt installation folder
to the target
folder everytime you run dbt docs generate
. You can customize the index.html
file from that directory and then you don't have to worry about making any changes when you run dbt docs generate
.
This is what I'd do:
Find
index.html
file in thedbt installation directory
add the line<link rel='stylesheet' href='/styles.css' />
in the
<head>
tag. This way, you only have to make this change again when you updatedbt
Add a
styles.css
file in yourtarget
folder and then target the class of the dbt logo. If you change the background color of the logo, you should be fine and you will not have to re-copy every time you rundbt docs generate
..logo { background-image: url(<<path or url to your image>>); background-color: transparent; }
You can adjust other properties like background-repeat, background-position, background-size, background-color
according to your preferences.