소스 검색

feat: link page summary to page

Provides an experience similar to popular blogging platforms.

Make it easier for the visitor to click through and more obvious that it's just a excerpt of the page.

Close #1751
George Cushen 5 년 전
부모
커밋
033e1bd32c
3개의 변경된 파일15개의 추가작업 그리고 4개의 파일을 삭제
  1. 7 0
      assets/scss/academic/_card.scss
  2. 3 1
      layouts/partials/li_card.html
  3. 5 3
      layouts/partials/li_compact.html

+ 7 - 0
assets/scss/academic/_card.scss

@@ -25,6 +25,13 @@
   border: 1px solid rgb(68, 71, 90);
 }
 
+/* In page listings, display the linked summaries as normal text except for the hover cursor. */
+.media.stream-item .article-style a,
+.card-simple .article-style a {
+  color: unset;
+  text-decoration: none;
+}
+
 .card {
   margin-bottom: 1.5rem;
   overflow: hidden;

+ 3 - 1
layouts/partials/li_card.html

@@ -55,7 +55,9 @@
 
   {{ with $summary }}
   <div class="article-style">
-    <p>{{.}}</p>
+    <a href="{{ $item.RelPermalink }}">
+      <p>{{.}}</p>
+    </a>
   </div>
   {{ end }}
 

+ 5 - 3
layouts/partials/li_compact.html

@@ -38,9 +38,11 @@
     </h3>
 
     {{ with $summary }}
-    <div class="article-style">
-      {{ . }}
-    </div>
+      <div class="article-style">
+        <a href="{{ $item.RelPermalink }}">
+          {{ . }}
+        </a>
+      </div>
     {{ end }}
 
     <div class="stream-meta article-metadata">