mirror of
https://github.com/cypress-io/cypress.git
synced 2026-04-28 02:39:31 -05:00
docs: DRY up url helper, enable optional href
-when not passed a href, just use text
This commit is contained in:
@@ -104,6 +104,7 @@ hexo.extend.tag.register('url', function (args) {
|
||||
// {% url `.should()` should#Notes %}
|
||||
// {% url 'Read about why' why-cypress %}
|
||||
// {% url 'Benefits' guides/getting-started/why-cypress#Benefits %}
|
||||
// {% url http://foo.com %}
|
||||
//
|
||||
// <<< Transforms into >>>
|
||||
//
|
||||
@@ -111,12 +112,13 @@ hexo.extend.tag.register('url', function (args) {
|
||||
// <a href="/api/commands/should.html#Notes"><code>.should()</code></a>
|
||||
// <a href="/guides/getting-started/why-cypress.html">Read about why</a>
|
||||
// <a href="/guides/getting-started/why-cypress.html#Benefits">Benefits</a>
|
||||
// <a href="http://foo.com">http://foo.com</a>
|
||||
|
||||
const sidebar = this.site.data.sidebar
|
||||
|
||||
const props = {
|
||||
text: args[0],
|
||||
url: args[1],
|
||||
url: args[1] || args[0],
|
||||
external: args[2],
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ comments: false
|
||||
containerClass: examples
|
||||
---
|
||||
|
||||
{% fa fa-github %} {% url "https://github.com/cypress-io/cypress-example-kitchensink" https://github.com/cypress-io/cypress-example-kitchensink %}
|
||||
{% fa fa-github %} {% url https://github.com/cypress-io/cypress-example-kitchensink %}
|
||||
|
||||
## Overview
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ comments: false
|
||||
containerClass: examples
|
||||
---
|
||||
|
||||
{% fa fa-github %} {% url "https://github.com/cypress-io/cypress-example-phonecat" https://github.com/cypress-io/cypress-example-phonecat %}
|
||||
{% fa fa-github %} {% url https://github.com/cypress-io/cypress-example-phonecat %}
|
||||
|
||||
## Overview
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ comments: false
|
||||
containerClass: examples
|
||||
---
|
||||
|
||||
{% fa fa-github %} {% url "https://github.com/cypress-io/cypress-example-piechopper" https://github.com/cypress-io/cypress-example-piechopper %}
|
||||
{% fa fa-github %} {% url https://github.com/cypress-io/cypress-example-piechopper %}
|
||||
|
||||
## Overview
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ comments: false
|
||||
containerClass: examples
|
||||
---
|
||||
|
||||
{% fa fa-github %} {% url "https://github.com/cypress-io/cypress-example-todomvc" https://github.com/cypress-io/cypress-example-todomvc %}
|
||||
{% fa fa-github %} {% url https://github.com/cypress-io/cypress-example-todomvc %}
|
||||
|
||||
## Overview
|
||||
|
||||
|
||||
Reference in New Issue
Block a user