From 2a5a75126fa262a5482e501b2c83ced0a1260ea2 Mon Sep 17 00:00:00 2001 From: Felix Eckhofer Date: Fri, 17 Aug 2018 10:33:14 +0200 Subject: [PATCH] Use a generic description for non-GitHub hosts --- src/Writers/HTMLWriter.jl | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Writers/HTMLWriter.jl b/src/Writers/HTMLWriter.jl index bc9b2e842f2..ffc647a55cf 100644 --- a/src/Writers/HTMLWriter.jl +++ b/src/Writers/HTMLWriter.jl @@ -420,18 +420,22 @@ function render_article(ctx, navnode) topnav = nav(ul(header_links)) - # Set the logo and name for the "Edit on.." button. We assume GitHub as a host. - host = "GitHub" - logo = "\uf09b" - + # Set the logo and name for the "Edit on.." button. host_type = Utilities.repo_host_from_url(ctx.doc.user.repo) if host_type == Utilities.RepoGitlab host = "GitLab" logo = "\uf296" + elseif host_type == Utilities.RepoGithub + host = "GitHub" + logo = "\uf09b" elseif host_type == Utilities.RepoBitbucket host = "BitBucket" logo = "\uf171" + else + host = "" + logo = "\uf15c" end + hoststring = isempty(host) ? " source" : " on $(host)" if !ctx.doc.user.html_disable_git pageurl = get(getpage(ctx, navnode).globals.meta, :EditURL, getpage(ctx, navnode).source) @@ -446,7 +450,7 @@ function render_article(ctx, navnode) end if url !== nothing edit_verb = (ctx.doc.user.html_edit_branch === nothing) ? "View" : "Edit" - push!(topnav.nodes, a[".edit-page", :href => url](span[".fa"](logo), " $(edit_verb) on $host")) + push!(topnav.nodes, a[".edit-page", :href => url](span[".fa"](logo), " $(edit_verb)$hoststring")) end end art_header = header(topnav, hr(), render_topbar(ctx, navnode))