Finished code to get GitHub OAuth token and fetch project releases at build time.
This commit is contained in:
parent
5bceb5af72
commit
c2c676ce19
9 changed files with 374 additions and 21 deletions
|
|
@ -15,7 +15,7 @@
|
|||
</a>
|
||||
<div>
|
||||
<p class="featuredProjectName">{{ projectData.data.name }}</p>
|
||||
<p class="featuredProjectSubtitle">by <a href="{{ '/authors/' + projectData.data.author + '/' | url}}">{{ projectData.data.author }}</a></p>
|
||||
<p class="featuredProjectSubtitle">by <a href="{{ ('/authors/' + projectData.data.author + '/') | url}}">{{ projectData.data.author }}</a></p>
|
||||
<div class="featuredProjectSubtitle dimText">{{ projectData.data.subtitle }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -16,11 +16,30 @@ styles: ["project"]
|
|||
</div>
|
||||
<a id="downloadLink" href="{{ downloadLink | url}}"><button id="downloadButton">{% if downloadLink %}Download{% else %}Unavailable{% endif %}</button></a>
|
||||
</div>
|
||||
{% if links or docs or images or releases %}
|
||||
{% if links or docs or images or releaseType %}
|
||||
<div id="projectImagesAndInfo">
|
||||
{% include "project_image.njk" %}
|
||||
<div id="projectInfo">
|
||||
<h2>Here's what we found:</h2>
|
||||
<p>Here's what we found about this project:</p>
|
||||
{% if releaseType %}
|
||||
<p id="projectInfoReleases">
|
||||
{% if releaseType == "github" %}
|
||||
{% set releases = githubRepoOwner | githubReleases(githubRepoName) %}
|
||||
Releases fetched from GitHub:<br>
|
||||
<div class="projectInfoGitHubReleases less">
|
||||
{% for release in releases %}
|
||||
<a href="{{ release.html_url }}">{{ release.name }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if releaseType == "local" %}
|
||||
<p class="rainbowText">{{ releases | length }} releases.</p>
|
||||
{% for label, addr in releases %}
|
||||
<a href="{{ addr | url }}">{{ label }}</a>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</p>
|
||||
{% endif %}
|
||||
{% if links %}
|
||||
<p>{{ links | length }} links.</p>
|
||||
<ul>
|
||||
|
|
|
|||
|
|
@ -100,6 +100,14 @@
|
|||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.projectInfoGitHubReleases.less {
|
||||
overflow: hidden;
|
||||
display: -webkit-box;
|
||||
line-clamp: 2;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 1280px) {
|
||||
#projectImagesAndInfo {
|
||||
flex-direction: column;
|
||||
|
|
|
|||
|
|
@ -50,8 +50,8 @@ main {
|
|||
}
|
||||
|
||||
/* main:last-child {
|
||||
margin-bottom: 0px;
|
||||
padding-bottom: 0px;
|
||||
margin-bottom: 0px;
|
||||
padding-bottom: 0px;
|
||||
} */
|
||||
|
||||
button {
|
||||
|
|
@ -174,11 +174,12 @@ hr {
|
|||
}
|
||||
|
||||
.featuredProjectSubtitle {
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
display: -webkit-box;
|
||||
line-clamp: 2;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical
|
||||
}
|
||||
|
||||
.featuredProjectSubtitle {
|
||||
|
|
@ -238,7 +239,7 @@ h1, h2, h3 {
|
|||
0%,100% {
|
||||
background-position: 0 0;
|
||||
}
|
||||
|
||||
|
||||
50% {
|
||||
background-position: 100% 0;
|
||||
}
|
||||
|
|
@ -248,25 +249,25 @@ h1, h2, h3 {
|
|||
#everythingHelper {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
|
||||
aside {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
#projectTitle {
|
||||
font-size: larger;
|
||||
}
|
||||
|
||||
|
||||
#headerLinksAndTitle {
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
|
||||
#headerLinks {
|
||||
margin-left: 2em;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 300px) {
|
||||
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue