Skip to content

Add configurable social links to scala3doc #11273

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

Merged
merged 1 commit into from
Feb 8, 2021

Conversation

pikinier20
Copy link
Contributor

closes #11092

@TheElectronWill @Katrix Below I've pasted current appearance of social links. What do you think about it? If not, maybe you have some ideas on how to improve it

image

@Katrix
Copy link
Contributor

Katrix commented Feb 1, 2021

I think having them in the sidebar is fine. Not quite sure about having them at the bottom. If they appear on the main page I'd more expect them at the very top.

@TheElectronWill
Copy link
Contributor

I often find social links at the bottom (e.g. on scala-lang.org) so it looks good to me.

@pikinier20
Copy link
Contributor Author

OK, so maybe I will leave it as it is and wait for community opinion. We can always change this in future.

@pikinier20 pikinier20 force-pushed the scala3doc/social-links2 branch 2 times, most recently from 6191324 to ca9f3ee Compare February 8, 2021 09:23
val socialLinks: Setting[List[String]] =
MultiStringSetting("-social-links", "social-links",
"Links to social sites. '[github|twitter|gitter|discord]::link' syntax is used. " +
"'custom::link::icon_name' is also allowed, in this case icon must be present in 'images/'' directory.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Documentation is incorrect, since we need 2 icons (white and black)

object SocialLinks:
def parse(s: String): Either[String, SocialLinks] =
val splitted = s.split("::")
if splitted.size < 2 then Left(s"Social links arg $s is invalid.") else
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add more meaning full error messages? e.g. when custom is provided then we should say that there is incorrect number of arguments. We should also check in e.g. github is provided that there are no additional arguments

src := resolveRoot(link.dri, "images/scaladoc_logo.svg"),
alt := "scaladoc",
cls := "scaladoc_logo"
div(id := "footer-socials")(
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe instead of ids we can use jus a class and then based on parent class style it in css?

so instead of #footer-socials we are using .footer .socials

@pikinier20 pikinier20 force-pushed the scala3doc/social-links2 branch from ca9f3ee to 1598da1 Compare February 8, 2021 13:09
@romanowski romanowski enabled auto-merge February 8, 2021 15:03
@romanowski romanowski merged commit bea5619 into master Feb 8, 2021
@romanowski romanowski deleted the scala3doc/social-links2 branch February 8, 2021 15:21
@Kordyjan Kordyjan added this to the 3.0.0 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configurable social links
6 participants