feat(route): add 立创开源广场 (#20258)

* feat(route): add 立创开源广场

* fix description
This commit is contained in:
Ethan Shen 2025-10-15 01:58:14 +08:00 committed by GitHub
parent bb41549c6f
commit 4b665de487
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1301 additions and 163 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,58 +1,156 @@
<div>
<div>
<img src={{coverImg}} /><br><br>
<span>{{publishTime}}</span><br>
<span>作者:{{author}}</span><br>
<span>{{introduction}}</span><br>
</div>
{{ if images }}
{{ each images image }}
{{ if image?.src }}
<figure>
<img
{{ if image.alt }}
alt="{{ image.alt }}"
{{ /if }}
src="{{ image.src }}">
</figure>
{{ /if }}
{{ /each }}
{{ /if }}
<div>
<h1> 描述 </h1>
{{@ content}}
</div>
{{ if title || origin || tags || license || pubDate || upDated || intro }}
<table>
<tbody>
{{ if title }}
<tr>
<th>名称</th>
<td>{{ title }}</td>
</tr>
{{ /if }}
{{ if origin }}
<tr>
<th>版本</th>
<td>{{ origin }}</td>
</tr>
{{ /if }}
{{ if tags }}
<tr>
<th>标签</th>
<td>
{{ each tags tag }}
{{ if $index !== 0 }}/ {{ /if }}{{ tag }}
{{ /each }}
</td>
</tr>
{{ /if }}
{{ if license }}
<tr>
<th>开源协议</th>
<td>{{ license }}</td>
</tr>
{{ /if }}
{{ if pubDate }}
<tr>
<th>创建时间</th>
<td>{{ pubDate }}</td>
</tr>
{{ /if }}
{{ if upDated }}
<tr>
<th>更新时间</th>
<td>{{ upDated }}</td>
</tr>
{{ /if }}
{{ if intro }}
<tr>
<th>简介</th>
<td>{{ intro }}</td>
</tr>
{{ /if }}
</tbody>
</table>
{{ /if }}
{{ if images }}
<div>
<h1> PCB && schematic </h1>
{{each images $imgs $key}}
{{each $imgs $img}}
<img src={{$img}} /><br>
{{/each}}
{{/each}}
</div>
{{/if}}
{{ if description }}
<h2>描述</h2>
{{@ description }}
{{ /if }}
{{ if boms }}
<div>
<h1> BOM </h1>
<table class="table">
<tr>
<th>No</th>
<th>Quantity</th>
<th>Device</th>
<th>Designator</th>
<th>Footprint</th>
<th>Value</th>
<th>Manufacturer Part</th>
<th>Manufacturer</th>
<th>Supplier Part</th>
<th>Supplier</th>
</tr>
{{each boms}}
<tr>
<th>{{$value.No}}</th>
<th>{{$value.Quantity}}</th>
<th>{{$value.Device}}</th>
<th>{{$value.Designator}}</th>
<th>{{$value.Footprint}}</th>
<th>{{$value.Value}}</th>
<th>{{$value['Manufacturer Part']}}</th>
<th>{{$value.Manufacturer}}</th>
<th>{{$value['Supplier Part']}}</th>
<th>{{$value.Supplier}}</th>
</tr>
{{/each}}
</table>
</div>
{{/if}}
</div>
{{ if documents }}
<h2>设计图</h2>
<div>
<ul>
{{ each documents document }}
<li>
{{ if document.title }}
<h4>{{ document.title }}</h4>
{{ /if }}
{{ if document.description }}
<p>{{ document.description }}</p>
{{ /if }}
{{ if document.thumb }}
<figure>
<img
{{ if document.thumb }}
alt="{{ document.title }}"
{{ /if }}
src="{{ document.thumb }}">
</figure>
{{ /if }}
</li>
{{ /each }}
</ul>
</div>
{{ /if }}
{{ if boms }}
<h2>BOM</h2>
<table>
<thead>
<tr>
{{ set headers = boms[0] }}
{{ each headers header }}
<th>{{ header }}</th>
{{ /each }}
</tr>
</thead>
<tbody>
{{ set rows = boms.slice(1) }}
{{ each rows row }}
<tr>
{{ each row td }}
{{ if $index === row.length - 1 }}
<td>{{@ formatObject(td) }}</td>
{{ else }}
<td>{{ td | escapeHTML }}</td>
{{ /if }}
{{ /each }}
</tr>
{{ /each }}
</tbody>
</table>
{{ /if }}
{{ if attachments }}
<h2>附件</h2>
<table>
<thead>
<th>序号</th>
<th>文件名称</th>
<th>文件大小</th>
</thead>
<tbody>
{{ each attachments attachment }}
<tr>
<td>
{{ $index + 1 }}
</td>
<td>
{{ if attachment.src }}
<a href="https://image.lceda.cn{{ attachment.src }}">{{ attachment.name || '下载链接' }}</a>
{{ else }}
{{ attachment.name || '无文件链接' }}
{{ /if }}
</td>
<td>
{{ attachment.size }}
</td>
</tr>
{{ /each }}
</tbody>
</table>
{{ /if }}