layouts/shortcodes/blocks/cover.html (70 lines of code) (raw):

{{ $_hugo_config := `{ "version": 1 }` }} {{ $blockID := printf "td-cover-block-%d" .Ordinal }} {{ $promo_image := (.Page.Resources.ByType "image").GetMatch "**background*" }} {{ $logo_image := (.Page.Resources.ByType "image").GetMatch "**logo*" }} {{ $col_id := .Get "color" | default "dark" }} {{ $image_anchor := .Get "image_anchor" | default "smart" }} {{ $logo_anchor := .Get "logo_anchor" | default "smart" }} {{/* Height can be one of: auto, min, med, max, full. */}} {{ $height := .Get "height" | default "max" }} {{ $byline := .Get "byline" | default "" }} {{ with $promo_image }} {{ $promo_image_big := (.Fill (printf "1920x1080 %s" $image_anchor)) }} {{ $promo_image_small := (.Fill (printf "960x540 %s" $image_anchor)) }} <link rel="preload" as="image" href="{{ $promo_image_small.RelPermalink }}" media="(max-width: 1200px)"> <link rel="preload" as="image" href="{{ $promo_image_big.RelPermalink }}" media="(min-width: 1200px)"> <style> #{{ $blockID }} { background-image: url({{ $promo_image_small.RelPermalink }}); } @media only screen and (min-width: 1200px) { #{{ $blockID }} { background-image: url({{ $promo_image_big.RelPermalink }}); } } .github-stat-buttons { margin: 25px 0; } </style> <!-- Place this tag in your head or just before your close body tag. --> <script async defer src="/js/github-buttons.js"></script> {{ end }} <section id="{{ $blockID }}" class="row td-cover-block td-cover-block--height-{{ $height }} js-td-cover td-overlay -bg-{{ $col_id }}"> <div class="container-fluid td-overlay__inner"> <div class="row align-items-end"> <div class="col-lg-6"> <h2 class="display-3 mt-0 pb-2"> {{ T "homepage_slogan" }} </h2> <p style=" font-size: 1.35rem;font-weight: 300;line-height: 1.2;" class="mb-4 mt-4"> {{ T "homepage_description_paragraph1" }} </p> <p style=" font-size: 1.35rem;font-weight: 300;line-height: 1.2;" class="mb-4 mt-4"> {{ T "homepage_description_paragraph2" }} </p> <!-- <div id="docsearch_zh_home" class="btn btn-lg mr-3 mb-4"></div>--> <div style="display:flex;justify-content: center;align-items: center;flex-wrap: wrap;" > <a class="btn btn-lg btn-secondary mb-4 ml-2 mr-2 rounded" href="overview/what/"> <span style="margin: 1rem !important;">{{ T "homepage_button_1" }}</span> </a> <a class="btn btn-lg btn-secondary mb-4 ml-2 mr-2 rounded" href="overview/quickstart/"> <span style="margin: 2rem !important;">{{ T "homepage_button_2" }}</span> </a> </div> </div> <div class="col-lg-6 mt-5 mt-lg-3 d-sm-block"> <div class="column bg-texture center" style="min-height:320px" > <iframe style="height: 315px;position:relative;width: 100%; max-width:560px;" height="315" src="//player.bilibili.com/player.html?aid=737424422&bvid=BV1YD4y1g7Qk&cid=1024306839&page=1" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> </div> </div> <div class="col-12 pt-3"> <div class="pt-3 lead text-center"> {{ .Inner | markdownify}} </div> </div> </div> </div> {{ if $byline }} <div class="byline"> <small>{{ $byline }}</small> </div> {{ end }} </section>