mirror of
https://github.com/dillonzq/LoveIt.git
synced 2024-11-21 14:26:17 +01:00
fix: wrong URL of JS and CSS files on baseURL (#249)
This commit is contained in:
parent
3c38d54a87
commit
f5fb31ec43
11 changed files with 33 additions and 21 deletions
|
@ -7,7 +7,7 @@
|
|||
<h1 id="error-emoji"></h1>
|
||||
<p class="error-text">
|
||||
{{- T "pageNotFoundText" -}}
|
||||
<a href="{{ `/` | relLangURL }}" title="{{ T `backToHome` }}">↩︎</a>
|
||||
<a href="{{ .Site.Home.RelPermalink }}" title="{{ T `backToHome` }}">↩︎</a>
|
||||
</p>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
{{- /* Meta */ -}}
|
||||
<div class="post-meta">
|
||||
{{- $author := $params.author | default .Site.Author.name | default (T "author") -}}
|
||||
{{- $authorLink := $params.authorlink | default .Site.Author.link | default (relLangURL "/") -}}
|
||||
{{- $authorLink := $params.authorlink | default .Site.Author.link | default .Site.Home.RelPermalink -}}
|
||||
<span class="post-author">
|
||||
{{- $options := dict "class" "author" "href" $authorLink "title" "Author" "rel" "author" "icon" (dict "class" "fas fa-user-circle fa-fw") "content" $author -}}
|
||||
{{- partial "plugin/link.html" $options -}}
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
<div id="fb-root" class="comment"></div>
|
||||
<div
|
||||
class="fb-comments"
|
||||
data-href="{{ .Permalink | absURL }}"
|
||||
data-href="{{ .Permalink }}"
|
||||
data-width="{{ $comment.facebook.width }}"
|
||||
data-numposts="{{ $comment.facebook.numPosts }}"
|
||||
></div>
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
{{- /* Author */ -}}
|
||||
{{- if ne .Site.Params.footer.author false -}}
|
||||
<span class="author" itemprop="copyrightHolder"> <a href="{{ $.Site.Author.link | default (relLangURL `/`) }}" target="_blank">{{ .Site.Author.name }}</a></span>
|
||||
<span class="author" itemprop="copyrightHolder"> <a href="{{ $.Site.Author.link | default .Site.Home.RelPermalink }}" target="_blank">{{ .Site.Author.name }}</a></span>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* License */ -}}
|
||||
|
|
|
@ -2,14 +2,20 @@
|
|||
<header class="desktop" id="header-desktop">
|
||||
<div class="header-wrapper">
|
||||
<div class="header-title">
|
||||
<a href="{{ `/` | relLangURL }}">
|
||||
<a href="{{ .Site.Home.RelPermalink }}">
|
||||
{{- .Site.Title -}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="menu">
|
||||
<div class="menu-inner">
|
||||
{{- range .Site.Menus.main -}}
|
||||
<a class="menu-item{{ if $.IsMenuCurrent "main" . | or ($.HasMenuCurrent "main" .) | or (.URL | relLangURL | string | eq $.RelPermalink ) }} active{{ end }}" href="{{ .URL | relLangURL }}"{{ with .Title }} title="{{ . }}"{{ end }} rel="noopener noreffer"{{ if strings.HasPrefix .URL "http" }} target="_blank"{{ end }}>
|
||||
{{- $url := "" -}}
|
||||
{{- with .Page -}}
|
||||
{{- $url = .RelPermalink -}}
|
||||
{{- else -}}
|
||||
{{- $url = .URL | relLangURL -}}
|
||||
{{- end -}}
|
||||
<a class="menu-item{{ if $.IsMenuCurrent `main` . | or ($.HasMenuCurrent `main` .) | or (eq $.RelPermalink $url) }} active{{ end }}" href="{{ $url }}"{{ with .Title }} title="{{ . }}"{{ end }}{{ if (urls.Parse $url).Host }} rel="noopener noreffer" target="_blank"{{ end }}>
|
||||
{{- .Pre | safeHTML }}{{ .Name -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
@ -61,7 +67,7 @@
|
|||
<div class="header-container">
|
||||
<div class="header-wrapper">
|
||||
<div class="header-title">
|
||||
<a href="{{ `/` | relLangURL }}">
|
||||
<a href="{{ .Site.Home.RelPermalink }}">
|
||||
{{- .Site.Title -}}
|
||||
</a>
|
||||
</div>
|
||||
|
@ -91,7 +97,13 @@
|
|||
{{- end -}}
|
||||
{{- $currentPage := . -}}
|
||||
{{- range .Site.Menus.main -}}
|
||||
<a class="menu-item" href="{{ .URL | relLangURL }}" title="{{ .Title }}" rel="noopener noreffer"{{ if strings.HasPrefix .URL "http" }} target="_blank"{{ end }}>
|
||||
{{- $url := "" -}}
|
||||
{{- with .Page -}}
|
||||
{{- $url = .RelPermalink -}}
|
||||
{{- else -}}
|
||||
{{- $url = .URL | relLangURL -}}
|
||||
{{- end -}}
|
||||
<a class="menu-item" href="{{ $url }}" title="{{ .Title }}"{{ if (urls.Parse $url).Host }} rel="noopener noreffer" target="_blank"{{ end }}>
|
||||
{{- .Pre | safeHTML }}{{ .Name -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
|
|
@ -2,15 +2,15 @@
|
|||
{{- $loading := resources.Get "svg/loading/normal.svg" | minify -}}
|
||||
{{- $small := .src_s | default .src -}}
|
||||
{{- $large := .src_l | default .src -}}
|
||||
{{- $alt := .alt | default .src -}}
|
||||
{{- $alt := .alt | default (relURL .src) -}}
|
||||
{{- if .linked -}}
|
||||
<a class="lightgallery" href="{{ $large | safeURL }}" title="{{ .title | default $alt }}" data-thumbnail="{{ $small | safeURL }}"{{ with .caption }} data-sub-html="<h2>{{ . }}</h2>{{ with $.alt }}<p>{{ . }}</p>{{ end }}"{{ end }}{{ with .rel }} rel="{{ . }}"{{ end }}>
|
||||
<a class="lightgallery" href="{{ $large | relURL }}" title="{{ .title | default $alt }}" data-thumbnail="{{ $small | relURL }}"{{ with .caption }} data-sub-html="<h2>{{ . }}</h2>{{ with $.alt }}<p>{{ . }}</p>{{ end }}"{{ end }}{{ with .rel }} rel="{{ . }}"{{ end }}>
|
||||
<img
|
||||
class="lazyload"
|
||||
src="{{ $loading.RelPermalink | safeURL }}"
|
||||
src="{{ $loading.RelPermalink }}"
|
||||
data-sizes="auto"
|
||||
data-srcset="{{ $small | safeURL }}, {{ .src | safeURL }} 1.5x, {{ $large | safeURL }} 2x"
|
||||
data-src="{{ .src | safeURL }}"
|
||||
data-srcset="{{ $small | relURL }}, {{ .src | relURL }} 1.5x, {{ $large | relURL }} 2x"
|
||||
data-src="{{ .src | relURL }}"
|
||||
alt="{{ $alt }}"{{ with .height }} height="{{ . }}"{{ end }}{{ with .width }} width="{{ . }}"{{ end }} />
|
||||
</a>
|
||||
{{- else -}}
|
||||
|
@ -21,8 +21,8 @@
|
|||
class="lazyload"
|
||||
src="{{ $loading.RelPermalink | safeURL }}"
|
||||
data-sizes="auto"
|
||||
data-srcset="{{ $small | safeURL }}, {{ .src | safeURL }} 1.5x, {{ $large | safeURL }} 2x"
|
||||
data-src="{{ .src | safeURL }}"
|
||||
data-srcset="{{ $small | relURL }}, {{ .src | relURL }} 1.5x, {{ $large | relURL }} 2x"
|
||||
data-src="{{ .src | relURL }}"
|
||||
alt="{{ $alt }}"
|
||||
title="{{ .title | default $alt }}"{{ with .height }} height="{{ . }}"{{ end }}{{ with .width }} width="{{ . }}"{{ end }} />
|
||||
{{- end -}}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{{- $rel := "" -}}
|
||||
<a href="{{ .href | safeURL }}"{{ with .title }} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .href "http" }}{{ $rel = "noopener noreffer" }} target="_blank"{{ end }} rel="{{ $rel }}{{ with .rel }} {{ . }}{{ end }}"{{ with .class }} class="{{ . }}"{{ end }}>
|
||||
<a href="{{ .href }}"{{ with .title }} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .href "http" }}{{ $rel = "noopener noreffer" }} target="_blank"{{ end }} rel="{{ $rel }}{{ with .rel }} {{ . }}{{ end }}"{{ with .class }} class="{{ . }}"{{ end }}>
|
||||
{{- with .icon -}}
|
||||
{{- partial "plugin/icon.html" . -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
{{- else -}}
|
||||
{{- $src := .source -}}
|
||||
{{- $integrity := .integrity -}}
|
||||
{{- if strings.HasPrefix $src "http" | or (strings.HasPrefix $src "||") | not -}}
|
||||
{{- if strings.HasPrefix $src "http" | or (strings.HasPrefix $src "//") | not -}}
|
||||
{{- $res := resources.Get $src -}}
|
||||
{{- with .template -}}
|
||||
{{- $res = $res | resources.ExecuteAsTemplate . $.context -}}
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
{{- end -}}
|
||||
</section>
|
||||
<section>
|
||||
<span><a href="javascript:window.history.back();">{{ T "back" }}</a></span> | <span><a href="{{ `/` | relLangURL }}">{{ T "home" }}</a></span>
|
||||
<span><a href="javascript:window.history.back();">{{ T "back" }}</a></span> | <span><a href="{{ .Site.Home.RelPermalink }}">{{ T "home" }}</a></span>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
<div class="post-meta">
|
||||
<div class="post-meta-line">
|
||||
{{- $author := $params.author | default .Site.Author.name | default (T "author") -}}
|
||||
{{- $authorLink := $params.authorlink | default .Site.Author.link | default (relLangURL "/") -}}
|
||||
{{- $authorLink := $params.authorlink | default .Site.Author.link | default .Site.Home.RelPermalink -}}
|
||||
<span class="post-author">
|
||||
{{- $options := dict "class" "author" "href" $authorLink "title" "Author" "rel" "author" "icon" (dict "class" "fas fa-user-circle fa-fw") "content" $author -}}
|
||||
{{- partial "plugin/link.html" $options -}}
|
||||
|
@ -50,7 +50,7 @@
|
|||
<i class="far fa-clock fa-fw"></i>{{ T "readingTime" .ReadingTime }}
|
||||
{{- $comment := .Scratch.Get "comment" | default dict -}}
|
||||
{{- if $comment.enable | and $comment.valine.enable | and $comment.valine.visitor -}}
|
||||
<span id="{{ .RelPermalink | relURL }}" class="leancloud_visitors" data-flag-title="{{ .Title }}">
|
||||
<span id="{{ .RelPermalink }}" class="leancloud_visitors" data-flag-title="{{ .Title }}">
|
||||
<i class="far fa-eye fa-fw"></i><span class=leancloud-visitors-count></span> {{ T "views" }}
|
||||
</span>
|
||||
{{- end -}}
|
||||
|
|
|
@ -61,4 +61,4 @@ Disallow: /
|
|||
User-agent: ZoominfoBot
|
||||
Disallow: /
|
||||
|
||||
Sitemap: {{ "sitemap.xml" | absLangURL }}
|
||||
Sitemap: {{ "/sitemap.xml" | absLangURL }}
|
||||
|
|
Loading…
Reference in a new issue