first initial commit
This commit is contained in:
83
custom-profile.hbs
Normal file
83
custom-profile.hbs
Normal file
@@ -0,0 +1,83 @@
|
||||
{{!< default}}
|
||||
|
||||
{{#post}}
|
||||
<main class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12 animate-fade-in">
|
||||
|
||||
{{!-- 面包屑导航 --}}
|
||||
<nav class="mb-8 text-sm text-gray-500">
|
||||
<a href="/" class="hover:text-blue-600">首页</a>
|
||||
<span class="mx-2">/</span>
|
||||
{{!-- 使用 match,直接比对 primary_tag 的 slug --}}
|
||||
{{#match primary_tag.slug "=" "teacher-profile"}}
|
||||
<a href="/tag/teacher-profile/" class="hover:text-blue-600">教师档案</a>
|
||||
{{else}}
|
||||
<a href="/tag/student-profile/" class="hover:text-blue-600">学子档案</a>
|
||||
{{/match}}
|
||||
<span class="mx-2">/</span>
|
||||
<span class="text-gray-900 font-medium">{{title}}</span>
|
||||
</nav>
|
||||
|
||||
<div class="grid grid-cols-1 lg:grid-cols-12 gap-12">
|
||||
|
||||
<aside class="lg:col-span-4">
|
||||
<div class="sticky top-24">
|
||||
<div class="aspect-[3/4] w-full overflow-hidden rounded-2xl bg-gray-100 mb-8 shadow-md border border-gray-100">
|
||||
{{#if feature_image}}
|
||||
<img src="{{img_url feature_image size="m"}}" alt="{{title}}" class="w-full h-full object-cover" />
|
||||
{{else}}
|
||||
<div class="w-full h-full flex flex-col items-center justify-center text-gray-300 bg-gray-50">
|
||||
<span class="text-6xl mb-2">
|
||||
{{#match primary_tag.slug "=" "teacher-profile"}}👨🏫{{else}}🎓{{/match}}
|
||||
</span>
|
||||
<span class="text-sm">尚未上传照片</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<h1 class="text-4xl font-bold text-gray-900 mb-3">{{title}}</h1>
|
||||
|
||||
<div class="flex flex-wrap items-center gap-3 mb-8">
|
||||
{{#match primary_tag.slug "=" "teacher-profile"}}
|
||||
<span class="px-3 py-1 bg-blue-50 text-blue-700 rounded-full text-sm font-bold">教师</span>
|
||||
{{else}}
|
||||
<span class="px-3 py-1 bg-emerald-50 text-emerald-700 rounded-full text-sm font-bold">学生</span>
|
||||
{{/match}}
|
||||
</div>
|
||||
|
||||
<div class="bg-white rounded-2xl p-6 border border-gray-100 shadow-sm space-y-5">
|
||||
{{#if custom_excerpt}}
|
||||
<div>
|
||||
<span class="block text-gray-400 mb-1 text-xs uppercase tracking-widest font-semibold">Motto / Title</span>
|
||||
<span class="font-medium text-gray-900 leading-relaxed">{{custom_excerpt}}</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="pt-4 border-t border-gray-50 text-sm text-gray-500">
|
||||
更新:{{date format="YYYY-MM-DD"}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<main class="lg:col-span-8">
|
||||
<div class="bg-white rounded-3xl p-8 md:p-12 shadow-sm border border-gray-100 min-h-[600px]">
|
||||
<div class="flex items-center justify-between mb-8 pb-4 border-b border-gray-50">
|
||||
<h2 class="text-2xl font-bold text-gray-900">
|
||||
{{#match primary_tag.slug "=" "teacher-profile"}}教师简介{{else}}个人简介{{/match}}
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div class="gh-content prose prose-lg max-w-none">
|
||||
{{content}}
|
||||
</div>
|
||||
{{!-- Ghost 原生评论区 --}}
|
||||
{{#if comments}}
|
||||
<section class="article-comments mt-16 pt-10 border-t border-slate-100">
|
||||
<h3 class="text-2xl font-bold text-slate-900 mb-8">参与讨论</h3>
|
||||
{{comments}}
|
||||
</section>
|
||||
{{/if}}
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</main>
|
||||
{{/post}}
|
||||
Reference in New Issue
Block a user