Compare commits

...

7 Commits

Author SHA1 Message Date
Cell de72a8c802 🔖 Chore(release): 0.3.19 2025-04-22 15:06:18 +08:00
Cell f5b867d717 Feat: add echarts shortcode and code fences support JS object literal (#587) 2025-04-22 12:38:07 +08:00
Cell 5ba4a8145b Feat: deprecated image-legacy.html 2025-04-16 10:10:06 +08:00
Cell 80e4d07294 🐛 Fix: lookup rules of RSS templates (#585) 2025-04-16 10:03:06 +08:00
Cell c2dc17e9e0 🔖 Chore(release): 0.3.18 2025-04-15 10:25:49 +08:00
Cell b7edbf3e49 ⬆️ Chore: update Hugo min version to 0.146.0 2025-04-15 10:17:38 +08:00
Cell adeecfb69d 🐛 Fix: deprecated layouts/page directory at Hugo 0.146.0+ (#581) 2025-04-15 10:03:41 +08:00
15 changed files with 27 additions and 13 deletions
+1 -1
View File
@@ -25,7 +25,7 @@
> It is based on the original [LoveIt](https://github.com/dillonzq/LoveIt) Theme, [KeepIt](https://github.com/Fastbyte01/KeepIt) Theme and [LeaveIt](https://github.com/liuzc/LeaveIt) Theme.
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/hugo-fixit/FixIt?style=flat)](https://github.com/hugo-fixit/FixIt/releases)
[![Hugo](https://img.shields.io/badge/Hugo-%5E0.141.0-ff4088?style=flat&logo=hugo)](https://gohugo.io/)
[![Hugo](https://img.shields.io/badge/Hugo-%5E0.146.0-ff4088?style=flat&logo=hugo)](https://gohugo.io/)
[![License](https://img.shields.io/github/license/hugo-fixit/FixIt?style=flat)](/LICENSE)
[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://github.com/hugo-fixit/FixIt)
+1 -1
View File
@@ -25,7 +25,7 @@
> 它的原型基于 [LoveIt](https://github.com/dillonzq/LoveIt) 主题,[KeepIt](https://github.com/Fastbyte01/KeepIt) 主题和 [LeaveIt](https://github.com/liuzc/LeaveIt) 主题。
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/hugo-fixit/FixIt?style=flat)](https://github.com/hugo-fixit/FixIt/releases)
[![Hugo](https://img.shields.io/badge/Hugo-%5E0.141.0-ff4088?style=flat&logo=hugo)](https://gohugo.io/)
[![Hugo](https://img.shields.io/badge/Hugo-%5E0.146.0-ff4088?style=flat&logo=hugo)](https://gohugo.io/)
[![License](https://img.shields.io/github/license/hugo-fixit/FixIt?style=flat)](/LICENSE)
[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://github.com/hugo-fixit/FixIt)
+6 -1
View File
@@ -686,7 +686,12 @@ class FixIt {
if ($echarts.nextElementSibling.tagName === 'TEMPLATE') {
const chart = echarts.init($echarts, this.isDark ? 'dark' : 'light', { renderer: 'svg' });
stagingDOM.stage($echarts.nextElementSibling.content.cloneNode(true));
chart.setOption(stagingDOM.contentAsJson());
// support both JSON and JS object literal
if ($echarts.nextElementSibling.dataset.fmt === 'js') {
eval(`chart.setOption(${stagingDOM.contentAsText()})`);
} else {
chart.setOption(stagingDOM.contentAsJson());
}
this._echartsArr.push(chart);
}
});
+1 -1
View File
@@ -135,7 +135,7 @@ enableEmoji = true
[module]
[module.hugoVersion]
extended = true
min = "0.141.0"
min = "0.146.0"
# -------------------------------------------------------------------------------------
# Markup related configuration in Hugo
+1 -1
View File
@@ -1,4 +1,4 @@
{{- .Scratch.Set "version" "v0.3.17" -}}
{{- .Scratch.Set "version" "v0.3.19" -}}
{{- .Scratch.Set "this" dict -}}
{{- partial "init/detection-env.html" . -}}
+13 -2
View File
@@ -1,7 +1,18 @@
{{- /* Echarts support for code fences extended and shortcodes. */ -}}
{{- $width := .Options.width | default "100%" -}}
{{- $height := .Options.height | default "30rem" -}}
{{- $js := .Options.js | default false -}}
{{- $attrs := printf `style="width: %v; height: %v;"` $width $height -}}
<div class="echarts" {{ $attrs | safeHTMLAttr }}></div>
<template>{{ .Inner | transform.Unmarshal | jsonify }}</template>
{{- /* EOF */ -}}
{{- if $js -}}
{{- $content := strings.TrimSpace .Inner -}}
{{- if hugo.IsProduction -}}
{{- $content = replaceRE `[\s]+` " " $content -}}
{{- end -}}
{{- if not ((hasPrefix $content "{") | and (hasSuffix $content "}")) -}}
{{- errorf "ECharts format error\nPlease use JS object literal for Echarts, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Grammar_and_types#object_literals" -}}
{{- end -}}
<template data-fmt="js">{{ $content | safeJS }}</template>
{{- else -}}
<template>{{ .Inner | transform.Unmarshal | jsonify }}</template>
{{- end -}}
+1 -4
View File
@@ -1,7 +1,4 @@
{{- /*
deprecated: image-legacy.html
TODO delete this file in the next minor release
*/ -}}
{{- warnf "Deprecated image-legacy.html and will be removed in the next minor release, please use image.html instead." -}}
{{- $params := partial "function/params.html" -}}
{{- $class := .Class | default "" -}}
{{- $style := "" -}}
+1
View File
@@ -1,4 +1,5 @@
{{- $options := .Get "width" | default (.Get 0) | dict "width" -}}
{{- $options = .Get "height" | default (.Get 1) | dict "height" | merge $options -}}
{{- $options = .Get "js" | default (.Get 2) | dict "js" | merge $options -}}
{{- dict "Options" $options "Inner" .Inner | partial "plugin/echarts.html" -}}
{{- .Page.Store.Set "hasEcharts" true -}}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "fixit-core",
"version": "0.3.17",
"version": "0.3.19",
"private": true,
"packageManager": "pnpm@10.5.2",
"description": "Hugo FixIt core theme component source files",
+1 -1
View File
@@ -7,7 +7,7 @@ licenselink = "https://github.com/hugo-fixit/FixIt/blob/main/LICENSE"
description = "A Clean, Elegant but Advanced Hugo Theme for Hugo."
homepage = "https://github.com/hugo-fixit/FixIt"
demosite = "https://fixit.lruihao.cn"
min_version = "0.141.0"
min_version = "0.146.0"
tags = [
"blog",