Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "Powered by ..." message to footer #1365

Merged
merged 11 commits into from Jul 16, 2020
Merged

Add "Powered by ..." message to footer #1365

merged 11 commits into from Jul 16, 2020

Conversation

pfitzseb
Copy link
Member

@pfitzseb pfitzseb commented Jul 14, 2020

image

This should help a bit with SEO and therefore Julia's ranking (both for Julia itself and packages). AFAIU it's not ideal to put this in the footer, but I don't know enough about how Google ranks websites to figure out something better.

Open questions:

  • Is everyone happy with this?
  • Should there be an opt-out mechanism?
  • Should this be an opt-in feature (would completely defeat the purpose though, I think)?
  • Is the styling ok?

cc @ViralBShah

Edit by @mortenpi: fixes #1184

@KristofferC
Copy link
Member

KristofferC commented Jul 14, 2020

I think it looks nice. Adding "Julia" to the page also makes it more likely to be found when googling something related to the package + "julia". Right now, there are many documentation pages without the term "julia" at all which might lead to worse discoverability.

@johnnychen94
Copy link
Member

johnnychen94 commented Jul 14, 2020

Literate.jl also adds this to the footer, so an opt-out mechanism would be a must from my perspective. See the credit keyword in the Literate docs.

With an opt-out mechanism, users could manually customize credit to two or more packages in one line.

@ViralBShah
Copy link
Contributor

I think we should have this as the default message but easy to change.

@mortenpi mortenpi added this to the 0.25.1 milestone Jul 14, 2020
Copy link
Member

@mortenpi mortenpi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for tackling this @pfitzseb!

  1. As we said in A customizable footer on generated pages #1184, with this phrasing, I think it makes sense to have it be opt-out. I see it as a way to subtly advertise Documenter & Julia to the readers, with any SEO benefits being incidental. I do think there should be an option to opt-out. A footer keyword to HTML?

  2. I think ideally we'd also allow the users to override the content. Probably formatted as an (inline) Markdown string, so that e.g. links would also work?

  3. Finally, maybe it would be also good to allow it to be overridden on a per-page basis in an at-meta block? This would allow tools like Literate to put their "Powered by" messages into the footers (cc @fredrikekre).

The latter two could definitely be done later as follow-ups.

assets/html/scss/documenter/layout/_main.scss Outdated Show resolved Hide resolved
assets/html/scss/documenter/layout/_main.scss Show resolved Hide resolved
pfitzseb and others added 3 commits July 15, 2020 09:21
Co-authored-by: Morten Piibeleht <morten.piibeleht@gmail.com>
Co-authored-by: Morten Piibeleht <morten.piibeleht@gmail.com>
@pfitzseb
Copy link
Member Author

pfitzseb commented Jul 15, 2020

Alright, added a footer argument to HTML that defaults to "Powered by [Documenter.jl](https://github.com/JuliaDocs/Documenter.jl) and the [Julia Programming Language](https://julialang.org/).". Can be set to the empty string to hide the footer completely (could also allow nothing here, I suppose).

The argument checking for footer is very rudimentary at the moment, so in theory you could set a header or whatever. I can add an early check for that if necessary.

@mortenpi
Copy link
Member

The argument checking for footer is very rudimentary at the moment, so in theory you could set a header or whatever. I can add an early check for that if necessary.

What might work is to see if it parses to a single Markdown.Paragraph?

@pfitzseb
Copy link
Member Author

Done :)

Copy link
Member

@mortenpi mortenpi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took the liberty of adding the CHANGELOG and try it out in test/examples. I think only thing left is adding docs about the footer keyword into the docstring of HTML?

src/Writers/HTMLWriter.jl Outdated Show resolved Hide resolved
src/Writers/HTMLWriter.jl Outdated Show resolved Hide resolved
test/htmlwriter.jl Show resolved Hide resolved
pfitzseb and others added 4 commits July 16, 2020 01:07
Co-authored-by: Morten Piibeleht <morten.piibeleht@gmail.com>
Co-authored-by: Morten Piibeleht <morten.piibeleht@gmail.com>
Co-authored-by: Morten Piibeleht <morten.piibeleht@gmail.com>
@pfitzseb
Copy link
Member Author

Alright, pushed an update to the docs.

@johnnychen94
Copy link
Member

johnnychen94 commented Jul 16, 2020

Customized footer affects globally. Using this with Literate.jl would either 1) inserting two credit footers for Literate-generated pages, or 2) add credit for Literate even in other pages that are not Literate-generated.

@mortenpi
Copy link
Member

LGTM, thanks again @pfitzseb!

Customized footer affects globally. Using this with Literate.jl would either 1) inserting two credit footers for Literate-generated pages, or 2) add credit for Literate even in other pages that are not Literate-generated.

Yeah, it might be nice to be able to override it also on a per-page basis: #1370.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A customizable footer on generated pages
5 participants