perf: seo issues

This commit is contained in:
Ryan Wang
2022-11-13 15:15:44 +08:00
parent 193bef09c7
commit 4bbabe6770
4 changed files with 16 additions and 15 deletions

View File

@@ -1,13 +1,14 @@
const defaultAvatar = "/themes/theme-earth/assets/images/default-avatar.svg";
export default () => ({
displayName: undefined,
avatar: "/themes/theme-earth/assets/images/default-avatar.svg",
avatar: defaultAvatar,
loading: false,
handleFetchLoginedUser: async function () {
this.loading = true;
const user = await (await fetch("/apis/api.console.halo.run/v1alpha1/users/-")).json();
if (user && user.spec) {
this.displayName = user.spec.displayName;
this.avatar = user.spec.avatar;
this.avatar = user.spec.avatar || defaultAvatar;
}
this.loading = false;
},

File diff suppressed because one or more lines are too long

View File

@@ -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"
>
<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 class="min-w-0 flex-1">
<div>

View File

@@ -65,9 +65,7 @@
<div class="flex items-center">
<ul class="flex items-center gap-4">
<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"></div>
</a>
<div class="i-tabler-menu-2 text-lg text-gray-600 hover:text-blue-600 dark:text-slate-100"></div>
</li>
<li
th:if="${theme.config.style.enable_change_color_scheme}"
@@ -76,9 +74,7 @@
@mouseenter="open()"
@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"></div>
</a>
<div class="i-gg-dark-mode text-lg text-gray-600 hover:text-blue-600 dark:text-slate-100"></div>
<ul
@mouseenter="open()"
@mouseleave="close()"
@@ -106,7 +102,11 @@
</li>
<!-- https://github.com/halo-sigs/plugin-search-widget -->
<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>
</a>
</li>
@@ -117,9 +117,9 @@
@mouseleave="close()"
>
<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">
<img class="h-5 w-5 rounded-full" x-bind:src="avatar" />
</a>
<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" x-bind:alt="displayName" />
</div>
<ul
@mouseenter="open()"
@mouseleave="close()"