diff --git a/settings.yaml b/settings.yaml index 03e4e76..eb9dc8b 100644 --- a/settings.yaml +++ b/settings.yaml @@ -61,11 +61,35 @@ spec: name: system_font value: false help: 开启后将优先使用访问者的系统字体 + - $formkit: checkbox name: pixel_style label: 默认像素化风格 value: false help: 开启后将默认使用像素风格字体及图标 + + - $formkit: select + name: time_style + id: time_style + label: 时间格式 + value: "yyyy-MM-dd" + options: + - label: "yyyy-MM-ddTHH:mm:ssXXX" + value: "yyyy-MM-dd''T''HH:mm:ssXXX" + - label: "yyyy-MM-dd HH:mm:ss" + value: "yyyy-MM-dd'' ''HH:mm:ss" + - label: "yyyy-MM-dd" + value: "yyyy-MM-dd" + - label: "custom" + value: "custom" + + - $formkit: text + if: "$get(time_style).value === 'custom'" + name: custom_time_style + label: 自定义时间格式 + placeholder: "yyyy-MM-dd" + validation: "required" + - $formkit: select name: default_scheme_mode label: 默认配色方案 diff --git a/templates/archives.html b/templates/archives.html index 6b68d27..a4b4bb9 100644 --- a/templates/archives.html +++ b/templates/archives.html @@ -17,12 +17,29 @@ diff --git a/templates/index.html b/templates/index.html index cfc3414..b94fd99 100644 --- a/templates/index.html +++ b/templates/index.html @@ -20,7 +20,8 @@
+ th:text="${#dates.format(post.spec.publishTime, '__${theme.config.style.time_style == 'custom' ? + theme.config.style.custom_time_style : theme.config.style.time_style}__')}">Publish Time Author diff --git a/templates/post.html b/templates/post.html index 799d5ef..24d34ce 100644 --- a/templates/post.html +++ b/templates/post.html @@ -8,8 +8,9 @@

Post Title