File tree Expand file tree Collapse file tree 5 files changed +572
-1
lines changed
source/charts/preciousmetals Expand file tree Collapse file tree 5 files changed +572
-1
lines changed Original file line number Diff line number Diff line change 1515 "state" : {
1616 "file" : " source/_posts/2025全球贵金属市场年度深度报告:宏观范式重构、工业需求爆发与广期所(GFEX)的定价革命.md" ,
1717 "mode" : " source" ,
18- "source" : false
18+ "source" : true
1919 },
2020 "icon" : " lucide-file" ,
2121 "title" : " 2025全球贵金属市场年度深度报告:宏观范式重构、工业需求爆发与广期所(GFEX)的定价革命"
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ i18n_dir: :lang
3232skip_render :
3333 - ' 博客模板.md' # Skip render for this file
3434 - " charts/**"
35+ - ' 嵌入网站.md' # Skip render for this file
3536
3637# Writing
3738new_post_name : :title.md # File name of new posts
Original file line number Diff line number Diff line change 1+ /**
2+ * Hexo Tag Plugin: MyChart
3+ * 使用方法: {% mychart folder_name [height] %}
4+ * 示例: {% mychart spforcast %} 或 {% mychart spforcast 800 %}
5+ */
6+ hexo . extend . tag . register ( 'mychart' , function ( args ) {
7+ var chartName = args [ 0 ] ;
8+ // 如果用户没填高度,默认给 600,填了就用填的
9+ var height = args [ 1 ] || 600 ;
10+
11+ // 注意:这里保留了 onload 自动调整高度的逻辑,
12+ // 但为了防止初始高度太小导致闪烁,给了一个 min-height
13+ return `
14+ <div style="width: 100%; margin: 20px 0;">
15+ <iframe
16+ src="/charts/${ chartName } /"
17+ width="100%"
18+ height="${ height } "
19+ scrolling="no"
20+ style="border:none; min-height: ${ height } px;"
21+ onload="setTimeout(()=>{this.style.height=(this.contentWindow.document.body.scrollHeight+20)+'px'}, 500);">
22+ </iframe>
23+ </div>
24+ ` ;
25+ } ) ;
You can’t perform that action at this time.
0 commit comments