mirror of https://github.com/jpanther/congo.git
🎨 Code cleanup
parent
4c8e536b64
commit
6415614513
|
@ -1,7 +1,7 @@
|
|||
i18n:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: i18n/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: i18n/*
|
||||
|
||||
documentation:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: '**/*.md'
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: "**/*.md"
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
/assets/css/compiled/
|
||||
/assets/lib/
|
||||
|
||||
/layouts/_default/_markup/*.html
|
||||
/layouts/shortcodes/figure.html
|
||||
/layouts/shortcodes/screenshot.html
|
||||
|
||||
/exampleSite/content/docs/version-2/lighthouse.html
|
|
@ -9,7 +9,7 @@
|
|||
"trailingComma": "es5",
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.html"],
|
||||
"files": ["*.html", "layouts/_default/*.json"],
|
||||
"options": {
|
||||
"parser": "go-template"
|
||||
}
|
||||
|
|
|
@ -2,5 +2,5 @@
|
|||
Closes the hamburger menu when a link is clicked.
|
||||
*/
|
||||
function close_menu() {
|
||||
document.getElementById('menu-controller').checked=false
|
||||
document.getElementById("menu-controller").checked = false;
|
||||
}
|
|
@ -1,4 +1,3 @@
|
|||
window.addEventListener("load", () => {
|
||||
quicklink.listen();
|
||||
});
|
||||
|
||||
|
|
|
@ -133,6 +133,7 @@ function executeQuery(term) {
|
|||
let resultsHTML = "";
|
||||
|
||||
if (results.length > 0) {
|
||||
// prettier-ignore
|
||||
resultsHTML = results.map(function (value, key) {
|
||||
return `<li class="mb-2">
|
||||
<a class="flex items-center px-3 py-2 rounded-md appearance-none bg-neutral-100 dark:bg-neutral-700 focus:bg-primary-100 hover:bg-primary-100 dark:hover:bg-primary-900 dark:focus:bg-primary-900 focus:outline-dotted focus:outline-transparent focus:outline-2" href="${value.item.permalink}" tabindex="0">
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
},
|
||||
"weibo": {
|
||||
"icon": "weibo",
|
||||
"title":"sharing.weibo",
|
||||
"title": "sharing.weibo",
|
||||
"url": "https://service.weibo.com/share/share.php?url=%s&appkey=&title=%s&pic=&ralateUid=&lang"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ tags: ["content", "example"]
|
|||
|
||||
## ブランチページ
|
||||
|
||||
Hugoのブランチページバンドルは、ホームページ、セクションリスト、Taxonomyページのような項目をカバーしています。ブランチバンドルについて覚えておくべき重要なことは、このコンテンツタイプのファイル名は **_index.md`** であるということです。
|
||||
Hugoのブランチページバンドルは、ホームページ、セクションリスト、Taxonomyページのような項目をカバーしています。ブランチバンドルについて覚えておくべき重要なことは、このコンテンツタイプのファイル名は **`_index.md`** であるということです。
|
||||
|
||||
Congoはブランチページで指定されたフロントマターを尊重し、デフォルト設定を上書きします。例えば、ブランチページで `title` パラメーターを設定すると、ページタイトルを上書きすることができます。
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ Congoは、テーマ全体で使用される3色のパレットを定義して
|
|||
|
||||
## コンテンツの整理
|
||||
|
||||
Congoは特定のコンテンツタイプを強制しません。そのため、自由にコンテンツを定義することができます。静的なサイトには_pages_、ブログには_posts_、ポートフォリオには_projects_がいいかもしれません。
|
||||
Congoは特定のコンテンツタイプを強制しません。そのため、自由にコンテンツを定義することができます。静的なサイトには*pages*、ブログには*posts*、ポートフォリオには*projects*がいいかもしれません。
|
||||
|
||||
### ディレクトリ構造
|
||||
|
||||
|
|
|
@ -195,5 +195,4 @@ Congo 2.0では `figure` ショートコードの振る舞いが変わります
|
|||
|
||||
エラーに遭遇した場合は、設定が正しいことを確認し、[ドキュメント]({{<ref "docs" >}})を参照してください。テーマに同梱されている設定ファイルの例には、デフォルトのパラメーターがすべて含まれており、出発点として最適です。
|
||||
|
||||
|
||||
🙋♀️ それでもまだ助けが必要な場合は、[GitHub Discussions](https://github.com/jpanther/congo/discussions)で遠慮なく質問してください。
|
||||
🙋♀️ それでもまだ助けが必要な場合は、[GitHub Discussions](https://github.com/jpanther/congo/discussions)で遠慮なく質問してください。
|
||||
|
|
|
@ -67,7 +67,7 @@ Tabellen sind nicht Teil der Markdown-Kernspezifikation, aber Hugo unterstützt
|
|||
### Code-Block mit backticks
|
||||
|
||||
```html
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
@ -134,7 +134,7 @@ Tabellen sind nicht Teil der Markdown-Kernspezifikation, aber Hugo unterstützt
|
|||
|
||||
## Andere Elemente — abbr, sub, sup, kbd, mark
|
||||
|
||||
<abbr title="Graphics Interchange Format">GIF</abbr> ist ein Bitmap-Bildformat.
|
||||
<abbr title="Graphics Interchange Format">GIF</abbr> ist ein Bitmap-Bildformat.
|
||||
|
||||
H<sub>2</sub>O
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ Las tablas no forman parte de la especificación principal de Markdown, pero Hug
|
|||
### Markdown dentro de las tablas
|
||||
|
||||
| Cursiva | Negritas | Código |
|
||||
| --------- | ---------- | -------- |
|
||||
| --------- | ----------- | -------- |
|
||||
| _Cursiva_ | **Negrita** | `Código` |
|
||||
|
||||
## Bloques de código
|
||||
|
@ -67,7 +67,7 @@ Las tablas no forman parte de la especificación principal de Markdown, pero Hug
|
|||
### Bloque de código con acentos graves
|
||||
|
||||
```html
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
|
|
@ -52,9 +52,9 @@ Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sap
|
|||
表はMarkdownのコア仕様には含まれていませんが、Hugoはサポートしています。
|
||||
|
||||
| 名前 | 年齢 |
|
||||
| ----- | --- |
|
||||
| Bob | 27 |
|
||||
| Alice | 23 |
|
||||
| ----- | ---- |
|
||||
| Bob | 27 |
|
||||
| Alice | 23 |
|
||||
|
||||
### 表中のMarkdown
|
||||
|
||||
|
@ -67,7 +67,7 @@ Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sap
|
|||
### Code block with backticks
|
||||
|
||||
```html
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
|
|
@ -67,7 +67,7 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou
|
|||
### Code block with backticks
|
||||
|
||||
```html
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
|
|
@ -44,7 +44,7 @@ La lista a continuación es solo un puñado de sitios web creados con el tema Co
|
|||
| [medical-humanities](https://medical-humanities.org) | Academic site |
|
||||
| [boyersnet.com](https://boyersnet.com) | Personal site and Blog |
|
||||
| [major.io](https://major.io) | Personal site and Blog |
|
||||
| [顾宇的博客](https://www.guyu.me/) | Personal Blog (in Chinese) |
|
||||
| [顾宇的博客](https://www.guyu.me/) | Personal Blog (in Chinese) |
|
||||
| [cgutierr-zgz.github.io](https://cgutierr-zgz.github.io/) | Personal site and Tech blog |
|
||||
| [adam.sr](https://adam.sr) | Personal site and Blog |
|
||||
| [kpavlov.me](https://kpavlov.me) | Personal site and Blog |
|
||||
|
|
|
@ -44,7 +44,7 @@ Congoを使用して構築された実際のウェブサイト。
|
|||
| [medical-humanities](https://medical-humanities.org) | Academic site |
|
||||
| [boyersnet.com](https://boyersnet.com) | Personal site and Blog |
|
||||
| [major.io](https://major.io) | Personal site and Blog |
|
||||
| [顾宇的博客](https://www.guyu.me/) | Personal Blog (in Chinese) |
|
||||
| [顾宇的博客](https://www.guyu.me/) | Personal Blog (in Chinese) |
|
||||
| [cgutierr-zgz.github.io](https://cgutierr-zgz.github.io/) | Personal site and Tech blog |
|
||||
| [adam.sr](https://adam.sr) | Personal site and Blog |
|
||||
| [kpavlov.me](https://kpavlov.me) | Personal site and Blog |
|
||||
|
|
|
@ -44,7 +44,7 @@ The list below is just a handful of the websites that are built using the Congo
|
|||
| [medical-humanities](https://medical-humanities.org) | Academic site |
|
||||
| [boyersnet.com](https://boyersnet.com) | Personal site and Blog |
|
||||
| [major.io](https://major.io) | Personal site and Blog |
|
||||
| [顾宇的博客](https://www.guyu.me/) | Personal Blog (in Chinese) |
|
||||
| [顾宇的博客](https://www.guyu.me/) | Personal Blog (in Chinese) |
|
||||
| [cgutierr-zgz.github.io](https://cgutierr-zgz.github.io/) | Personal site and Tech blog |
|
||||
| [adam.sr](https://adam.sr) | Personal site and Blog |
|
||||
| [kpavlov.me](https://kpavlov.me) | Personal site and Blog |
|
||||
|
|
|
@ -5,4 +5,9 @@
|
|||
<div id="profile" class="hidden h-full">
|
||||
{{ partial "partials/home/profile.html" . }}
|
||||
</div>
|
||||
<script defer type="text/javascript" src="{{ $jsHome.RelPermalink }}" integrity="{{ $jsHome.Data.Integrity }}"></script>
|
||||
<script
|
||||
defer
|
||||
type="text/javascript"
|
||||
src="{{ $jsHome.RelPermalink }}"
|
||||
integrity="{{ $jsHome.Data.Integrity }}"
|
||||
></script>
|
||||
|
|
|
@ -53,7 +53,7 @@ sharing:
|
|||
twitter: "Tweet na Twitter"
|
||||
telegram: "Sdílejte na Telegram"
|
||||
line: "Sdílejte na LINE"
|
||||
line: "Sdílejte na Weibo"
|
||||
weibo: "Sdílejte na Weibo"
|
||||
|
||||
shortcode:
|
||||
recent_articles: "Nedávné"
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
{{ $file := $url.Path }}
|
||||
{{ $img := .Page.Resources.GetMatch $file }}
|
||||
{{- if and (not $img) .Page.File }}
|
||||
{{ $path := path.Join .Page.File.Dir $file }}
|
||||
{{ $img = resources.Get $path }}
|
||||
{{ $path := path.Join .Page.File.Dir $file }}
|
||||
{{ $img = resources.Get $path }}
|
||||
{{ end -}}
|
||||
|
||||
{{/* https://github.com/gohugoio/hugo/pull/10666 */}}
|
||||
|
@ -15,14 +15,14 @@
|
|||
{{- $x2Param := $params.Get "2x" -}}
|
||||
{{- $x2 := false -}}
|
||||
{{- if eq $x2Param "true" -}}
|
||||
{{- $x2 = true -}}
|
||||
{{- $x2 = true -}}
|
||||
{{- end -}}
|
||||
|
||||
<figure>
|
||||
{{- with $img -}}
|
||||
{{ partial "picture.html" (dict "img" . "alt" $altText "class" $class "x2" $x2) }}
|
||||
{{- else -}}
|
||||
<img src="{{ .Destination | safeURL }}" alt="{{ $altText }}" class="{{ $class }}"/>
|
||||
<img src="{{ .Destination | safeURL }}" alt="{{ $altText }}" class="{{ $class }}" />
|
||||
{{- end -}}
|
||||
{{ with $caption }}<figcaption class="text-center">{{ . | markdownify }}</figcaption>{{ end }}
|
||||
</figure>
|
||||
|
|
|
@ -14,4 +14,5 @@
|
|||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
<!-- prettier-ignore -->
|
||||
<a href="{{ $link | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }}{{ if $isRemote }} target="_blank" rel="noreferrer"{{ end }}>{{- .Text | safeHTML -}}</a>
|
|
@ -1,6 +1,6 @@
|
|||
{{- partial "partials/functions/warnings.html" .Site -}}
|
||||
{{- partial "partials/functions/init.html" . -}}
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html
|
||||
lang="{{- site.Language.LanguageCode | default "" -}}"
|
||||
dir="{{- site.Language.LanguageDirection | default "ltr" -}}"
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
"summary" (.Summary | emojify | safeJS)
|
||||
"content" (.Plain | emojify | safeJS)
|
||||
"permalink" .RelPermalink
|
||||
) -}}
|
||||
)
|
||||
-}}
|
||||
{{- end -}}
|
||||
{{- $index | jsonify -}}
|
||||
|
|
|
@ -3,10 +3,12 @@
|
|||
<script defer src="https://cdn.usefathom.com/script.js" data-site="{{ . }}"></script>
|
||||
{{ end }}
|
||||
{{ with site.Params.plausibleAnalytics.domain }}
|
||||
<script defer
|
||||
<script
|
||||
defer
|
||||
data-domain="{{ . }}"
|
||||
data-api="{{ default "https://plausible.io/api/event" site.Params.plausibleAnalytics.event }}"
|
||||
src="{{ default "https://plausible.io/js/script.js" site.Params.plausibleAnalytics.script }}"></script>
|
||||
src="{{ default "https://plausible.io/js/script.js" site.Params.plausibleAnalytics.script }}"
|
||||
></script>
|
||||
{{ end }}
|
||||
{{ template "_internal/google_analytics.html" . }}
|
||||
{{ end }}
|
|
@ -1,4 +1,4 @@
|
|||
<article class="mt-6 flex max-w-prose flex-row">
|
||||
<article class="flex flex-row mt-6 max-w-prose">
|
||||
{{- $images := $.Resources.ByType "image" }}
|
||||
{{- $thumbnail := $images.GetMatch (.Params.thumbnail | default "*thumb*") }}
|
||||
{{- $feature := $images.GetMatch (.Params.feature | default "*feature*") | default $thumbnail }}
|
||||
|
@ -21,9 +21,7 @@
|
|||
class="w-24 rounded-md sm:w-40" srcset="
|
||||
{{- (.Fill "160x120 smart").RelPermalink }}
|
||||
160w, {{- (.Fill "320x240 smart").RelPermalink }} 2x"
|
||||
src="{{ (.Fill "160x120 smart").RelPermalink }}"
|
||||
width="160"
|
||||
height="120"
|
||||
src="{{ (.Fill "160x120 smart").RelPermalink }}" width="160" height="120"
|
||||
{{ end }}
|
||||
{{ if $.Site.Params.enableImageLazyLoading | default true }}
|
||||
loading="lazy"
|
||||
|
@ -44,7 +42,7 @@
|
|||
>{{ $.Title | emojify }}</a
|
||||
>
|
||||
<span
|
||||
class="cursor-default align-top text-xs text-neutral-400 dark:text-neutral-500"
|
||||
class="text-xs align-top cursor-default text-neutral-400 dark:text-neutral-500"
|
||||
title="{{ i18n "list.externalurl_title" }}"
|
||||
>
|
||||
<span class="rtl:hidden">↗</span>
|
||||
|
@ -71,7 +69,7 @@
|
|||
{{ partial "article-meta.html" . }}
|
||||
</div>
|
||||
{{ if .Params.showSummary | default (.Site.Params.list.showSummary | default false) }}
|
||||
<div class="prose py-1 dark:prose-invert">
|
||||
<div class="py-1 prose dark:prose-invert">
|
||||
{{ .Summary | emojify }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
(and (ne $scope "single") (.Params.showTaxonomies | default (.Site.Params.list.showTaxonomies | default (.Site.Params.article.showTaxonomies | default false))))
|
||||
(and (eq $scope "single") (.Params.showTaxonomies | default (.Site.Params.article.showTaxonomies | default false)))
|
||||
}}
|
||||
<div class="flex flex-wrap my-1 text-xs leading-relaxed text-neutral-500 dark:text-neutral-400 ">
|
||||
<div class="flex flex-wrap my-1 text-xs leading-relaxed text-neutral-500 dark:text-neutral-400">
|
||||
{{ range $taxonomy, $terms := .Site.Taxonomies }}
|
||||
{{ if (gt (len ($context.GetTerms $taxonomy)) 0) }}
|
||||
{{ range $context.GetTerms $taxonomy }}
|
||||
|
|
|
@ -7,18 +7,19 @@
|
|||
src="{{ $logo.RelPermalink }}"
|
||||
width="{{ div $logo.Width 2 }}"
|
||||
height="{{ div $logo.Height 2 }}"
|
||||
class="max-h-[10rem] max-w-[10rem] object-scale-down object-left{{ if $logo_dark }} hidden dark:flex{{ end }}"
|
||||
class="max-h-[10rem] max-w-[10rem] object-scale-down object-left
|
||||
{{ if $logo_dark }}hidden dark:flex{{ end }}"
|
||||
alt="{{ .Site.Title }}"
|
||||
/>
|
||||
{{- if $logo_dark }}
|
||||
<img
|
||||
src="{{ $logo_dark.RelPermalink }}"
|
||||
width="{{ div $logo_dark.Width 2 }}"
|
||||
height="{{ div $logo_dark.Height 2 }}"
|
||||
class="max-h-[10rem] max-w-[10rem] object-scale-down object-left dark:hidden"
|
||||
alt="{{ .Site.Title }}"
|
||||
/>
|
||||
{{- end}}
|
||||
<img
|
||||
src="{{ $logo_dark.RelPermalink }}"
|
||||
width="{{ div $logo_dark.Width 2 }}"
|
||||
height="{{ div $logo_dark.Height 2 }}"
|
||||
class="max-h-[10rem] max-w-[10rem] object-scale-down object-left dark:hidden"
|
||||
alt="{{ .Site.Title }}"
|
||||
/>
|
||||
{{- end }}
|
||||
</a>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
{{- if gt .TotalPages 1 }}
|
||||
{{- $start := math.Max 1 (sub .PageNumber $width) }}
|
||||
{{- $end := math.Min .TotalPages (add $start (mul $width 2)) }}
|
||||
|
||||
<ul class="flex flex-row mt-8">
|
||||
{{- with .Prev }}
|
||||
<li>
|
||||
|
@ -18,7 +17,6 @@
|
|||
</a>
|
||||
</li>
|
||||
{{- end }}
|
||||
|
||||
{{- with .First }}
|
||||
{{- if gt $currentPageNumber (add 1 $width) }}
|
||||
<li class="mx-1 min-w-[1.8rem] text-center">
|
||||
|
@ -35,7 +33,6 @@
|
|||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- range $i := seq $start $end }}
|
||||
<li class="mx-1 min-w-[1.8rem] text-center">
|
||||
{{- if eq $.Paginator.PageNumber $i }}
|
||||
|
@ -57,7 +54,6 @@
|
|||
{{- end }}
|
||||
</li>
|
||||
{{- end }}
|
||||
|
||||
{{- with .Last }}
|
||||
{{- if and (lt $currentPageNumber (sub .TotalPages $width)) (lt $end .TotalPages) }}
|
||||
{{- if lt $currentPageNumber (sub .TotalPages (add $width 1)) }}
|
||||
|
@ -74,7 +70,6 @@
|
|||
</li>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- with .Next }}
|
||||
<li>
|
||||
<a
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
|
||||
{{ with $img }}
|
||||
{{ if (eq .MediaType.SubType "svg") }}
|
||||
{{ $width := ""}}
|
||||
{{ $height := ""}}
|
||||
{{ $width := "" }}
|
||||
{{ $height := "" }}
|
||||
{{ $svgContent := .Content }}
|
||||
{{ range (findRESubmatch `<svg[^>]*width=["']([.0-9]*)["'a-zA-Z]` $svgContent 1) }}
|
||||
{{ $width = index . 1 }}
|
||||
|
@ -28,39 +28,39 @@
|
|||
{{/* do not use lazy without dimensions */}}
|
||||
{{ $lazy = false }}
|
||||
{{ end }}
|
||||
<!-- prettier-ignore -->
|
||||
<picture {{ with $class }} class="{{ . }}" {{ end }}>
|
||||
<img
|
||||
src="{{ .RelPermalink }}"
|
||||
{{ with $width }} width="{{ . }}" {{ end }}
|
||||
{{ with $height }} height="{{ . }}" {{ end }}
|
||||
{{ with $class }} class="{{ . }}" {{ end }}
|
||||
{{ with $alt }} alt="{{ . }}" {{ end }}
|
||||
{{ with $lazy }} loading="lazy" decoding="async" {{ end }}
|
||||
>
|
||||
{{ with $width }}width="{{ . }}"{{ end }}
|
||||
{{ with $height }}height="{{ . }}"{{ end }}
|
||||
{{ with $class }}class="{{ . }}"{{ end }}
|
||||
{{ with $alt }}alt="{{ . }}"{{ end }}
|
||||
{{ with $lazy }}loading="lazy" decoding="async"{{ end }}
|
||||
/>
|
||||
</picture>
|
||||
{{ else }}
|
||||
<picture
|
||||
{{ with $class }} class="{{ . }}" {{ end }}
|
||||
{{ with $class }}class="{{ . }}"{{ end }}
|
||||
{{ if $lqip }}
|
||||
{{ $bg := (.Resize "20x webp q20").Content | base64Encode }}
|
||||
style="background-image:url(data:image/webp;base64,{{ $bg }});background-size:cover"
|
||||
{{ end }}
|
||||
>
|
||||
{{ $width := .Width }}
|
||||
{{ $height := .Height }}
|
||||
{{ if $x2 }}
|
||||
{{ $width = div .Width 2 }}
|
||||
{{ $height = div .Height 2 }}
|
||||
{{ end }}
|
||||
{{ if $webp }}
|
||||
<source
|
||||
{{ if lt .Width 660 }}
|
||||
{{ with .Resize (printf "%dx%d webp" .Width .Height) }}
|
||||
src="{{ .RelPermalink }}"
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
srcset="
|
||||
{{- (.Resize "330x webp").RelPermalink }} 330w,
|
||||
{{ $width := .Width }}
|
||||
{{ $height := .Height }}
|
||||
{{ if $x2 }}
|
||||
{{ $width = div .Width 2 }}
|
||||
{{ $height = div .Height 2 }}
|
||||
{{ end }}
|
||||
{{ if $webp }}
|
||||
<source
|
||||
{{ if lt .Width 660 }}
|
||||
{{ with .Resize (printf "%dx%d webp" .Width .Height) }}
|
||||
src="{{ .RelPermalink }}"
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
srcset=" {{- (.Resize "330x webp").RelPermalink }} 330w,
|
||||
{{- (.Resize "660x webp").RelPermalink }} 660w
|
||||
{{ if gt .Width 1024 }}
|
||||
,{{ (.Resize "1024x webp").RelPermalink }} 1024w
|
||||
|
@ -76,24 +76,24 @@
|
|||
,{{ .RelPermalink }} {{ .Width }}w
|
||||
{{ end }}
|
||||
{{ end }}"
|
||||
src="{{ (.Resize "660x webp").RelPermalink }}"
|
||||
{{ end }}
|
||||
type="image/webp"
|
||||
/>
|
||||
{{ end }}
|
||||
src="{{ (.Resize "660x webp").RelPermalink }}"
|
||||
{{ end }}
|
||||
type="image/webp"
|
||||
/>
|
||||
{{ end }}
|
||||
<img
|
||||
src="{{ .RelPermalink }}"
|
||||
width="{{ $width }}"
|
||||
height="{{ $height }}"
|
||||
{{ with $class }} class="{{ . }}" {{ end }}
|
||||
{{ with $alt }} alt="{{ . }}" {{ end }}
|
||||
{{ with $lazy }} loading="lazy" decoding="async" {{ end }}
|
||||
{{ with $class }}class="{{ . }}"{{ end }}
|
||||
{{ with $alt }}alt="{{ . }}"{{ end }}
|
||||
{{ with $lazy }}loading="lazy" decoding="async"{{ end }}
|
||||
{{ if lt .Width 660 }}
|
||||
src="{{ .RelPermalink }}"
|
||||
{{ else }}
|
||||
srcset="
|
||||
{{- (.Resize "330x").RelPermalink }} 330w,
|
||||
{{- (.Resize "660x").RelPermalink }} 660w
|
||||
srcset=" {{- (.Resize "330x").RelPermalink }} 330w,
|
||||
{{- (.Resize "660x").RelPermalink }}
|
||||
660w
|
||||
{{ if gt .Width 1024 }}
|
||||
,{{ (.Resize "1024x").RelPermalink }} 1024w
|
||||
{{ else }}
|
||||
|
@ -106,7 +106,7 @@
|
|||
{{ end }}"
|
||||
src="{{ (.Resize "660x").RelPermalink }}"
|
||||
{{ end }}
|
||||
>
|
||||
/>
|
||||
</picture>
|
||||
{{ end }}
|
||||
{{ end }}
|
|
@ -4,7 +4,12 @@
|
|||
{{ $mermaidConfig := resources.Get "js/mermaid.js" }}
|
||||
{{ $mermaidConfig := $mermaidConfig | resources.Minify }}
|
||||
{{ $mermaidJS := slice $mermaidLib $mermaidConfig | resources.Concat "js/mermaid.bundle.js" | resources.Fingerprint "sha512" }}
|
||||
<script defer type="text/javascript" src="{{ $mermaidJS.RelPermalink }}" integrity="{{ $mermaidJS.Data.Integrity }}"></script>
|
||||
<script
|
||||
defer
|
||||
type="text/javascript"
|
||||
src="{{ $mermaidJS.RelPermalink }}"
|
||||
integrity="{{ $mermaidJS.Data.Integrity }}"
|
||||
></script>
|
||||
{{ end }}
|
||||
{{/* Chart */}}
|
||||
{{ if .Page.HasShortcode "chart" }}
|
||||
|
@ -12,23 +17,38 @@
|
|||
{{ $chartConfig := resources.Get "js/chart.js" }}
|
||||
{{ $chartConfig := $chartConfig | resources.Minify }}
|
||||
{{ $chartJS := slice $chartLib $chartConfig | resources.Concat "js/chart.bundle.js" | resources.Fingerprint "sha512" }}
|
||||
<script defer type="text/javascript" src="{{ $chartJS.RelPermalink }}" integrity="{{ $chartJS.Data.Integrity }}"></script>
|
||||
<script
|
||||
defer
|
||||
type="text/javascript"
|
||||
src="{{ $chartJS.RelPermalink }}"
|
||||
integrity="{{ $chartJS.Data.Integrity }}"
|
||||
></script>
|
||||
{{ end }}
|
||||
{{/* Katex */}}
|
||||
{{ if .Page.HasShortcode "katex" }}
|
||||
{{ $katexCSS := resources.Get "lib/katex/katex.min.css" }}
|
||||
{{ $katexCSS := $katexCSS | resources.Fingerprint "sha512" }}
|
||||
<link
|
||||
type="text/css" rel="stylesheet"
|
||||
type="text/css"
|
||||
rel="stylesheet"
|
||||
href="{{ $katexCSS.RelPermalink }}"
|
||||
integrity="{{ $katexCSS.Data.Integrity }}"
|
||||
/>
|
||||
{{ $katexJS := resources.Get "lib/katex/katex.min.js" }}
|
||||
{{ $katexJS := $katexJS | resources.Fingerprint "sha512" }}
|
||||
<script defer src="{{ $katexJS.RelPermalink }}" integrity="{{ $katexJS.Data.Integrity }}"></script>
|
||||
<script
|
||||
defer
|
||||
src="{{ $katexJS.RelPermalink }}"
|
||||
integrity="{{ $katexJS.Data.Integrity }}"
|
||||
></script>
|
||||
{{ $katexRenderJS := resources.Get "lib/katex/auto-render.min.js" }}
|
||||
{{ $katexRenderJS := $katexRenderJS | resources.Fingerprint "sha512" }}
|
||||
<script defer src="{{ $katexRenderJS.RelPermalink }}" integrity="{{ $katexRenderJS.Data.Integrity }}" onload="renderMathInElement(document.body);"></script>
|
||||
<script
|
||||
defer
|
||||
src="{{ $katexRenderJS.RelPermalink }}"
|
||||
integrity="{{ $katexRenderJS.Data.Integrity }}"
|
||||
onload="renderMathInElement(document.body);"
|
||||
></script>
|
||||
{{ $katexFonts := resources.Match "lib/katex/fonts/*" }}
|
||||
{{ range $katexFonts }}
|
||||
{{ .Publish }}
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
{{ $img = resources.Get $path }}
|
||||
{{ end -}}
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
<figure{{ with $class }} class="{{ . }}"{{ end }}>
|
||||
{{ with $href }}<a href="{{ . }}">{{ end }}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{{ if .Get "src" }}
|
||||
{{ $image := .Page.Resources.GetMatch (printf "*%s*" (.Get "src")) }}
|
||||
<!-- prettier-ignore -->
|
||||
<figure{{ with .Get "class" }} class="{{ . }}"{{ end }}>
|
||||
{{- if .Get "href" -}}
|
||||
<a href="{{ .Get "href" }}">
|
||||
|
|
|
@ -1 +1,21 @@
|
|||
{"name":"Congo","short_name":"Congo","icons":[{"src": "/android-chrome-192x192.png","sizes": "192x192","type": "image/png","purpose": "any maskable"},{"src": "/android-chrome-512x512.png","sizes": "512x512","type": "image/png","purpose": "any maskable"}],"theme_color":"#ffffff","background_color":"#7c3aed","display":"standalone"}
|
||||
{
|
||||
"name": "Congo",
|
||||
"short_name": "Congo",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/android-chrome-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png",
|
||||
"purpose": "any maskable"
|
||||
},
|
||||
{
|
||||
"src": "/android-chrome-512x512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png",
|
||||
"purpose": "any maskable"
|
||||
}
|
||||
],
|
||||
"theme_color": "#ffffff",
|
||||
"background_color": "#7c3aed",
|
||||
"display": "standalone"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue