1
0
Fork 0

去除首页第一篇文章特殊样式

This commit is contained in:
indes 2018-04-19 22:03:25 +08:00
parent 20494e19ad
commit fe3849c963
2 changed files with 5 additions and 6 deletions

View file

@ -9,13 +9,12 @@
{{ end }}
{{ $paginator := .Paginate (where .Pages ".Params.type" "!=" "page") (index .Site.Params "paginate" | default 10) }}
{{ if gt $paginator.TotalPages 0 }}
{{ range $index, $page := $paginator.Pages }}
{{ if and $.IsHome (eq $paginator.PageNumber 1) (eq $index 0) }}
{{ .Scratch.Set "postClass" "first-entry" }}
{{ .Scratch.Set "firstEmoji" "<span class=\"welcome-emoji\">👉</span>" }}
{{ else }}
{{ .Scratch.Set "postClass" "post-entry" }}
{{ end }}
<article class="post {{ .Scratch.Get `postClass` }}">
<header class="post-header">
{{ safeHTML (.Scratch.Get `firstEmoji`) }}

View file

@ -23,7 +23,7 @@
<meta name="author" content="{{ .Site.Params.author }}">
{{ end -}}
<!-- Styles -->
<link href="https://fonts.googleapis.com/css?family=PT+Sans:400,400i,700,700i" rel="stylesheet">
<link href="https://fonts.loli.net/css?family=PT+Sans:400,400i,700,700i" rel="stylesheet">
<link href="https://cdn.bootcss.com/highlight.js/9.12.0/styles/default.min.css" rel="stylesheet">
<link href="/css/style.css" rel="stylesheet">
<!-- Favicons -->