💄 Support more of analytics engine such as baidu, google, busuanzi and so on, then add new web information widget. close #19

This commit is contained in:
凡梦星尘
2022-09-11 18:33:41 +08:00
parent c38a439171
commit 2a7fd9f8fb
21 changed files with 197 additions and 86 deletions

View File

@@ -1,3 +1,12 @@
{{- if isset .Site.Params.analytics "laid" }}
{{ partial "_thirdparty/analytics/51la.html" . }}
{{- end }}
{{- if isset .Site.Params.analytics "baidu" }}
{{ partial "_thirdparty/analytics/baidu.html" . }}
{{- end }}
{{- if isset .Site.Params.analytics "google" }}
{{ partial "_thirdparty/analytics/google.html" . }}
{{- end }}
{{- if isset .Site.Params.analytics "busuanzi" }}
{{ partial "_thirdparty/analytics/busuanzi.html" . }}
{{- end }}

View File

@@ -1,19 +0,0 @@
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/animate.css/3.1.1/animate.min.css">
<!-- NexT theme css style -->
{{- $scssVars := resources.Get "css/_sitevars.scss"}}
{{- $scssVars = $scssVars | resources.ExecuteAsTemplate "sitevars.scss" . }}
{{- $scssMain := resources.Get "css/main.scss" }}
{{- $scss := slice $scssVars $scssMain | resources.Concat "css/main.scss" }}
{{- $css := $scss | toCSS (dict "targetPath" "/css/main_new.css" "outputStyle" "expanded") }}
<link rel="stylesheet" href="{{ $css.RelPermalink }}">
{{- $scheme := lower .Site.Params.scheme }}
{{- $styleScheme := (printf "css/%s/style.css" $scheme) }}
<link rel="stylesheet" href="/css/{{ $scheme }}/main.css">
{{- $style := resources.Get $styleScheme | resources.ExecuteAsTemplate $styleScheme . }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
<link rel="stylesheet" href="/css/hover.css">

View File

@@ -2,19 +2,10 @@
{{- $cssRes := .Site.Data.resources.css }}
{{- $vendor := .Site.Params.vendors.plugins }}
{{- $router := .Scratch.Get "router" }}
{{ $cssFmt := "%s/%s@%s/%s" }}
{{- range $css := $cssRes }}
{{- $npm := $css.name }}
{{- $file := $css.file }}
{{- if eq $vendor "cdnjs" }}
{{- with $css.alias }}
{{- $npm = . }}
{{- end }}
{{- $file = replaceRE `(dist|lib|source\/js)\/` "" $css.file }}
{{- $cssFmt = "%s/%s/%s/%s" }}
{{- end }}
{{- $pluginCSS := printf $cssFmt $router $npm $css.version $file }}
<link type="text/css" rel="stylesheet" href="{{ $pluginCSS }}" />
{{ $pluginCss := partial "_funs/get_res.html" (dict "res" . "vendor" $vendor "router" $router) }}
<link type="text/css" rel="stylesheet" href="{{ $pluginCss }}" />
{{- end }}
<!-- Main Style file -->