* add npm dependencies used in this theme * implement helper to configure JS and ESBuild * migrate jquery popper.js bootstrap fontawesome to js bundle * refactor main.js into smaller pieces, and moved navbar.js to assets * remove list.js. It adjusts post card height to be the same, but is actually not needed. * refactored notes.js, search.js, single.js into application.js * move ityped to js asset, implement experiences horizontal vertical line in css * align recent post height via css * migrated home.js and refactored into various sections * migrated darkMode feature to js bundle * moved mermaid feature to js bundle * migrate syntax highlight to js bundle * migrate katex ( js portion ) to js bundle * migrate pdf-js to js bundle by delegating to cdn * set explicit comparisions for feature envvars so js can properly optimize * removed goat-counter * more fixes for broken achievements and small bugs * more bug fixes * allow configuration of hightlight.js, fix video-player shortcode * remove jquery all together * add null handling and fix merge conflicts Co-authored-by: Aaron Qian <aaron@yeet.io>
29 lines
1.4 KiB
HTML
29 lines
1.4 KiB
HTML
{{ $achievementImage := resources.Get .image }}
|
|
{{ $achievementImageLg := ""}}
|
|
{{ $achievementImageSm := ""}}
|
|
|
|
{{/* resize the images. don't resize svg image because its not supported */}}
|
|
{{ if $achievementImage }}
|
|
{{ $achievementImageSm = $achievementImage.Resize "x300" }}
|
|
{{ $achievementImageSm = $achievementImageSm.RelPermalink }}
|
|
{{ $achievementImageLg = $achievementImage.Resize "x1500" }}
|
|
{{ $achievementImageLg = $achievementImageLg.RelPermalink }}
|
|
{{ end }}
|
|
{{/* don't use "background-image: url('{{ $achievementImageSm }}');" Otherwise the images won't show in https://themes.gohugo.io/ */}}
|
|
<div
|
|
class="achievement-entry text-center"
|
|
style="background-image: url('{{ $achievementImageSm }}');"
|
|
>
|
|
<i class="fa-solid fa-xmark hidden"></i>
|
|
<i class="fa-solid fa-magnifying-glass-plus" id="enlarge-icon"></i>
|
|
<h4 class="title" id="achievement-title">{{ .title }}</h4>
|
|
<div class="caption hidden col-lg-6 text-left" id="caption">
|
|
<h4>{{ .title }}</h4>
|
|
<p>{{ .summary | markdownify }}</p>
|
|
{{ if .url }}
|
|
<a class="btn btn-info ml-1 pl-2 mb-2" href="{{ .url }}" target="_blank" rel="noopener" role="button">{{ i18n "project_details"}}</a>
|
|
{{ end }}
|
|
</div>
|
|
<span style="background-image: url('{{ $achievementImageSm }}');" class="d-none" id="SmallImage" active="true"></span>
|
|
<span style="background-image: url('{{ $achievementImageLg }}');" class="d-none" id="LargeImage"></span>
|
|
</div>
|