mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-24 17:06:29 +03:00
Make links detect target automatically and replace false with null for no attribute
New version of Harp would render attribute=false as attribute="false", while attribute=null renders element without attribute.
This commit is contained in:
parent
b893126c12
commit
f6f6e028ea
|
@ -11,7 +11,7 @@ footer.o-footer.u-text.u-border-dotted
|
|||
|
||||
each url, item in group
|
||||
li
|
||||
+a(url)(target=url.includes("http") ? "_blank" : false)=item
|
||||
+a(url)=item
|
||||
|
||||
if SECTION != "docs"
|
||||
+grid-col("quarter")
|
||||
|
|
|
@ -20,7 +20,8 @@ mixin h(level, id)
|
|||
info: https://mathiasbynens.github.io/rel-noopener/
|
||||
|
||||
mixin a(url, trusted)
|
||||
a(href=url target="_blank" rel=!trusted ? "noopener nofollow" : false)&attributes(attributes)
|
||||
- external = url.includes("http")
|
||||
a(href=url target=external ? "_blank" : null rel=external && !trusted ? "noopener nofollow" : null)&attributes(attributes)
|
||||
block
|
||||
|
||||
|
||||
|
@ -74,7 +75,8 @@ mixin aside-code(label, language)
|
|||
see assets/css/_components/_buttons.sass
|
||||
|
||||
mixin button(url, trusted, ...style)
|
||||
a.c-button.u-text-label(href=url class=prefixArgs(style, "c-button") role="button" target="_blank" rel=!trusted ? "noopener nofollow" : false)&attributes(attributes)
|
||||
- external = url.includes("http")
|
||||
a.c-button.u-text-label(href=url class=prefixArgs(style, "c-button") role="button" target=external ? "_blank" : null rel=external && !trusted ? "noopener nofollow" : null)&attributes(attributes)
|
||||
block
|
||||
|
||||
|
||||
|
@ -148,7 +150,7 @@ mixin tag()
|
|||
|
||||
mixin list(type, start)
|
||||
if type
|
||||
ol.c-list.o-block.u-text(class="c-list--#{type}" style=(start === 0 || start) ? "counter-reset: li #{(start - 1)}" : false)&attributes(attributes)
|
||||
ol.c-list.o-block.u-text(class="c-list--#{type}" style=(start === 0 || start) ? "counter-reset: li #{(start - 1)}" : null)&attributes(attributes)
|
||||
block
|
||||
|
||||
else
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
include _mixins
|
||||
|
||||
nav.c-nav.u-text.js-nav(class=landing ? "c-nav--theme" : false)
|
||||
nav.c-nav.u-text.js-nav(class=landing ? "c-nav--theme" : null)
|
||||
a(href='/') #[+logo]
|
||||
|
||||
if SUBSECTION != "index"
|
||||
|
@ -11,7 +11,7 @@ nav.c-nav.u-text.js-nav(class=landing ? "c-nav--theme" : false)
|
|||
ul.c-nav__menu
|
||||
each url, item in NAVIGATION
|
||||
li.c-nav__menu__item
|
||||
a(href=url target=url.includes("http") ? "_blank" : false)=item
|
||||
+a(url)=item
|
||||
|
||||
li.c-nav__menu__item
|
||||
+a(gh("spaCy"))(aria-label="GitHub").u-hidden-xs #[+icon("github", 20)]
|
||||
|
|
|
@ -9,5 +9,5 @@ menu.c-sidebar.js-sidebar.u-text
|
|||
li.u-text-label.u-color-subtle=menu
|
||||
|
||||
each url, item in items
|
||||
li(class=(CURRENT == url || (CURRENT == "index" && url == "./")) ? "is-active" : false)
|
||||
+a(url)(target=url.includes("http") ? "_blank" : false)=item
|
||||
li(class=(CURRENT == url || (CURRENT == "index" && url == "./")) ? "is-active" : null)
|
||||
+a(url)=item
|
||||
|
|
|
@ -22,7 +22,7 @@ include _includes/_mixins
|
|||
| process entire web dumps, spaCy is the library you want to
|
||||
| be using.
|
||||
|
||||
+button("/docs/api", true, "primary")(target="_self")
|
||||
+button("/docs/api", true, "primary")
|
||||
| Facts & figures
|
||||
|
||||
+grid-col("third").o-card
|
||||
|
@ -35,7 +35,7 @@ include _includes/_mixins
|
|||
| think of spaCy as the Ruby on Rails of Natural Language
|
||||
| Processing.
|
||||
|
||||
+button("/docs/usage", true, "primary")(target="_self")
|
||||
+button("/docs/usage", true, "primary")
|
||||
| Get started
|
||||
|
||||
+grid-col("third").o-card
|
||||
|
@ -51,7 +51,7 @@ include _includes/_mixins
|
|||
| connect the statistical models trained by these libraries
|
||||
| to the rest of your application.
|
||||
|
||||
+button("/docs/usage/deep-learning", true, "primary")(target="_self")
|
||||
+button("/docs/usage/deep-learning", true, "primary")
|
||||
| Read more
|
||||
|
||||
.o-inline-list.o-block.u-border-bottom.u-text-small.u-text-center.u-padding-small
|
||||
|
@ -105,7 +105,7 @@ include _includes/_mixins
|
|||
+item Robust, rigorously evaluated accuracy
|
||||
|
||||
.o-inline-list
|
||||
+button("/docs/usage/lightning-tour", true, "secondary")(target="_self")
|
||||
+button("/docs/usage/lightning-tour", true, "secondary")
|
||||
| See examples
|
||||
|
||||
.o-block.u-text-center.u-padding
|
||||
|
|
Loading…
Reference in New Issue
Block a user