Merge pull request #56 from dongorgan/main

Remove `.Site.BaseURL`
This commit is contained in:
Somrat 2023-11-13 08:46:41 +06:00 committed by GitHub
commit fef42e15aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 8 deletions

View File

@ -1,13 +1,13 @@
{{ $context := .Context }} {{ $context := .Context }}
{{ $class := .Class }} {{ $class := .Class }}
{{ $base := site.BaseURL }} {{ $base := site.Home.Permalink }}
<ul class="{{ $class }} inline-flex space-x-1 capitalize"> <ul class="{{ $class }} inline-flex space-x-1 capitalize">
<li> <li>
<a <a
class="text-primary dark:text-darkmode-primary" class="text-primary dark:text-darkmode-primary"
href="{{ $base | relLangURL }}"> href="{{ $base }}">
{{ i18n "home" | default "Home" }} {{ i18n "home" | default "Home" }}
</a> </a>
<span class="inlin-block mr-1">/</span> <span class="inlin-block mr-1">/</span>

View File

@ -2,7 +2,7 @@
{{ $class := .Class }} {{ $class := .Class }}
{{ $context := .Context }} {{ $context := .Context }}
{{ $pageLang := $context.Lang }} {{ $pageLang := $context.Lang }}
{{ $base:= urls.Parse site.BaseURL }} {{ $base:= urls.Parse site.Home.Permalink }}
{{ $siteLanguages := site.Home.AllTranslations }} {{ $siteLanguages := site.Home.AllTranslations }}
{{ $pageLink := replace (replace $context.RelPermalink (add $pageLang "/") "") $base.Path "/" }} {{ $pageLink := replace (replace $context.RelPermalink (add $pageLang "/") "") $base.Path "/" }}

View File

@ -5,7 +5,7 @@
<!-- navbar brand/logo --> <!-- navbar brand/logo -->
<a <a
class="navbar-brand inline-block" class="navbar-brand inline-block"
href="{{ site.BaseURL | relLangURL }}"> href="{{ site.Home.RelPermalink }}">
{{ partial "logo" }} {{ partial "logo" }}
</a> </a>
</div> </div>
@ -19,7 +19,7 @@
{{ end }} {{ end }}
href="{{ if findRE `^#` .URL }} href="{{ if findRE `^#` .URL }}
{{ if not $.IsHome }} {{ if not $.IsHome }}
{{ site.BaseURL | relLangURL }} {{ site.Home.RelPermalink }}
{{ end }}{{ .URL }} {{ end }}{{ .URL }}
{{ else }} {{ else }}
{{ .URL | relLangURL }} {{ .URL | relLangURL }}

View File

@ -4,7 +4,7 @@
<!-- logo --> <!-- logo -->
<div class="order-0"> <div class="order-0">
<!-- navbar brand/logo --> <!-- navbar brand/logo -->
<a class="navbar-brand block" href="{{ site.BaseURL | relLangURL }}"> <a class="navbar-brand block" href="{{ site.Home.RelPermalink }}">
{{ partial "logo" }} {{ partial "logo" }}
</a> </a>
</div> </div>
@ -64,7 +64,7 @@
{{ end }} {{ end }}
href="{{- if findRE `^#` .URL -}} href="{{- if findRE `^#` .URL -}}
{{- if not $.IsHome -}} {{- if not $.IsHome -}}
{{- site.BaseURL | relLangURL -}} {{- site.Home.RelPermalink -}}
{{- end }} {{- end }}
{{- .URL -}} {{- .URL -}}
{{- else -}} {{- else -}}
@ -85,7 +85,7 @@
{{ end }} {{ end }}
href="{{- if findRE `^#` .URL -}} href="{{- if findRE `^#` .URL -}}
{{- if not $.IsHome -}} {{- if not $.IsHome -}}
{{- site.BaseURL | relLangURL -}} {{- site.Home.RelPermalink -}}
{{- end }}{{- .URL -}} {{- end }}{{- .URL -}}
{{- else -}} {{- else -}}
{{- .URL | relLangURL -}} {{- .URL | relLangURL -}}