mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
@@ -93,6 +93,13 @@ pre:not(.mermaid[data-processed='true']) {
|
||||
@include border-radius($global-border-radius);
|
||||
@include transition(border-radius 0.2s ease);
|
||||
|
||||
// delayed loading table-wrapper
|
||||
& + .table-wrapper {
|
||||
max-height: 0;
|
||||
@include border-radius(0 0 $global-border-radius $global-border-radius);
|
||||
@include details-transition-open;
|
||||
}
|
||||
|
||||
[data-theme='dark'] & {
|
||||
color: $code-info-color-dark;
|
||||
--#{$prefix}bg-code-header: #{darken($code-background-color-dark, 3%)};
|
||||
@@ -164,10 +171,8 @@ pre:not(.mermaid[data-processed='true']) {
|
||||
|
||||
// delayed loading table-wrapper
|
||||
.table-wrapper {
|
||||
max-height: 0;
|
||||
overflow: hidden;
|
||||
@include border-radius(0 0 $global-border-radius $global-border-radius);
|
||||
@include details-transition-open;
|
||||
@include border-radius($global-border-radius);
|
||||
}
|
||||
|
||||
table {
|
||||
|
||||
@@ -363,6 +363,10 @@ class FixIt {
|
||||
}
|
||||
|
||||
initHighlight() {
|
||||
if (!this.config.code) {
|
||||
return
|
||||
}
|
||||
// if markup.highlight.lineNumbersInTable set to false
|
||||
this.util.forEach(document.querySelectorAll('.highlight > pre.chroma'), ($preChroma) => {
|
||||
const $chroma = document.createElement('div');
|
||||
$chroma.className = $preChroma.className;
|
||||
|
||||
@@ -918,11 +918,13 @@ enableEmoji = true
|
||||
copyTex = true
|
||||
# KaTeX extension mhchem
|
||||
mhchem = true
|
||||
# Code config
|
||||
# Code wrapper config
|
||||
[params.page.code]
|
||||
# whether to show the copy button of the code block
|
||||
# FixIt 0.3.9 | NEW whether to enable the code wrapper
|
||||
enable = true
|
||||
# whether to show the copy button of the code wrapper
|
||||
copy = true
|
||||
# FixIt 0.2.13 | NEW whether to show the edit button of the code block
|
||||
# FixIt 0.2.13 | NEW whether to show the edit button of the code wrapper
|
||||
edit = true
|
||||
# the maximum number of lines of displayed code by default
|
||||
maxShownLines = 10
|
||||
|
||||
@@ -51,17 +51,16 @@
|
||||
{{- $config = dict "lightgallery" true | merge $config -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Code wrapper */ -}}
|
||||
{{- $code := $params.code | default dict -}}
|
||||
{{- $config = cond (ne $code.maxShownLines nil) $code.maxShownLines 10 | dict "maxShownLines" | dict "code" | merge $config -}}
|
||||
|
||||
{{- /* edit code */ -}}
|
||||
{{- if ne $code.edit false -}}
|
||||
{{- $config = dict "editable" true "editLockTitle" (T "assets.editLockTitle") "editUnLockTitle" (T "assets.editUnLockTitle") | dict "code" | merge $config -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* copy code */ -}}
|
||||
{{- if ne $code.copy false -}}
|
||||
{{- $config = T "assets.copyToClipboard" | dict "copyTitle" | dict "code" | merge $config -}}
|
||||
{{- if $code.enable -}}
|
||||
{{- $config = $code.maxShownLines | dict "maxShownLines" | dict "code" | merge $config -}}
|
||||
{{- if ne $code.edit false -}}
|
||||
{{- $config = dict "editable" true "editLockTitle" (T "assets.editLockTitle") "editUnLockTitle" (T "assets.editUnLockTitle") | dict "code" | merge $config -}}
|
||||
{{- end -}}
|
||||
{{- if ne $code.copy false -}}
|
||||
{{- $config = T "assets.copyToClipboard" | dict "copyTitle" | dict "code" | merge $config -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Sharer.js */ -}}
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
{{- dict "Collections" $termLink | T "single.includedIn.collections" | strings.FirstUpper | safeHTML }} {{ .Pages.Len -}}
|
||||
</div>
|
||||
<div class="collection-nav">
|
||||
{{/* TODO JS 实现 reverse 翻转顺序 */}}
|
||||
{{- $pages := (where .Pages "Params.Weight" "!=" nil) | append (where .Pages "Params.Weight" "eq" nil).ByDate -}}
|
||||
{{- with $pages.Next $ -}}
|
||||
<a href="{{ .RelPermalink }}" class="collection-nav-item" rel="prev" title="{{ title .LinkTitle }}">
|
||||
|
||||
Reference in New Issue
Block a user