品牌露出 4 处默认显示(页底落款 / 专属福利「兜爸出品」/ 测一测「兜爸原创」/ 投稿卡「兜爸心选 · 官方征集」,?brand=0 可关);专题页底部加「兜爸心选 | 孕育知识整理」落款(共用模板 + 5 个自带页);v26110203

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
deploy
2026-11-02 06:37:11 +00:00
parent 1dd1456f16
commit 29e1f3a9a2
107 changed files with 226 additions and 203 deletions

16
topic/_shared/brand.js Normal file
View File

@@ -0,0 +1,16 @@
/* 11-02 用户:专题页底部加品牌落款「兜爸心选 · 孕育知识整理」(页面会被单独转发,低调署名)。
共用模板 article.js 已内置;自带页面(huafei / wen / buji / zhichang / yingyang)各引一次本文件。
放在最后一个 .foot 后面;没有 .foot 的页面必须写 data-after。 */
(function () {
if (document.querySelector('.tp-brand')) return;
var st = document.createElement('style');
st.textContent = '.tp-brand{display:flex;align-items:center;justify-content:center;gap:6px;margin:14px auto 22px;font-size:11.5px;color:#C29A8F;letter-spacing:.06em}' +
'.tp-brand img{width:58px;height:auto;opacity:.6}.tp-brand i{width:1px;height:10px;background:#E5CFC8}';
document.head.appendChild(st);
var h = '<div class="tp-brand"><img src="../../assets/img/brand-logo-c.png" alt="兜爸心选"><i></i><span>孕育知识整理</span></div>';
/* 页面结构特殊的(如 huafei 分好几屏)用 <script data-after="选择器"> 指定放在哪些元素后面 */
var cs = document.currentScript, after = cs && cs.getAttribute('data-after');
if (after) { [].forEach.call(document.querySelectorAll(after), function (el) { el.insertAdjacentHTML('afterend', h); }); return; }
var f = document.querySelectorAll('.foot'), last = f[f.length - 1];
if (last) last.insertAdjacentHTML('afterend', h);
})();