diff --git a/CHANGELOG.md b/CHANGELOG.md index 2550e542..4e5b9f61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. +## v0.2.13 +- :sparkles: Feat: update watermark 1.0.3-RC (fontFamily support) +- **Full Changelog:** [`v0.2.12...v0.2.13`](https://github.com/Lruihao/FixIt/compare/v0.2.12...v0.2.13) + ## v0.2.12 [2022-1-27] - :tada: Feat: add PWA support diff --git a/assets/lib/VERSION b/assets/lib/VERSION index 2aaf6f53..e43a2c40 100644 --- a/assets/lib/VERSION +++ b/assets/lib/VERSION @@ -24,4 +24,4 @@ simple-icons@5.21.1 https://github.com/simple-icons/simple-icons twemoji@13.1.0 https://github.com/twitter/twemoji typeit@7.0.4 https://github.com/alexmacarthur/typeit valine@1.4.16 https://github.com/xCss/Valine -watermark@1.0.2 https://github.com/Lruihao/watermark.git \ No newline at end of file +watermark@1.0.3-RC https://github.com/Lruihao/watermark.git \ No newline at end of file diff --git a/assets/lib/watermark/watermark.min.js b/assets/lib/watermark/watermark.min.js index 91ebd491..13fba312 100644 --- a/assets/lib/watermark/watermark.min.js +++ b/assets/lib/watermark/watermark.min.js @@ -1 +1 @@ -var Watermark=function(){function t(e={}){var n=t.prototype;this.options=e,s(this),d(this,this.options),h(this),p(this),n.upload=function(t){if(t){o.disconnect(),i.disconnect(),this.options.content=t;for(const e of this._container.querySelectorAll(".cell-watermark"))e.innerHTML=t;o.observe(this._container.parentNode,{childList:!0,subtree:!0}),i.observe(this._container,{attributes:!0,childList:!0,characterData:!0,subtree:!0})}},n.render=function(t={}){l(this,Object.assign(this.options,t))},n.destroy=function(){i.disconnect(),o.disconnect(),window.removeEventListener("resize",r),this._container.parentNode.removeChild(this._container)}}var e,n,i,o,r,c=window.outerWidth,a=window.outerHeight,s=function(t){t._container=document.createElement("div"),t._container.classList.add("cell-watermark-container"),t._container.style.cssText="display: block; pointer-events: none;",t._container.setAttribute("aria-hidden",!0),e=document.querySelector(t.options.appendTo)||document.body,e.appendChild(t._container)},d=function(t,e){e.rowSpacing=e.rowSpacing||60,e.colSpacing=e.colSpacing||30,e.width=e.width||150,e.height=e.height||20;let i=parseInt(a/(e.height+e.rowSpacing)),o=parseInt(c/(e.width+e.colSpacing)),r=(c-e.width*o-e.colSpacing*(o-1))/2,s=(a-e.height*i-e.rowSpacing*(i-1))/2,d=document.createElement("div");d.classList.add("cell-watermark"),d.style.cssText="transform: rotate(15deg); opacity: 0.1; font-size: 0.85rem; text-align: center;position: fixed; user-select: none; word-break: break-all; overflow: hidden; z-index: 999999;";for(let n=0;n0&&0===document.querySelectorAll(".cell-watermark-container").length&&e.appendChild(n)}),o.observe(t._container.parentNode,{childList:!0,subtree:!0})},p=function(t){r=function(){window.outerHeight===a&&window.outerWidth===c||(a=window.outerHeight,c=window.outerWidth,l(t,t.options))},window.addEventListener("resize",r)};return t}(); \ No newline at end of file +var Watermark=function(){function t(e={}){var n=t.prototype;this.options=e,s(this),d(this,this.options),h(this),p(this),n.upload=function(t){if(t){o.disconnect(),i.disconnect(),this.options.content=t;for(const e of this._container.querySelectorAll(".cell-watermark"))e.innerHTML=t;o.observe(this._container.parentNode,{childList:!0,subtree:!0}),i.observe(this._container,{attributes:!0,childList:!0,characterData:!0,subtree:!0})}},n.render=function(t={}){l(this,Object.assign(this.options,t))},n.destroy=function(){i.disconnect(),o.disconnect(),window.removeEventListener("resize",r),this._container.parentNode.removeChild(this._container)}}var e,n,i,o,r,c=window.outerWidth,a=window.outerHeight,s=function(t){t._container=document.createElement("div"),t._container.classList.add("cell-watermark-container"),t._container.style.cssText="display: block; pointer-events: none;",t._container.setAttribute("aria-hidden",!0),e=document.querySelector(t.options.appendTo)||document.body,e.appendChild(t._container)},d=function(t,e){e.rowSpacing=e.rowSpacing||60,e.colSpacing=e.colSpacing||30,e.width=e.width||150,e.height=e.height||20;let i=parseInt(a/(e.height+e.rowSpacing)),o=parseInt(c/(e.width+e.colSpacing)),r=(c-e.width*o-e.colSpacing*(o-1))/2,s=(a-e.height*i-e.rowSpacing*(i-1))/2,d=document.createElement("div");d.classList.add("cell-watermark"),d.style.cssText="transform: rotate(15deg); opacity: 0.1; font-size: 0.85rem; text-align: center;position: fixed; user-select: none; word-break: break-all; overflow: hidden; z-index: 999999;";for(let n=0;n0&&0===document.querySelectorAll(".cell-watermark-container").length&&e.appendChild(n)}),o.observe(t._container.parentNode,{childList:!0,subtree:!0})},p=function(t){r=function(){window.outerHeight===a&&window.outerWidth===c||(a=window.outerHeight,c=window.outerWidth,l(t,t.options))},window.addEventListener("resize",r)};return t}(); \ No newline at end of file diff --git a/exampleSite/config.toml b/exampleSite/config.toml index eb3d8cd3..25bbcdbb 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -864,6 +864,9 @@ enableEmoji = true # watermark's fontSize. unit: rem # 水印字体大小,单位:rem fontSize = 0.85 + # watermark's fontFamily + # 水印字体 + fontFamily = 'inherit' # Busuanzi count since v0.2.12 # 不蒜子统计 since v0.2.12 diff --git a/exampleSite/content/posts/theme-documentation-basics/index.en.md b/exampleSite/content/posts/theme-documentation-basics/index.en.md index 250c9aa0..7fdf0284 100644 --- a/exampleSite/content/posts/theme-documentation-basics/index.en.md +++ b/exampleSite/content/posts/theme-documentation-basics/index.en.md @@ -618,6 +618,8 @@ Please open the code block below to view the complete sample configuration :(far rotate = 15 # watermark's fontSize. unit: rem fontSize = 0.85 + # watermark's fontFamily + fontFamily = 'inherit' # {{< version 0.2.12 >}} Busuanzi count [params.ibruce] diff --git a/exampleSite/content/posts/theme-documentation-basics/index.zh-cn.md b/exampleSite/content/posts/theme-documentation-basics/index.zh-cn.md index 9a91c65e..28196838 100644 --- a/exampleSite/content/posts/theme-documentation-basics/index.zh-cn.md +++ b/exampleSite/content/posts/theme-documentation-basics/index.zh-cn.md @@ -629,6 +629,8 @@ hugo rotate = 15 # 水印字体大小,单位:rem fontSize = 0.85 + # 水印字体 + fontFamily = 'inherit' # {{< version 0.2.12 >}} 不蒜子统计 [params.ibruce] diff --git a/layouts/partials/assets.html b/layouts/partials/assets.html index d05dff5c..ab9b582f 100644 --- a/layouts/partials/assets.html +++ b/layouts/partials/assets.html @@ -279,7 +279,8 @@ rowSpacing: {{ .RowSpacing }}, colSpacing: {{ .ColSpacing }}, rotate: {{ .Rotate }}, - fontSize: {{ .FontSize }} + fontSize: {{ .FontSize }}, + fontFamily: {{ .fontFamily }} }); {{- end -}} {{- end -}} diff --git a/layouts/partials/init.html b/layouts/partials/init.html index 9b76da9b..081a150d 100644 --- a/layouts/partials/init.html +++ b/layouts/partials/init.html @@ -1,4 +1,4 @@ -{{- .Scratch.Set "version" "0.2.12" -}} +{{- .Scratch.Set "version" "0.2.13" -}} {{- /* FixIt theme version detection */ -}} {{- $VERSION := "0.2.X" -}}