4.2.0 (#530)
* revamp code highlighting * replace standard Fira Code with a variable version * change buttons arrows * redesign code blocks * make terminal logo more prominent * separate terminal theme styles from terminal.css Terminal.css styles only can change the color scheme. * update docs and version * remove USERS.md * fix header pattern * remove old prismjs shortcode * remove old rss template * remove old figure shortcode * [chore] update yarn LOL, I'm still using 1.22.x * [chore] update package-lock.json * fix pagination & boost meta visibility * fix code blocks on mobile & move some parts from CSS to JS
This commit is contained in:
parent
c7770bc85e
commit
3f87c12098
34 changed files with 4747 additions and 6686 deletions
|
@ -1,15 +1,16 @@
|
|||
{{ $id := delimit (shuffle (seq 1 9)) "" }}
|
||||
{{ $open := .Get "open" }}
|
||||
{{ $lang := .Get "language" }}
|
||||
{{ $opts := .Get "opts" }}
|
||||
|
||||
{{ if .Get "language" }}
|
||||
<div class="collapsable-code">
|
||||
<input id="{{ .Get "id" | default $id }}" type="checkbox" {{ if ( eq ( .Get "isCollapsed" ) "true" ) -}} checked {{- end }} />
|
||||
<label for="{{ .Get "id" | default $id }}">
|
||||
<span class="collapsable-code__language">{{ .Get "language" }}</span>
|
||||
{{ if .Get "title" }}<span class="collapsable-code__title">{{ .Get "title" | markdownify }}</span>{{ end }}
|
||||
<span class="collapsable-code__toggle" data-label-expand="{{ .Get "expand" | default "△" }}" data-label-collapse="{{ .Get "collapse" | default "▽" }}"></span>
|
||||
</label>
|
||||
<pre {{ if .Get "language" }}class="language-{{ .Get "language" }}" {{ end }}><code>{{ .Inner | string }}</code></pre>
|
||||
</div>
|
||||
{{- if $lang -}}
|
||||
<details class="collapsable-code" {{ if eq $open "true" -}} open {{- end }}>
|
||||
<summary title="Click to interact">
|
||||
{{- if .Get "title" }}<span class="collapsable-code__title">{{ .Get "title" | markdownify }}</span>{{ end -}}
|
||||
</summary>
|
||||
{{ $trInner := trim .Inner "\n" }}
|
||||
{{- transform.Highlight $trInner $lang $opts -}}
|
||||
</details>
|
||||
{{ else }}
|
||||
{{ errorf "If you want to use the \"collapsable code\" shortcode, you need to pass a mandatory \"language\" param. The issue occured in %q (%q)" .Page.File .Page.Permalink }}
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
{{ if .Get "src" }}
|
||||
<figure class="{{ with .Get "position"}}{{ . }}{{ else -}} left {{- end }}" >
|
||||
<img src="{{ .Get "src" | safeURL }}" {{ with .Get "alt" }} alt="{{ . | plainify }}" {{ end }} {{ with .Get "style" }} style="{{ . | safeCSS }}" {{ end }} />
|
||||
{{ if .Get "caption" }}
|
||||
<figcaption class="{{ with .Get "captionPosition"}}{{ . }}{{ else -}} center {{- end }}" {{ with .Get "captionStyle" }} style="{{ . | safeCSS }}" {{ end }}>{{ .Get "caption" | safeHTML }}</figcaption>
|
||||
{{ end }}
|
||||
</figure>
|
||||
{{ end }}
|
|
@ -1,26 +0,0 @@
|
|||
{{ $inner := replaceRE "^\r?\n" "" .Inner | string }}
|
||||
{{ if len .Params | eq 0 }}
|
||||
<pre><code>{{ $inner }}</code></pre>
|
||||
{{ else }}
|
||||
{{ if .IsNamedParams }}
|
||||
<pre class="
|
||||
{{- if .Get "lang" }}language-{{ .Get "lang" }}{{ end }}
|
||||
{{- if .Get "line-numbers" }} line-numbers{{ end }}
|
||||
{{- if .Get "command-line" }} command-line{{ end }}"
|
||||
{{- /* line highlight plugin */ -}}
|
||||
{{- if .Get "line" }} data-line="{{ .Get "line" }}"{{ end }}
|
||||
{{- /* line number plugin */ -}}
|
||||
{{- if .Get "start" }} data-start="{{ .Get "start" }}"{{ end }}
|
||||
{{- /* command-line plugin */ -}}
|
||||
{{- if .Get "user" }} data-user="{{ .Get "user" }}"{{ end }}
|
||||
{{- if .Get "host" }} data-host="{{ .Get "host" }}"{{ end }}
|
||||
{{- if .Get "prompt" }} data-prompt="{{ .Get "prompt" }}"{{ end }}
|
||||
{{- if .Get "output" }} data-output="{{ .Get "output" }}"{{ end }}
|
||||
><code {{ if .Get "lang" }}class="language-{{ .Get "lang" }}"{{ end }}
|
||||
>{{ $inner }}</code></pre>
|
||||
{{ else }}
|
||||
<pre class="language-{{ .Get 0 }}">
|
||||
<code class="language-{{ .Get 0 }}">{{ $inner }}</code>
|
||||
</pre>
|
||||
{{ end }}
|
||||
{{ end }}
|
Loading…
Add table
Add a link
Reference in a new issue