mirror of
https://github.com/halo-dev/theme-earth.git
synced 2025-10-14 22:47:03 +00:00
perf: seo issues
This commit is contained in:
@@ -1,13 +1,14 @@
|
|||||||
|
const defaultAvatar = "/themes/theme-earth/assets/images/default-avatar.svg";
|
||||||
export default () => ({
|
export default () => ({
|
||||||
displayName: undefined,
|
displayName: undefined,
|
||||||
avatar: "/themes/theme-earth/assets/images/default-avatar.svg",
|
avatar: defaultAvatar,
|
||||||
loading: false,
|
loading: false,
|
||||||
handleFetchLoginedUser: async function () {
|
handleFetchLoginedUser: async function () {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
const user = await (await fetch("/apis/api.console.halo.run/v1alpha1/users/-")).json();
|
const user = await (await fetch("/apis/api.console.halo.run/v1alpha1/users/-")).json();
|
||||||
if (user && user.spec) {
|
if (user && user.spec) {
|
||||||
this.displayName = user.spec.displayName;
|
this.displayName = user.spec.displayName;
|
||||||
this.avatar = user.spec.avatar;
|
this.avatar = user.spec.avatar || defaultAvatar;
|
||||||
}
|
}
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
},
|
},
|
||||||
|
4
templates/assets/dist/main.iife.js
vendored
4
templates/assets/dist/main.iife.js
vendored
File diff suppressed because one or more lines are too long
@@ -15,7 +15,7 @@
|
|||||||
class="relative flex items-center space-x-3 rounded border border-gray-300 bg-white px-5 py-4 shadow-sm hover:border-gray-400 hover:shadow dark:border-slate-600 dark:bg-slate-700 dark:hover:border-slate-700"
|
class="relative flex items-center space-x-3 rounded border border-gray-300 bg-white px-5 py-4 shadow-sm hover:border-gray-400 hover:shadow dark:border-slate-600 dark:bg-slate-700 dark:hover:border-slate-700"
|
||||||
>
|
>
|
||||||
<div class="flex-shrink-0">
|
<div class="flex-shrink-0">
|
||||||
<img class="h-12 w-12 rounded-full" th:src="${link.spec.logo}" />
|
<img class="h-12 w-12 rounded-full" th:src="${link.spec.logo}" th:alt="${link.spec.displayName}" />
|
||||||
</div>
|
</div>
|
||||||
<div class="min-w-0 flex-1">
|
<div class="min-w-0 flex-1">
|
||||||
<div>
|
<div>
|
||||||
|
@@ -65,9 +65,7 @@
|
|||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<ul class="flex items-center gap-4">
|
<ul class="flex items-center gap-4">
|
||||||
<li class="sm:hidden" x-on:click="overlayMenu = true">
|
<li class="sm:hidden" x-on:click="overlayMenu = true">
|
||||||
<a href="javascript:void(0)" class="text-gray-600 hover:text-blue-600 dark:text-slate-100">
|
<div class="i-tabler-menu-2 text-lg text-gray-600 hover:text-blue-600 dark:text-slate-100"></div>
|
||||||
<div class="i-tabler-menu-2 text-lg"></div>
|
|
||||||
</a>
|
|
||||||
</li>
|
</li>
|
||||||
<li
|
<li
|
||||||
th:if="${theme.config.style.enable_change_color_scheme}"
|
th:if="${theme.config.style.enable_change_color_scheme}"
|
||||||
@@ -76,9 +74,7 @@
|
|||||||
@mouseenter="open()"
|
@mouseenter="open()"
|
||||||
@mouseleave="close()"
|
@mouseleave="close()"
|
||||||
>
|
>
|
||||||
<a href="javascript:void(0)" class="text-gray-600 hover:text-blue-600 dark:text-slate-100">
|
<div class="i-gg-dark-mode text-lg text-gray-600 hover:text-blue-600 dark:text-slate-100"></div>
|
||||||
<div class="i-gg-dark-mode text-lg"></div>
|
|
||||||
</a>
|
|
||||||
<ul
|
<ul
|
||||||
@mouseenter="open()"
|
@mouseenter="open()"
|
||||||
@mouseleave="close()"
|
@mouseleave="close()"
|
||||||
@@ -106,7 +102,11 @@
|
|||||||
</li>
|
</li>
|
||||||
<!-- https://github.com/halo-sigs/plugin-search-widget -->
|
<!-- https://github.com/halo-sigs/plugin-search-widget -->
|
||||||
<li th:if="${pluginFinder.available('PluginSearchWidget')}">
|
<li th:if="${pluginFinder.available('PluginSearchWidget')}">
|
||||||
<a href="javascript:SearchWidget.open()" class="text-gray-600 hover:text-blue-600 dark:text-slate-100">
|
<a
|
||||||
|
href="javascript:SearchWidget.open()"
|
||||||
|
title="搜索"
|
||||||
|
class="text-gray-600 hover:text-blue-600 dark:text-slate-100"
|
||||||
|
>
|
||||||
<div class="i-tabler-search text-lg"></div>
|
<div class="i-tabler-search text-lg"></div>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@@ -117,9 +117,9 @@
|
|||||||
@mouseleave="close()"
|
@mouseleave="close()"
|
||||||
>
|
>
|
||||||
<div x-data="user">
|
<div x-data="user">
|
||||||
<a href="javascript:void(0)" class="h-5 w-5 text-gray-600 hover:text-blue-600 dark:text-slate-100">
|
<div class="h-5 w-5 text-gray-600 hover:text-blue-600 dark:text-slate-100">
|
||||||
<img class="h-5 w-5 rounded-full" x-bind:src="avatar" />
|
<img class="h-5 w-5 rounded-full" x-bind:src="avatar" x-bind:alt="displayName" />
|
||||||
</a>
|
</div>
|
||||||
<ul
|
<ul
|
||||||
@mouseenter="open()"
|
@mouseenter="open()"
|
||||||
@mouseleave="close()"
|
@mouseleave="close()"
|
||||||
|
Reference in New Issue
Block a user