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

Created a new layout for GitHub projects #2702

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
27 changes: 27 additions & 0 deletions _includes/icon.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{% assign addIcon = include.icon %}
KingHowler marked this conversation as resolved.
Show resolved Hide resolved
<img
{% if addIcon contains 'http' %}
src="{{ addIcon }}"
{% else %}
src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/{{ addIcon }}"
KingHowler marked this conversation as resolved.
Show resolved Hide resolved
{% endif %}
{% if include.alt %}
alt="{{ include.alt }}"
{% endif %}
{% if include.title %}
title="{{ include.title }}"
{% endif %}
{% if include.width %}
width="{{ include.width }}"
{% else %}
width="auto"
{% endif %}
{% if include.height %}
height="{{ include.height }}"
{% else %}
height="40"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it is best to use rem whenever possible. This calculator can help.

{% endif %}
>
{% if include.spaceAfter %}
<img width="{{ include.width }}">
KingHowler marked this conversation as resolved.
Show resolved Hide resolved
{% endif %}
49 changes: 49 additions & 0 deletions _layouts/github-project.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
layout: default
---
{% if page._styles %}
<!-- Page/Post style -->
<style type="text/css">
{{ page._styles }}
</style>
{% endif %}

<div class="post">
<header class="post-header">
<div>
<h1 class="post-title d-flex flex-wrap flex-md-row flex-column justify-content-between align-items-center">
{{ page.title }}
{% if page.icons %}
<div>
{% for iconLink in page.icons %}
{% include icon.liquid icon=iconLink %}
{% endfor %}
</div>
{% endif %}
</h1>
</div>
<p class="post-description">{{ page.description }}</p>
{% if page.repositories %}
<div class="repositories d-flex flex-wrap flex-md-row flex-column justify-content-between align-items-center">
KingHowler marked this conversation as resolved.
Show resolved Hide resolved
{% for repo in page.repositories %}
{% include repository/repo.liquid repository=repo %}
{% endfor %}
</div>
{% endif %}
</header>

<article>
{{ content }}
</article>

{% if page.related_publications %}
<h2>References</h2>
<div class="publications">
{% bibliography --cited_in_order %}
</div>
{% endif %}

{% if site.giscus and page.giscus_comments %}
{% include giscus.liquid %}
{% endif %}
</div>