Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(site): add github reference #2014

Merged
merged 7 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pages/11ty/url.filter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const ghurl = (url) => 'https://github.com/exadel-inc/esl/' + url;
fshovchko marked this conversation as resolved.
Show resolved Hide resolved

module.exports = (config) => {
config.addFilter('ghurl', ghurl);
};
15 changes: 15 additions & 0 deletions pages/src/navigation/related/related-links.less
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,20 @@
&:last-of-type {
margin-right: 0;
}

&-icon {
display: inline-flex;
align-items: center;
gap: 0.4em;

svg {
width: 15px;
height: 15px;
}

path {
fill: black;
}
}
}
}
16 changes: 12 additions & 4 deletions pages/views/_includes/navigation/related-links.njk
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,20 @@
<div class="related-card">
<h2 class="related-card-heading">{{ title }}</h2>
<ul class="related-card-list">
{% set links = functions.findItemsByName(pages, collections[collection]) %}
{% for page in links | released %}
{% if collection === 'source'%}
fshovchko marked this conversation as resolved.
Show resolved Hide resolved
<li class="related-card-item">
<a class="badge badge-link badge-md" href="{{ page.url | url }}">{{ page.data.name }}</a>
<a class="badge badge-link badge-md related-card-item-icon" href="{{ pages | ghurl }}">
{% include 'static/assets/common/github.svg' %} GITHUB
</a>
</li>
{% endfor %}
{% else %}
{% set links = functions.findItemsByName(pages, collections[collection]) %}
{% for page in links | released %}
<li class="related-card-item">
<a class="badge badge-link badge-md" href="{{ page.url | url }}">{{ page.data.name }}</a>
</li>
{% endfor %}
{% endif %}
</ul>
</div>
{% endif %}
Expand Down
1 change: 1 addition & 0 deletions pages/views/_layouts/content.njk
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
{% from 'navigation/related-links.njk' import related with context %}
{{ related(aside.components, 'components', 'Related Components') }}
{{ related(aside.examples, 'examples', 'Related Examples') }}
{{ related(aside.source, 'source', 'Source') }}
</aside>
{% endif %}

Expand Down