processShoulder.sh 2.0 KB

123456
  1. # 定制结构层次
  2. find target/generated-docs/ -type f -name "shoulder_*.html" | xargs sed -i 's!<span id="back-to-index"><a href="index.html">Back to index!<span id="back-to-index"><a href="shoulder.html#_特性">🏠 返回上级!g'
  3. # 搜索
  4. find target/generated-docs/ -type f -name "*.html" | xargs sed -i 's!<div id="toc" class="toc2">!<div id="toc" class="toc2"><b>✨ Shoulder </b><span style="color:#000000;background-color:#aaff88;padding:2px 6px;border-radius:8px;font-size:0.9em;">0.8.1</span> <button id="search-button" style="margin:0; position:relative;border-radius:8px;"><svg enable-background="new 0 0 32 32"id="Glyph"version="1.1"viewBox="0 0 32 32"xml:space="preserve"xmlns="http://www.w3.org/2000/svg"xmlns:xlink="http://www.w3.org/1999/xlink"style="height:16px;"><path d="M27.414,24.586l-5.077-5.077C23.386,17.928,24,16.035,24,14c0-5.514-4.486-10-10-10S4,8.486,4,14 s4.486,10,10,10c2.035,0,3.928-0.614,5.509-1.663l5.077,5.077c0.78,0.781,2.048,0.781,2.828,0 C28.195,26.633,28.195,25.367,27.414,24.586z M7,14c0-3.86,3.14-7,7-7s7,3.14,7,7s-3.14,7-7,7S7,17.86,7,14z"id="XMLID_223_"></path></svg><span style="align-items:center; "> 搜索 </span></button><br><br><br>!g'
  5. find target/generated-docs/ -type f -name "*.html" | xargs sed -i 's!<div id="doc" class="doc">!<div id="doc" class="doc"><div id="overlay" style="display:none;position:fixed;top:0;left:0;width:100%;height:100%;background:rgba\(90,150,40,0.95\);z-index:10;align-items:center;justify-content:center;" ><iframe id="popup-search-iframe" src="https://doc.itlym.cn/search.html" style="width:80%;height:400px;border:none;z-index:20;display:flex;align-items:center;justify-content:center;"></iframe></div>!g'
  6. find target/generated-docs/ -type f -name "*.html" | xargs sed -i 's!</body>!<script>var btn = document.getElementById("search-button");var overlay = document.getElementById("overlay");btn.onclick = function(){overlay.style.display = "flex";};overlay.onclick = function(event){if (event.target == overlay){overlay.style.display = "none";}};</script></body>!g'