Skip to content

Commit

Permalink
Add option to hide sitename in sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
mortenpi committed Aug 12, 2019
1 parent d5562a8 commit 83ca491
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/Writers/HTMLWriter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ Default is `nothing`, in which case no canonical link is set.
**`assets`** can be used to include additional assets (JS, CSS, ICO etc. files). See below
for more information.
**`sidebar_sitename`** determines whether the site name is shown in the sidebar or not.
Setting it to `false` can be useful when the logo already contains the name of the package.
Defaults to `true`.
# Default and custom assets
Documenter copies all files under the source directory (e.g. `/docs/src/`) over
Expand Down Expand Up @@ -143,6 +147,7 @@ struct HTML <: Documenter.Writer
assets :: Vector{String}
analytics :: String
collapselevel :: Int
sidebar_sitename :: Bool

function HTML(;
prettyurls :: Bool = true,
Expand All @@ -152,9 +157,11 @@ struct HTML <: Documenter.Writer
assets :: Vector{String} = String[],
analytics :: String = "",
collapselevel :: Integer = 2,
sidebar_sitename :: Bool = true,
)
collapselevel >= 1 || thrown(ArgumentError("collapselevel must be >= 1"))
new(prettyurls, disable_git, edit_branch, canonical, assets, analytics, collapselevel)
new(prettyurls, disable_git, edit_branch, canonical, assets, analytics,
collapselevel, sidebar_sitename)
end
end

Expand Down Expand Up @@ -539,9 +546,11 @@ function render_sidebar(ctx, navnode)
a[".docs-logo", :href => href](img[:src => src, :alt => alt])
)
end
push!(navmenu.nodes, div[".docs-package-name"](
span[".docs-autofit"](ctx.doc.user.sitename)
))
if ctx.settings.sidebar_sitename
push!(navmenu.nodes, div[".docs-package-name"](
span[".docs-autofit"](ctx.doc.user.sitename)
))
end

# Search box
push!(navmenu.nodes,
Expand Down

0 comments on commit 83ca491

Please sign in to comment.