feat: only preload avatar and social icon in home page

This commit is contained in:
st1020 2025-05-22 21:24:19 +08:00
parent 982a25173e
commit b869da36fb

View file

@ -78,14 +78,16 @@
} }
</style> </style>
{% if section.path is defined and section.path == "/" %} {% if section.path is defined and section.path == "/" and (paginator is undefined or
paginator.current_index == 1) %}
<!-- Avatar --> <!-- Avatar -->
{% if config.extra.profile.avatar_url %} {% if config.extra.profile.avatar_url %}
<link rel="preload" as="image" href="{{ get_url(path=config.extra.profile.avatar_url) }}" /> <link rel="preload" as="image" href="{{ get_url(path=config.extra.profile.avatar_url) }}" />
{% endif %} {% endif %}
<!-- Social List --> <!-- Social List -->
{% if config.extra.profile.social %} {% if config.extra.profile.social and section.path == "/" and (paginator is undefined or
paginator.current_index == 1) %}
<!----> <!---->
{% for social in config.extra.profile.social %} {% for social in config.extra.profile.social %}
<link rel="preload" as="image" href="{{ macros::get_social_icon(icon=social.name) }}" /> <link rel="preload" as="image" href="{{ macros::get_social_icon(icon=social.name) }}" />