website

#astro#js#html#css

git clone https://git.pyrossh.dev/website

木 Personal website of pyrossh. Built with astrojs, shiki, vite.


src/_includes/repo-layout.njk
09c6a56 1
{% macro repoLayout(repo, title, desc, tags, tab, version) %}
44991dd 2
<div class="repo">
44991dd 3
  <div class="header">
09c6a56 4
    <h1><span style="view-transition-name:repo-title-{{ title }}">{{ title }}</span>{% if version %} <span class="repo-version">v{{ version }}</span>{% endif %}</h1>
44991dd 5
    <div class="tags">{% for tag in tags %}<span class="tag">#{{ tag }}</span>{% endfor %}</div>
44991dd 6
  </div>
8be9c52 7
  <h3 class="clone-cmd">
8be9c52 8
    <p>git clone <span class="tag">https://git.pyrossh.dev/{{ title }}</span></p>
8be9c52 9
    <button type="button" class="copy-btn" data-clone="git clone https://git.pyrossh.dev/{{ title }}" aria-label="Copy clone command">
8be9c52 10
      <svg class="icon-copy" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>
8be9c52 11
      <svg class="icon-check" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>
8be9c52 12
    </button>
8be9c52 13
  </h3>
44991dd 14
  <div class="headerExtension"><h2>{{ desc }}</h2></div>
44991dd 15
  <hr />
44991dd 16
  <div class="nav">
44991dd 17
    <div><a href="/repos/{{ repo }}/" hx-get="/repos/{{ repo }}/" hx-select="#repo-page" hx-target="#repo-page" hx-swap="outerHTML" hx-push-url="true" class="{% if tab == 'Readme' %}active-tab{% endif %}">Readme</a><span>|</span></div>
60e980e 18
    <div><a href="/repos/{{ repo }}/files/" hx-get="/repos/{{ repo }}/files/" hx-select="#repo-page" hx-target="#repo-page" hx-swap="outerHTML" hx-push-url="true" class="{% if tab == 'Files' %}active-tab{% endif %}">Code</a><span>|</span></div>
60e980e 19
    <div><a href="/repos/{{ repo }}/commits/" hx-get="/repos/{{ repo }}/commits/" hx-select="#repo-page" hx-target="#repo-page" hx-swap="outerHTML" hx-push-url="true" class="{% if tab == 'Commits' %}active-tab{% endif %}">Commits</a></div>
44991dd 20
  </div>
44991dd 21
</div>
44991dd 22
{% endmacro %}