Skip to content

Commit

Permalink
Merge pull request lukeorth#153 from lucasgrocha/feat/remote_brand_image
Browse files Browse the repository at this point in the history
Feat: Add ability to use remote brand image
  • Loading branch information
lukeorth authored Nov 8, 2023
2 parents f6d134c + dce4ee2 commit 86b8cf1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ When visiting the base url for the site, i.e. `your.domain.com/`, a paginated fe
### Example config
I recommend starting by copying/pasting the following code into your config.toml file. Once you see how it looks, play with the settings as needed.

**NOTE**: To display an image in your sidebar, you'll need to uncomment the `brand_image` path below and have it point to an image file in your project. The path is relative to the `static` directory. If you don't have an image, just leave this line commented out.
**NOTE**: To display an image in your sidebar, you'll need to uncomment the `remote_brand_image` and set a image URL or the `brand_image` path below and have it point to an image file in your project. The path is relative to the `static` directory. If you don't have an image, just leave both lines commented out.

```toml
baseURL = "/"
Expand All @@ -320,6 +320,7 @@ pluralizelisttitles = false # removes the automatically appended "s" on sideba

[params]
brand = "Poison" # name of your site - appears in the sidebar
# remote_brand_image = 'https://github.com/USERNAME.png' # path to a remote file
# brand_image = "/images/test.jpg" # path to the image shown in the sidebar
description = "Update this description..." # Used as default meta description if not specified in front matter
dark_mode = true # optional - defaults to false
Expand Down
6 changes: 5 additions & 1 deletion layouts/partials/sidebar/title.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<div class="sidebar-about">
<h1 class="brand">
{{ if .Site.Params.brand_image }}
{{ if .Site.Params.remote_brand_image }}
<a href="{{ .Site.BaseURL }}">
<img src="{{ .Site.Params.remote_brand_image }}" alt="brand image">
</a>
{{ else if .Site.Params.brand_image }}
<a href="{{ .Site.BaseURL }}">
<img src="{{ .Site.Params.brand_image }}" alt="brand image">
</a>
Expand Down

0 comments on commit 86b8cf1

Please sign in to comment.