Skip to content

Commit a7c433d

Browse files
authored
Merge pull request pytorch#687 from shiftlab/demo-model-button
Demo Model Output Button
2 parents 729ebe2 + c695f9c commit a7c433d

File tree

2 files changed

+25
-5
lines changed

2 files changed

+25
-5
lines changed

_layouts/hub_detail.html

+13-4
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,23 @@ <h1>
2020
</h1>
2121

2222
<div class="row">
23-
<div class="col-md-6">
23+
<div class="col-md-4">
2424
<p class="detail-lead">By {{ page.author }} </p>
2525
</div>
2626

27-
<div class="col-md-6">
27+
<div class="col-md-8">
2828
<p class="detail-lead lead-summary">{{ page.summary }}</p>
29-
<a href="{{ page.github-link }}"><button class="btn btn-lg with-right-white-arrow detail-github-link">View on Github</button></a>
30-
<a href="https://colab.research.google.com/github/pytorch/pytorch.github.io/blob/master/{{ page.path | replace: "_hub", "assets/hub" | replace: ".md", ".ipynb" }}"><button class="btn btn-lg with-right-white-arrow detail-colab-link">Open on Google Colab</button></a>
29+
<div class="detail-button-container">
30+
<a href="{{ page.github-link }}"><button class="btn btn-lg with-right-white-arrow detail-github-link">View on Github</button></a>
31+
<a href="https://colab.research.google.com/github/pytorch/pytorch.github.io/blob/master/{{ page.path | replace: "_hub", "assets/hub" | replace: ".md", ".ipynb" }}"><button class="btn btn-lg with-right-white-arrow detail-colab-link">Open on Google Colab</button></a>
32+
{% if page.demo-model-link %}
33+
{% if page.demo-model-button-text == blank or page.demo-model-button-text == nil %}
34+
<a href="{{ page.demo-model-link }}"><button class="btn btn-lg with-right-white-arrow detail-web-demo-link">Demo Model Output</button></a>
35+
{% else %}
36+
<a href="{{ page.demo-model-link }}"><button class="btn btn-lg with-right-white-arrow detail-web-demo-link">{{ page.demo-model-button-text }}</button></a>
37+
{% endif %}
38+
{% endif %}
39+
</div>
3140
</div>
3241
</div>
3342
</div>

_sass/hub.scss

+12-1
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,19 @@
6262
color: $black;
6363
}
6464

65+
.hub .detail-web-demo-link {
66+
background: #4a9fb5;
67+
color: $white;
68+
}
69+
6570
.hub {
66-
.detail-colab-link, .detail-github-link {
71+
.detail-colab-link, .detail-github-link, .detail-web-demo-link {
72+
margin-top: 1rem;
73+
}
74+
}
75+
76+
.hub {
77+
.detail-button-container {
6778
margin-top: rem(45px);
6879
@include small-desktop {
6980
margin-top: rem(20px);

0 commit comments

Comments
 (0)