refactor link rel

pull/8432/head
Thibault Duplessis 2021-03-19 22:06:59 +01:00
parent 597c81e97f
commit d389300445
7 changed files with 11 additions and 10 deletions

View File

@ -149,6 +149,8 @@ trait ScalatagsExtensions {
t.setAttr("target", Builder.GenericAttrValueSource("_blank"))
}
val noFollow = rel := "nofollow"
def ariaTitle(v: String): Modifier = (t: Builder) => {
val value = Builder.GenericAttrValueSource(v)
t.setAttr("title", value)

View File

@ -39,10 +39,10 @@ z-index: 99;
val connectLinks =
div(cls := "connect-links")(
a(href := "https://twitter.com/lichess", rel := "nofollow")("Twitter"),
a(href := "https://discord.gg/hy5jqSs", rel := "nofollow")("Discord"),
a(href := "https://www.youtube.com/channel/UCr6RfQga70yMM9-nuzAYTsA", rel := "nofollow")("YouTube"),
a(href := "https://www.twitch.tv/lichessdotorg", rel := "nofollow")("Twitch")
a(href := "https://twitter.com/lichess", targetBlank, noFollow)("Twitter"),
a(href := "https://discord.gg/hy5jqSs", targetBlank, noFollow)("Discord"),
a(href := "https://www.youtube.com/channel/UCr6RfQga70yMM9-nuzAYTsA", targetBlank, noFollow)("YouTube"),
a(href := "https://www.twitch.tv/lichessdotorg", targetBlank, noFollow)("Twitch")
)
def fenAnalysisLink(fen: FEN)(implicit lang: Lang) =

View File

@ -84,7 +84,7 @@ object show {
profile.youtubeUrls.nonEmpty option st.section(cls := "coach-show__youtube")(
h2(
profile.youtubeChannel.map { url =>
a(href := url, targetBlank, rel := "nofollow")(youtubeVideos())
a(href := url, targetBlank, noFollow)(youtubeVideos())
} getOrElse youtubeVideos()
),
div(cls := "list")(

View File

@ -48,7 +48,6 @@ object bits {
s"""${routes.Editor.index}?fen=${initialFen.??(_.value.replace(' ', '_'))}"""
case v => routes.Page.variant(v.key).url
}),
rel := "nofollow",
targetBlank,
title := variant.title
)(name)

View File

@ -29,7 +29,7 @@ object index {
main(cls := "box page-small search")(
h1(advancedSearch()),
st.form(
rel := "nofollow",
noFollow,
cls := "box__pad search__form",
action := s"${routes.Search.index()}#results",
method := "GET"
@ -75,7 +75,7 @@ object index {
div(cls := "search__result", id := "results")(
paginator.map { pager =>
val permalink =
a(cls := "permalink", href := routes.Search.index(), rel := "nofollow")("Permalink")
a(cls := "permalink", href := routes.Search.index(), noFollow)("Permalink")
if (pager.nbResults > 0)
frag(
div(cls := "search__status box__pad")(

View File

@ -17,7 +17,7 @@ object user {
val commons = bits of form
import commons._
st.form(
rel := "nofollow",
noFollow,
cls := "search__form",
action := routes.User.games(u.username, "search"),
method := "GET"

View File

@ -256,7 +256,7 @@ It's useful against spambots. These marks are not visible to the public."""
},
!hideTroll option div(cls := "social_links col2")(
profile.actualLinks.map { link =>
a(href := link.url, targetBlank, rel := "nofollow")(link.site.name)
a(href := link.url, targetBlank, noFollow)(link.site.name)
}
),
div(cls := "teams col2")(