fix: wrong URL of JS and CSS files on baseURL (#249)
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
<h1 id="error-emoji"></h1>
|
<h1 id="error-emoji"></h1>
|
||||||
<p class="error-text">
|
<p class="error-text">
|
||||||
{{- T "pageNotFoundText" -}}
|
{{- T "pageNotFoundText" -}}
|
||||||
<a href="{{ `/` | relLangURL }}" title="{{ T `backToHome` }}">↩︎</a>
|
<a href="{{ .Site.Home.RelPermalink }}" title="{{ T `backToHome` }}">↩︎</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
{{- /* Meta */ -}}
|
{{- /* Meta */ -}}
|
||||||
<div class="post-meta">
|
<div class="post-meta">
|
||||||
{{- $author := $params.author | default .Site.Author.name | default (T "author") -}}
|
{{- $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">
|
<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 -}}
|
{{- $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 -}}
|
{{- partial "plugin/link.html" $options -}}
|
||||||
|
|||||||
@@ -64,7 +64,7 @@
|
|||||||
<div id="fb-root" class="comment"></div>
|
<div id="fb-root" class="comment"></div>
|
||||||
<div
|
<div
|
||||||
class="fb-comments"
|
class="fb-comments"
|
||||||
data-href="{{ .Permalink | absURL }}"
|
data-href="{{ .Permalink }}"
|
||||||
data-width="{{ $comment.facebook.width }}"
|
data-width="{{ $comment.facebook.width }}"
|
||||||
data-numposts="{{ $comment.facebook.numPosts }}"
|
data-numposts="{{ $comment.facebook.numPosts }}"
|
||||||
></div>
|
></div>
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
{{- /* Author */ -}}
|
{{- /* Author */ -}}
|
||||||
{{- if ne .Site.Params.footer.author false -}}
|
{{- 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 -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- /* License */ -}}
|
{{- /* License */ -}}
|
||||||
|
|||||||
@@ -2,14 +2,20 @@
|
|||||||
<header class="desktop" id="header-desktop">
|
<header class="desktop" id="header-desktop">
|
||||||
<div class="header-wrapper">
|
<div class="header-wrapper">
|
||||||
<div class="header-title">
|
<div class="header-title">
|
||||||
<a href="{{ `/` | relLangURL }}">
|
<a href="{{ .Site.Home.RelPermalink }}">
|
||||||
{{- .Site.Title -}}
|
{{- .Site.Title -}}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="menu">
|
<div class="menu">
|
||||||
<div class="menu-inner">
|
<div class="menu-inner">
|
||||||
{{- range .Site.Menus.main -}}
|
{{- 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 -}}
|
{{- .Pre | safeHTML }}{{ .Name -}}
|
||||||
</a>
|
</a>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
@@ -61,7 +67,7 @@
|
|||||||
<div class="header-container">
|
<div class="header-container">
|
||||||
<div class="header-wrapper">
|
<div class="header-wrapper">
|
||||||
<div class="header-title">
|
<div class="header-title">
|
||||||
<a href="{{ `/` | relLangURL }}">
|
<a href="{{ .Site.Home.RelPermalink }}">
|
||||||
{{- .Site.Title -}}
|
{{- .Site.Title -}}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -91,7 +97,13 @@
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- $currentPage := . -}}
|
{{- $currentPage := . -}}
|
||||||
{{- range .Site.Menus.main -}}
|
{{- 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 -}}
|
{{- .Pre | safeHTML }}{{ .Name -}}
|
||||||
</a>
|
</a>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|||||||
@@ -2,15 +2,15 @@
|
|||||||
{{- $loading := resources.Get "svg/loading/normal.svg" | minify -}}
|
{{- $loading := resources.Get "svg/loading/normal.svg" | minify -}}
|
||||||
{{- $small := .src_s | default .src -}}
|
{{- $small := .src_s | default .src -}}
|
||||||
{{- $large := .src_l | default .src -}}
|
{{- $large := .src_l | default .src -}}
|
||||||
{{- $alt := .alt | default .src -}}
|
{{- $alt := .alt | default (relURL .src) -}}
|
||||||
{{- if .linked -}}
|
{{- 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
|
<img
|
||||||
class="lazyload"
|
class="lazyload"
|
||||||
src="{{ $loading.RelPermalink | safeURL }}"
|
src="{{ $loading.RelPermalink }}"
|
||||||
data-sizes="auto"
|
data-sizes="auto"
|
||||||
data-srcset="{{ $small | safeURL }}, {{ .src | safeURL }} 1.5x, {{ $large | safeURL }} 2x"
|
data-srcset="{{ $small | relURL }}, {{ .src | relURL }} 1.5x, {{ $large | relURL }} 2x"
|
||||||
data-src="{{ .src | safeURL }}"
|
data-src="{{ .src | relURL }}"
|
||||||
alt="{{ $alt }}"{{ with .height }} height="{{ . }}"{{ end }}{{ with .width }} width="{{ . }}"{{ end }} />
|
alt="{{ $alt }}"{{ with .height }} height="{{ . }}"{{ end }}{{ with .width }} width="{{ . }}"{{ end }} />
|
||||||
</a>
|
</a>
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
@@ -21,8 +21,8 @@
|
|||||||
class="lazyload"
|
class="lazyload"
|
||||||
src="{{ $loading.RelPermalink | safeURL }}"
|
src="{{ $loading.RelPermalink | safeURL }}"
|
||||||
data-sizes="auto"
|
data-sizes="auto"
|
||||||
data-srcset="{{ $small | safeURL }}, {{ .src | safeURL }} 1.5x, {{ $large | safeURL }} 2x"
|
data-srcset="{{ $small | relURL }}, {{ .src | relURL }} 1.5x, {{ $large | relURL }} 2x"
|
||||||
data-src="{{ .src | safeURL }}"
|
data-src="{{ .src | relURL }}"
|
||||||
alt="{{ $alt }}"
|
alt="{{ $alt }}"
|
||||||
title="{{ .title | default $alt }}"{{ with .height }} height="{{ . }}"{{ end }}{{ with .width }} width="{{ . }}"{{ end }} />
|
title="{{ .title | default $alt }}"{{ with .height }} height="{{ . }}"{{ end }}{{ with .width }} width="{{ . }}"{{ end }} />
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{{- $rel := "" -}}
|
{{- $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 -}}
|
{{- with .icon -}}
|
||||||
{{- partial "plugin/icon.html" . -}}
|
{{- partial "plugin/icon.html" . -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- $src := .source -}}
|
{{- $src := .source -}}
|
||||||
{{- $integrity := .integrity -}}
|
{{- $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 -}}
|
{{- $res := resources.Get $src -}}
|
||||||
{{- with .template -}}
|
{{- with .template -}}
|
||||||
{{- $res = $res | resources.ExecuteAsTemplate . $.context -}}
|
{{- $res = $res | resources.ExecuteAsTemplate . $.context -}}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
</section>
|
</section>
|
||||||
<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>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
<div class="post-meta">
|
<div class="post-meta">
|
||||||
<div class="post-meta-line">
|
<div class="post-meta-line">
|
||||||
{{- $author := $params.author | default .Site.Author.name | default (T "author") -}}
|
{{- $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">
|
<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 -}}
|
{{- $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 -}}
|
{{- partial "plugin/link.html" $options -}}
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
<i class="far fa-clock fa-fw"></i>{{ T "readingTime" .ReadingTime }}
|
<i class="far fa-clock fa-fw"></i>{{ T "readingTime" .ReadingTime }}
|
||||||
{{- $comment := .Scratch.Get "comment" | default dict -}}
|
{{- $comment := .Scratch.Get "comment" | default dict -}}
|
||||||
{{- if $comment.enable | and $comment.valine.enable | and $comment.valine.visitor -}}
|
{{- 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" }}
|
<i class="far fa-eye fa-fw"></i><span class=leancloud-visitors-count></span> {{ T "views" }}
|
||||||
</span>
|
</span>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|||||||
@@ -61,4 +61,4 @@ Disallow: /
|
|||||||
User-agent: ZoominfoBot
|
User-agent: ZoominfoBot
|
||||||
Disallow: /
|
Disallow: /
|
||||||
|
|
||||||
Sitemap: {{ "sitemap.xml" | absLangURL }}
|
Sitemap: {{ "/sitemap.xml" | absLangURL }}
|
||||||
|
|||||||
Reference in New Issue
Block a user