summaryrefslogtreecommitdiff
path: root/themes/blowfish/exampleSite/layouts/partials/recent-articles-demo.html
blob: 6e40b8e8dbbdfd354a638f9f42008780538aa3dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{{ $recentArticles := 5 }}
{{ $showMoreLinkDest := "/posts" }}
{{ if index .Site.Params.homepage "showRecentItems" }}
{{ $recentArticles = .Site.Params.homepage.showRecentItems }}
{{ end }}

<h2 class="mt-8 text-2xl font-extrabold mb-10">{{ i18n "shortcode.recent_articles" | emojify }}</h2>

<div class="flex mb-6 px-4 py-2 mb-8 text-base rounded-md bg-primary-100 dark:bg-primary-900">
    <span class="flex items-center justify-between grow dark:text-neutral-300">
        <span class="prose dark:prose-invert">This is a demo of theme's list configurations: <code
                id="config">card view</code></span>
        <button id="switch-config-button"
            class="px-4 !text-neutral !no-underline rounded-md bg-primary-600 hover:!bg-primary-500 dark:bg-primary-800 dark:hover:!bg-primary-700">
            Switch config &orarr;
        </button>
    </span>
</div>

<div id="CardViewProse" class="h-full">
    {{ partial "recent-articles/cardview.html" . }}
</div>

<div id="CardViewScreenWidth" class="hidden h-full">
    {{ partial "recent-articles/cardview-fullwidth.html" . }}
</div>

<div id="NormalView" class="hidden h-full">
    {{ partial "recent-articles/list.html" . }}
</div>

{{ if .Site.Params.homepage.showMoreLink | default false }}
{{ if index .Site.Params.homepage "showRecentItems" }}
{{ $showMoreLinkDest = .Site.Params.homepage.showMoreLinkDest }}
{{ end }}
<div class="mt-10 flex justify-center">
    <a href="{{ $showMoreLinkDest }}">
        <button
            class="bg-transparent hover:text-primary-500 prose dark:prose-invert font-semibold hover:text-white py-2 px-4 border border-primary-500 hover:border-transparent rounded">
            {{ i18n "recent.show_more" | markdownify | emojify }}
            </button>
    </a>
</div>
{{ end }}