mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
8af8e806d7
* refactor(assets): integrate UnoCSS for utility classes - Add UnoCSS with presetWind3 as pre-built CSS (assets/css/unocss.css) - Add uno.config.ts with theme breakpoints, colors, safelist, and blocklist - Replace SCSS utility classes with UnoCSS atomic classes: - d-none → hidden - d-none-desktop → sm:hidden - d-none-mobile → max-sm:hidden - order-* (safelist) - variant-numeric → tabular-nums lining-nums - Rename .blur to .is-blur to avoid UnoCSS conflict - Add @unocss-skip comments for SVG path elements to prevent false positives - Remove redundant _utilities.scss ($orders map) and simplify _common.scss - Update documentation (CLAUDE.md, CONTRIBUTING.md, copilot-instructions.md) * refactor(assets): replace 404/offline SCSS with UnoCSS atomic classes - Replace _404.scss styles with atomic classes on template elements - Replace _offline.scss styles with atomic classes on template elements - Keep selectors (id/class) as user customization hooks - Delete assets/scss/pages/_404.scss and _offline.scss * refactor(assets): simplify SCSS with UnoCSS atomic classes - Replace _bilibili.scss with atomic classes (relative, aspect-video, inset-0) - Replace _version.scss with atomic classes (whitespace-nowrap, align-text-bottom) - Replace _noscript-warning.scss with atomic classes (bg-danger, fixed, z-200) - Add semantic z-index shortcuts (z-hide, z-auto, z-base, z-loading, z-sticky, z-fixed) - Add h1-h6 to UnoCSS blocklist to prevent false positives - Use Source path for UnoCSS CSS loading to enable Hugo minify * chore(assets): minor SCSS and template cleanup * fix(assets): add secondary color to UnoCSS theme config text-secondary was broken because the secondary color mapping was missing. * feat(assets): add UnoCSS presetIcons support and z-index shortcuts - Add presetIcons preset with empty collections (ready for custom icon sets) - Add @iconify/json and @iconify/utils devDependencies - Add semantic z-index shortcuts (z-hide, z-auto, z-base, z-loading, z-sticky, z-fixed) - Add secondary color to UnoCSS theme config * refactor(assets): replace SVG icons with UnoCSS presetIcons - Add Lucide and Octicons icon collections to presetIcons config - Replace arrow-up/down and enter-key SVGs with Lucide icons - Replace alert icons (info, light-bulb, report, alert, stop) with Octicons - Delete replaced SVG files from assets/images/icons/ - Keep custom SVGs (csdn, plume, rootme) * refactor(layouts): redesign 404 and offline pages with UnoCSS - Replace translate-y-[30vh] with self-stretch flex centering below header - Remove arbitrary values (text-[3.6rem], text-[1.8rem], etc.) - Restore @page print styles in _common.scss - Simplify offline page layout (icon + title + text) - Fix hardcoded #57606a → text-secondary
121 lines
4.6 KiB
HTML
121 lines
4.6 KiB
HTML
{{- $profile := .Site.Params.home.profile -}}
|
|
{{- $author := partial "function/get-author-map.html" .Params.author -}}
|
|
|
|
<div class="home-profile">
|
|
{{- $avatar := dict "Email" $profile.gravatarEmail "Size" "96" | partial "function/get-gravatar.html" | default $profile.avatarURL | default $author.avatar -}}
|
|
{{- if $avatar -}}
|
|
<div class="home-avatar">
|
|
{{- $menus := $.Site.Menus.main | default slice -}}
|
|
{{- $optim := slice
|
|
(dict "Process" "fill center 96x96 webp" "descriptor" "96w")
|
|
(dict "Process" "fill center 144x144 webp" "descriptor" "144w")
|
|
(dict "Process" "fill center 192x192 webp" "descriptor" "192w")
|
|
-}}
|
|
{{- $avatarMenuIndex := 0 -}}
|
|
{{- if $profile.avatarMenu -}}
|
|
{{- range $index, $menu := $menus -}}
|
|
{{- if eq $menu.Identifier $profile.avatarMenu -}}
|
|
{{- $avatarMenuIndex = $index -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{- with index $menus $avatarMenuIndex -}}
|
|
{{- $url := .URL | relLangURL -}}
|
|
{{- with .Page -}}
|
|
{{- $url = .RelPermalink -}}
|
|
{{- end -}}
|
|
<a href="{{ $url }}"{{ with .Title | default .Name }} title="{{ . }}"{{ end }}{{ if (urls.Parse $url).Host }} rel="noopener noreferrer" target="_blank"{{ end }}>
|
|
{{- dict "Src" $avatar "Alt" "Home avatar" "Width" 96 "Height" 96 "OptimConfig" $optim | partial "plugin/image.html" -}}
|
|
</a>
|
|
{{- else -}}
|
|
{{- dict "Src" $avatar "Alt" "Home avatar" "Width" 96 "Height" 96 "OptimConfig" $optim | partial "plugin/image.html" -}}
|
|
{{- end -}}
|
|
</div>
|
|
{{- end -}}
|
|
|
|
<h1 class="home-title">
|
|
{{- with $profile.title -}}
|
|
{{- . | safeHTML -}}
|
|
{{- end -}}
|
|
</h1>
|
|
|
|
{{- with $profile.subtitle -}}
|
|
<p class="home-subtitle">
|
|
{{- if $profile.typeit -}}
|
|
<span class="hidden">{{ . }}</span>
|
|
{{- $.Store.Set "hasTyped" true -}}
|
|
<span class="typeit"><template>{{ . | safeHTML }}</template></span>
|
|
{{- else -}}
|
|
{{- . | safeHTML -}}
|
|
{{- end -}}
|
|
</p>
|
|
{{- end -}}
|
|
|
|
{{- if $profile.social -}}
|
|
<div class="links">
|
|
{{- $socialMap := resources.Get "data/social.yml" | transform.Unmarshal -}}
|
|
{{- $socialArr := slice -}}
|
|
{{- range $key, $value := .Site.Params.social -}}
|
|
{{- $social := $key | lower | index $socialMap | default dict -}}
|
|
{{- if $value -}}
|
|
{{- if reflect.IsMap $value -}}
|
|
{{- with $value.weight -}}
|
|
{{- $social = dict "Weight" . | merge $social -}}
|
|
{{- end -}}
|
|
{{- with $value.prefix -}}
|
|
{{- $social = dict "Prefix" . | merge $social -}}
|
|
{{- end -}}
|
|
{{- with $value.template -}}
|
|
{{- $social = dict "Template" . | merge $social -}}
|
|
{{- end -}}
|
|
{{- with $value.id -}}
|
|
{{- $social = dict "Id" . | merge $social -}}
|
|
{{- end -}}
|
|
{{- with $value.url -}}
|
|
{{- $social = dict "Url" . | merge $social -}}
|
|
{{- end -}}
|
|
{{- with $value.title -}}
|
|
{{- $social = dict "Title" . | merge $social -}}
|
|
{{- end -}}
|
|
{{- with $value.newtab -}}
|
|
{{- $social = dict "Newtab" . | merge $social -}}
|
|
{{- end -}}
|
|
{{- with $value.icon -}}
|
|
{{- $icon := dict -}}
|
|
{{- with .class -}}
|
|
{{- $icon = dict "Class" . | merge $icon -}}
|
|
{{- end -}}
|
|
{{- with .simpleicons -}}
|
|
{{- $icon = dict "Simpleicons" . | merge $icon -}}
|
|
{{- end -}}
|
|
{{- with .src -}}
|
|
{{- $icon = dict "Src" . | merge $icon -}}
|
|
{{- end -}}
|
|
{{- $social = dict "Icon" $icon | merge $social -}}
|
|
{{- end -}}
|
|
{{- else if ne $value true -}}
|
|
{{- $social = dict "Id" $value | merge $social -}}
|
|
{{- end -}}
|
|
{{- if $social.Icon.Simpleicons -}}
|
|
{{- $prefix := ($.Site.Store.Get "cdn" | default dict).simpleIconsPrefix -}}
|
|
{{- $social = dict "Prefix" $prefix | dict "Icon" | merge $social -}}
|
|
{{- end -}}
|
|
{{- $socialArr = $socialArr | append $social -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{- range sort $socialArr "Weight" -}}
|
|
{{- partial "plugin/social.html" . -}}
|
|
{{- end -}}
|
|
</div>
|
|
{{- end -}}
|
|
|
|
{{- with $profile.disclaimer -}}
|
|
<h3 class="home-disclaimer">
|
|
{{- . | safeHTML -}}
|
|
</h3>
|
|
{{- end -}}
|
|
|
|
{{- /* Custom Profile */ -}}
|
|
{{- block "custom-profile" . }}{{ end -}}
|
|
</div>
|