Skip to content

Commit 5ce26f7

Browse files
committed
repo and mm
1 parent eac96c9 commit 5ce26f7

5 files changed

Lines changed: 32 additions & 454 deletions

File tree

_data/repositories.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ github_users:
22
- macartan
33

44
github_repos:
5-
- macartan/CausalQueries
6-
- integrated-inferences/guide
5+
- integrated-inferences/CausalQueries
76
- DeclareDesign/DeclareDesign
87
- gerasy1987/hiddenmeta
98
- macartan/probra

_includes/repository/repo.html

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
{% assign repo_url = include.repository | split: '/' %}
1+
{% assign repo_url = include.repository | split: '/' %}
2+
{% if repo_url.size >= 2 %}
3+
{% if site.data.repositories.github_users contains repo_url.first %}
4+
{% assign show_owner = false %}
5+
{% else %}
6+
{% assign show_owner = true %}
7+
{% endif %}
28

3-
{% if site.data.repositories.github_users contains repo_url.first %}
4-
{% assign show_owner = false %}
5-
{% else %}
6-
{% assign show_owner = true %}
9+
<div class="repo p-2 text-center">
10+
<a href="https://github.com/{{ include.repository }}">
11+
<img class="repo-img-light w-100" alt="{{ include.repository }}" loading="lazy" src="https://github-readme-stats.vercel.app/api/pin?username={{ repo_url.first }}&repo={{ repo_url.last }}&theme={{ site.repo_theme_light }}&show_owner={{ show_owner }}">
12+
<img class="repo-img-dark w-100" alt="{{ include.repository }}" loading="lazy" src="https://github-readme-stats.vercel.app/api/pin?username={{ repo_url.first }}&repo={{ repo_url.last }}&theme={{ site.repo_theme_dark }}&show_owner={{ show_owner }}">
13+
</a>
14+
</div>
715
{% endif %}
8-
9-
<div class="repo p-2 text-center">
10-
<a href="https://github.com/{{ include.repository }}">
11-
<img class="repo-img-light w-100" alt="{{ include.repository }}" src="https://github-readme-stats.vercel.app/api/pin/?username={{ repo_url.first }}&repo={{ repo_url.last }}&theme={{ site.repo_theme_light }}&show_owner={{ show_owner }}">
12-
<img class="repo-img-dark w-100" alt="{{ include.repository }}" src="https://github-readme-stats.vercel.app/api/pin/?username={{ repo_url.first }}&repo={{ repo_url.last }}&theme={{ site.repo_theme_dark }}&show_owner={{ show_owner }}">
13-
</a>
14-
</div>

_includes/scripts/mermaid.html

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,31 @@
11
{% if site.enable_mermaid %}
22
<!-- Mermaid.js for diagrams in markdown -->
3+
<style>
4+
.mermaid-wrapper { max-width: 100%; overflow-x: auto; overflow-y: visible; margin: 1rem 0; }
5+
.mermaid-wrapper .mermaid { display: flex; justify-content: center; }
6+
.mermaid-wrapper .mermaid svg { max-width: 100%; height: auto; }
7+
</style>
38
<script src="https://cdn.jsdelivr.net/npm/mermaid@{{ site.mermaid.version }}/dist/mermaid.min.js" crossorigin="anonymous"></script>
49
<script>
510
document.addEventListener('DOMContentLoaded', function () {
611
var blocks = document.querySelectorAll('pre code.language-mermaid');
712
if (blocks.length === 0) return;
8-
mermaid.initialize({ startOnLoad: false, theme: 'default' });
13+
mermaid.initialize({
14+
startOnLoad: false,
15+
theme: 'default',
16+
flowchart: { useMaxWidth: true },
17+
useMaxWidth: true
18+
});
919
blocks.forEach(function (block, i) {
1020
var pre = block.parentElement;
11-
var id = 'mermaid-' + i;
21+
var wrapper = document.createElement('div');
22+
wrapper.className = 'mermaid-wrapper';
1223
var div = document.createElement('div');
13-
div.id = id;
24+
div.id = 'mermaid-' + i;
1425
div.className = 'mermaid';
1526
div.textContent = block.textContent;
16-
pre.parentElement.insertBefore(div, pre);
27+
wrapper.appendChild(div);
28+
pre.parentElement.insertBefore(wrapper, pre);
1729
pre.style.display = 'none';
1830
});
1931
mermaid.run({ querySelector: '.mermaid', suppressErrors: true });

_pages/repositories.html

Lines changed: 0 additions & 424 deletions
This file was deleted.

_pages/repositories.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,6 @@ description: Github repos
66
nav: true
77
nav_order: 3
88
---
9-
<!---
10-
## GitHub users
11-
12-
{% if site.data.repositories.github_users %}
13-
<div class="repositories d-flex flex-wrap flex-md-row flex-column justify-content-between align-items-center">
14-
{% for user in site.data.repositories.github_users %}
15-
{% include repository/repo_user.html username=user %}
16-
{% endfor %}
17-
</div>
18-
{% endif %}
19-
-->
20-
---
219

2210
## GitHub Repositories
2311

@@ -27,4 +15,6 @@ nav_order: 3
2715
{% include repository/repo.html repository=repo %}
2816
{% endfor %}
2917
</div>
18+
{% else %}
19+
<p>Repository list is configured in <code>_data/repositories.yml</code> under <code>github_repos</code>.</p>
3020
{% endif %}

0 commit comments

Comments
 (0)