|
1 | 1 | --- |
2 | 2 | layout: default |
| 3 | +hide_hero: true |
3 | 4 | --- |
4 | 5 |
|
5 | | -<div class="columns is-multiline"> |
| 6 | +<article class="book-detail max-w-4xl mx-auto"> |
| 7 | + <!-- Breadcrumb --> |
| 8 | + <nav class="flex items-center gap-2 text-sm font-mono text-cp-dark-600 mb-8"> |
| 9 | + <a href="{{ '/' | relative_url }}" class="hover:text-cp-green-500 transition-colors"> |
| 10 | + <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
| 11 | + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"/> |
| 12 | + </svg> |
| 13 | + </a> |
| 14 | + <span class="text-cp-dark-500">/</span> |
| 15 | + <a href="{{ '/markdown/products/' | relative_url }}" class="hover:text-cp-green-500 transition-colors">書籍</a> |
| 16 | + <span class="text-cp-dark-500">/</span> |
| 17 | + <span class="text-cp-green-500">{{ page.title | truncate: 30 }}</span> |
| 18 | + </nav> |
6 | 19 |
|
7 | | - <div class="column is-6"> |
8 | | - <figure class="image is-4by3"> |
9 | | - <img src="{{ page.image }}" /> |
10 | | - </figure> |
11 | | - </div> |
| 20 | + <!-- Book Header Card --> |
| 21 | + <header class="card p-6 mb-8"> |
| 22 | + <div class="flex flex-col md:flex-row gap-6"> |
| 23 | + <!-- Cover Image --> |
| 24 | + {% if page.image %} |
| 25 | + <div class="flex-shrink-0 mx-auto md:mx-0"> |
| 26 | + <div class="w-36 md:w-44 rounded-lg overflow-hidden shadow-lg border border-cp-dark-400"> |
| 27 | + <img |
| 28 | + src="{{ page.image | relative_url }}" |
| 29 | + alt="{{ page.title }}" |
| 30 | + class="w-full h-auto" |
| 31 | + > |
| 32 | + </div> |
| 33 | + </div> |
| 34 | + {% endif %} |
| 35 | + |
| 36 | + <!-- Book Info --> |
| 37 | + <div class="flex-1 text-center md:text-left"> |
| 38 | + <!-- Title --> |
| 39 | + <h1 class="text-2xl md:text-3xl font-bold font-mono text-cp-green-500 mb-2 leading-tight"> |
| 40 | + {{ page.title }} |
| 41 | + </h1> |
12 | 42 |
|
13 | | - <div class="column is-6"> |
14 | | - <p class="title is-3">{{ page.title }}</p> |
15 | | - <p class="subtitle is-3">{{ page.subtitle }}</p> |
16 | | - <p class="title is-4 has-text-right">{{ page.price }}</p> |
17 | | - {% if page.product_code %} |
18 | | - <p class="subtitle is-5 has-text-right">{{ page.product_code }}</p> |
| 43 | + {% if page.subtitle %} |
| 44 | + <p class="text-base md:text-lg text-cp-dark-600 font-mono mb-3"> |
| 45 | + {{ page.subtitle }} |
| 46 | + </p> |
19 | 47 | {% endif %} |
20 | | - |
21 | | - {% if page.rating %} |
22 | | - {% include rating.html rating=page.rating %} |
| 48 | + |
| 49 | + <!-- Author --> |
| 50 | + {% if page.author %} |
| 51 | + <p class="text-sm text-cp-dark-500 mb-4"> |
| 52 | + <svg class="w-4 h-4 inline-block mr-1 -mt-0.5" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
| 53 | + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"/> |
| 54 | + </svg> |
| 55 | + {{ page.author }} |
| 56 | + </p> |
23 | 57 | {% endif %} |
24 | | - |
25 | | - {% if page.features %} |
26 | | - <div class="content"> |
27 | | - {% for feature in page.features %} |
28 | | - <p> |
29 | | - <span class="icon"> |
30 | | - {% if feature.icon %} |
31 | | - <i class="fas {{ feature.icon }}"></i> |
32 | | - {% else %} |
33 | | - <i class="fas fa-circle fa-xs"></i> |
34 | | - {% endif %} |
35 | | - </span> |
36 | | - <span>{{ feature.label }}</span></p> |
37 | | - {% endfor %} |
| 58 | + |
| 59 | + <!-- Badges --> |
| 60 | + <div class="flex flex-wrap gap-2 mb-4 justify-center md:justify-start"> |
| 61 | + {% if page.lang == 'zh' %} |
| 62 | + <span class="px-3 py-1 text-xs font-mono font-bold bg-cp-orange/20 text-cp-orange rounded-full">繁體中文</span> |
| 63 | + {% elsif page.lang == 'en' %} |
| 64 | + <span class="px-3 py-1 text-xs font-mono font-bold bg-gray-500/20 text-gray-400 rounded-full">English</span> |
| 65 | + {% endif %} |
| 66 | + |
| 67 | + {% if page.difficulty %} |
| 68 | + <span class="px-3 py-1 text-xs font-mono bg-cp-dark-300 text-cp-dark-600 rounded-full"> |
| 69 | + {% case page.difficulty %} |
| 70 | + {% when 1 %}入門 |
| 71 | + {% when 2 %}基礎 |
| 72 | + {% when 3 %}中級 |
| 73 | + {% when 4 %}進階 |
| 74 | + {% when 5 %}專家 |
| 75 | + {% endcase %} |
| 76 | + </span> |
| 77 | + {% endif %} |
| 78 | + |
| 79 | + <span class="px-3 py-1 text-xs font-mono font-bold bg-cp-green-500/20 text-cp-green-500 rounded-full">免費</span> |
38 | 80 | </div> |
| 81 | + |
| 82 | + <!-- Description --> |
| 83 | + {% if page.description %} |
| 84 | + <p class="text-sm text-cp-dark-700 leading-relaxed mb-5 max-w-2xl"> |
| 85 | + {{ page.description }} |
| 86 | + </p> |
39 | 87 | {% endif %} |
40 | | - </div> |
41 | 88 |
|
42 | | - <div class="column is-12"> |
43 | | - <p class="title is-4">描述</p> |
44 | | - <div class="content"> |
45 | | - |
46 | | - |
47 | | - {{ content }} |
| 89 | + <!-- Action Buttons --> |
| 90 | + <div class="flex flex-wrap gap-3 justify-center md:justify-start"> |
| 91 | + {% if page.read_url %} |
| 92 | + <a href="{{ page.read_url }}" target="_blank" rel="noopener noreferrer" |
| 93 | + class="inline-flex items-center gap-2 px-5 py-2.5 bg-cp-green-500 text-cp-dark font-mono text-sm font-bold rounded-lg hover:bg-cp-green-400 transition-all hover:shadow-glow-green"> |
| 94 | + <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
| 95 | + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"/> |
| 96 | + </svg> |
| 97 | + 線上閱讀 |
| 98 | + <svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
| 99 | + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"/> |
| 100 | + </svg> |
| 101 | + </a> |
| 102 | + {% endif %} |
| 103 | + <a href="{{ '/markdown/products/' | relative_url }}" |
| 104 | + class="inline-flex items-center gap-2 px-5 py-2.5 border border-cp-dark-400 text-cp-dark-700 font-mono text-sm rounded-lg hover:border-cp-green-500 hover:text-cp-green-500 transition-all"> |
| 105 | + <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
| 106 | + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 10h16M4 14h16M4 18h16"/> |
| 107 | + </svg> |
| 108 | + 所有書籍 |
| 109 | + </a> |
48 | 110 | </div> |
| 111 | + </div> |
49 | 112 | </div> |
| 113 | + </header> |
50 | 114 |
|
51 | | - {% if site.data.reviews[page.product_code] %} |
52 | | - <div class="column is-12"> |
53 | | - <p class="title is-4">Reviews</p> |
54 | | - {% for review in site.data.reviews[page.product_code] %} |
55 | | - {% include review.html %} |
56 | | - {% endfor %} |
57 | | - </div> |
58 | | - {% endif %} |
59 | | - |
60 | | -</div> |
61 | | - |
| 115 | + <!-- Content --> |
| 116 | + <div class="book-content"> |
| 117 | + {{ content }} |
| 118 | + </div> |
| 119 | +</article> |
0 commit comments