Skip to content

Commit 07a19cd

Browse files
committed
feat(footer): 为所有页面添加footer,强制渲染。
1 parent 6211a3b commit 07a19cd

File tree

4 files changed

+34
-3
lines changed

4 files changed

+34
-3
lines changed

assets/plugin-styles.txt.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/src/plugin-styles.txt.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@
466466
.document-container
467467
{
468468
flex-basis: var(--content-width);
469-
padding-bottom: 96px;
469+
padding-bottom: 260px;
470470
}
471471

472472
.markdown-reading-view

src/html-generation/html-generator.ts

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { log } from "../moreOnLog";
1010
import { StatsView } from "src/statsView";
1111
import InvioPlugin from "src/main";
1212
import { Utils } from "src/utils/utils";
13+
import { WMS_FOOTER, WMS_FOOTER_STYLE } from './wms-footer';
1314

1415
const LogoSVGDefault = `<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg238067" height="768px" width="1024px" version="1.1" viewBox="0 0 100 100" class="svg-icon invio-sync-wait"><g fill-rule="evenodd" style="transform: scale3d(0.89, 0.99, 1.5);"><path d="M27 97.93A56.08 56.08 0 0 1 9.29 19.08 55.77 55.77 0 0 0 23.59 50l.07.07c.53.58 1.06 1.14 1.62 1.7s1.12 1.09 1.72 1.62L45.54 72a14.93 14.93 0 0 1 4.53 10.93v1.59a15.12 15.12 0 0 1-8 13.52A15.09 15.09 0 0 1 27 97.93z" style="fill: var(--icon-color);"></path><path d="M23.59 50a55.77 55.77 0 0 1-14.3-30.92A56.46 56.46 0 0 1 27 2.08 15.08 15.08 0 0 1 42.11 2a15.12 15.12 0 0 1 8 13.52v1.59A15 15 0 0 1 45.55 28l-22 22z" fill="#999999" opacity=".8"></path><path d="M85.16 2.08a56.08 56.08 0 0 1 17.67 78.84A55.77 55.77 0 0 0 88.53 50l-.08-.07c-.52-.58-1.06-1.14-1.62-1.7s-1.12-1.09-1.69-1.62L66.58 28a14.93 14.93 0 0 1-4.53-10.93v-1.55A15.12 15.12 0 0 1 70 2a15.08 15.08 0 0 1 15.15.08z" style="fill: var(--icon-color);"></path><path d="M88.53 50a55.77 55.77 0 0 1 14.3 30.92 56.35 56.35 0 0 1-17.67 17 15.46 15.46 0 0 1-23.11-13.44v-1.59A15 15 0 0 1 66.57 72l22-22z" fill="#999999" opacity=".8"></path></g></svg>`
1516

@@ -145,7 +146,35 @@ export class HTMLGenerator {
145146
file.downloads.push(new Downloadable('_common-left-tree.html', fileTree.outerHTML, rootDir));
146147
// TODO: 摆脱includeFileTree限制,定制优化index首页UI样式
147148
if (InvioSettingTab.settings.generateIndexPage) {
148-
file.downloads.push(new Downloadable('index.html', fileTree.outerHTML, rootDir));
149+
const indexPageHTML = `<!DOCTYPE html><html lang="zh"><head>
150+
<title>${prefix}</title>
151+
<style>
152+
.tree-container, .tree-footer {
153+
max-width: 800px;
154+
margin: 2rem auto;
155+
padding: 1rem;
156+
background: white;
157+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
158+
border-radius: 8px;
159+
}
160+
.tree-item.mod-tree-file {
161+
padding: 1rem;
162+
border-bottom: 1px solid #ddd;
163+
}
164+
a.tree-item-link {
165+
text-decoration: none;
166+
color: #2e8555;
167+
font-weight: bold;
168+
transition: color 0.3s;
169+
}
170+
.collapse-icon {
171+
display: none;
172+
}
173+
.tree-scroll-area>.tree-item>.tree-item-contents { padding: 1rem; text-align: center; }
174+
${WMS_FOOTER_STYLE}
175+
</style>
176+
</head><body>${fileTree.outerHTML}<div class="tree-footer">${WMS_FOOTER}</div></body></html>`;
177+
file.downloads.push(new Downloadable('index.html', indexPageHTML, rootDir));
149178
}
150179
}
151180

src/html-generation/wms-footer.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export const WMS_FOOTER = `<footer class="footer_d1NW"><div class="contactArea_F3xQ"><div><h2>联系我们</h2><div><p>网站:<a href="https://wms.webinfra.cloud" target="__blank">https://wms.webinfra.cloud</a></p><p>电话:<a href="tel:19537602183">19537602183</a></p><p>地址:上海市嘉定区云谷路399号嘉定新城科创智慧园T2办公楼</p></div></div><div class="qrs_s00F"><div class="qr_gmUh"><div class="qrTitle_TmNk"><span>关注公众号</span><br><span>了解前沿WMS知识</span></div><div style="margin-top:1rem"><img src="img/company_qr.jpg" alt="公众号二维码" style="width:80px;height:80px"></div></div><div class="qr_gmUh"><div class="qrTitle_TmNk"><span>客服微信</span><br><span>只冲WMS产品</span></div><div style="margin-top:1rem"><img src="img/sales_qr.jpg" alt="客服二维码" style="width:80px;height:80px"></div></div></div></div><div class="beian_B2zb"><div><a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener noreferrer" style="color:inherit;text-decoration:none">沪ICP备2023003164号-1</a></div><div style="margin-left:1rem"><span>Copyright © <!-- -->2024<!-- --> 只冲科技, Inc. All rights reserved.</span></div></div></footer>`
2+
export const WMS_FOOTER_STYLE = `.footer_d1NW{background-color:#303846;color:#fff;padding:1rem}.contactArea_F3xQ{align-items:center;color:#fff;display:flex;font-size:1rem;justify-content:center}.contactArea_F3xQ a{color:inherit;font-weight:700}.qrs_s00F{display:flex;flex:0 0 auto}.qr_gmUh{flex:1;min-width:118px;text-align:center}.beian_B2zb,.buttons_c5vH{align-items:center;display:flex}.qrTitle_TmNk{font-size:smaller}.beian_B2zb{color:#ffffff6b;flex-direction:row;font-size:small;justify-content:center;margin-top:2rem}@media screen and (max-width:767px){.contactArea_F3xQ{flex-direction:column}.qrs_s00F{width:100%}.beian_B2zb{display:none}}`

0 commit comments

Comments
 (0)