# -*- coding: utf-8 -*- """ 博客构建脚本:blog/posts/*.md -> website/static/blog/(列表 + 文章页)+ website/static/home.html(首页) front matter 格式: --- title: 文章标题 date: 2026-08-13 tags: 工业软件, ResLib --- """ import re from datetime import datetime from pathlib import Path import markdown BASE = Path(__file__).resolve().parent POSTS_DIR = BASE / "posts" OUT_BLOG = BASE.parent / "website" / "static" / "blog" OUT_HOME = BASE.parent / "website" / "static" / "home.html" OUT_ABOUT = BASE.parent / "website" / "static" / "about.html" SITE_NAME = "Easy Data Collection" SEO_NAME = "江北的渔夫的空间" NAV_ITEMS = [ { "key": "research", "href": "/research/", "label": "前沿技术研究", "children": [ ("http://124.220.63.9:25000", "Research Digest"), ("/research/neural/", "Neural Research"), ("/research/reslib/", "ResLib"), ], }, { "key": "tools", "href": "/tools/", "label": "工具开发", "children": [ ("/tools/sequence-diagram/", "Sequence-Diagram"), ("/tools/uni-viewer/", "Uni-Viewer"), ("/tools/engineer-craft/", "Engineer Craft"), ("/tools/five-phases-observer/", "The Five Phases Observer"), ("/tools/unitouch/", "UniTouch Interface"), ("/tools/edc-lite-erp/", "EDC Lite ERP"), ("/tools/physics-ai-fluent/", "Physics AI Fluent"), ], }, { "key": "resources", "href": "/resources/", "label": "资源中心", "children": [], }, { "key": "license", "href": "/license/", "label": "License", "children": [ ("/license/apply", "申请 License"), ("/license/status", "查询 / 下载"), ("/license/package", "资源包获取"), ], }, { "key": "blog", "href": "/blog/", "label": "博客", "children": [], }, ] def nav_html(active: str = "") -> str: parts = [] for item in NAV_ITEMS: if not item["children"]: cls = "nav-link active" if item["key"] == active else "nav-link" parts.append(f' {item["label"]}') continue parent_cls = "nav-link active" if item["key"] == active else "nav-link" links = "\n".join( f' {label}' for href, label in item["children"] ) parts.append( f"""
""" ) return "\n".join(parts) def page_header(active: str = "", title: str = "") -> str: seo_title = f"{title} - {SEO_NAME}" if title else SEO_NAME return f"""面向 PLC 流程节拍与相位角设计的时序图设计器,条形 / 圆周双视图。
了解详情 →纯前端、不出网的文件预览组件,271 个扩展名、47 条预览链路。
了解详情 →流程工业智能设计平台:31 个工程计算模块、URS 与 AI 审查。
了解详情 →90 域观测协议与 720 个可证伪锚点,让决策可编译、可证伪。
了解详情 →嵌入式工控机的设备控制软件,替代传统 HMI 的统一工控平台。
了解详情 →轻量资源计划与制造管理系统:物料编码、进销存、扫码称配全链路。
了解详情 →GPU 格子玻尔兹曼流场仿真:流化床空床流场分钟级求解,AI for Science 数据工厂。
了解详情 → """ def build(): posts = [parse_post(p) for p in sorted(POSTS_DIR.glob("*.md"), reverse=True)] posts.sort(key=lambda p: p["date"], reverse=True) OUT_BLOG.mkdir(parents=True, exist_ok=True) # ---------- 博客列表页 ---------- cards = [] for p in posts: tags = "".join(f'{t}' for t in p["tags"]) cards.append(f"""{summary(p['html'])}
""") if not cards: cards.append('暂无文章,敬请期待。
') blog_list = f"""{page_header("blog")}BLOG · 博客
工业软件、标准件库、深度学习与工具开发的过程记录。
{summary(p['html'], 90)}
""" for p in posts[:3]) if not recent: recent = '暂无文章,敬请期待。
' home = f"""{page_header("")}自动检索国际顶尖期刊与权威机构的最新成果,AI 输出中文摘要、技术突破总结与 0-5 突破度评分。
面向 Creo 7.0+ 的企业级标准零部件管理库:标准件浏览、3D 预览、搜索过滤、快速装配与 LIC 授权体系。
ModbusRTU 高速采集 → Redis 缓冲 → TimescaleDB 存储 → 1D-CNN 实时评估混合均匀度,参数稳定即判定完成。
ABOUT
Easy Data Collection —— 工业软件与数据产品的独立开发实践。
工业软件方向开发者,专注流程工业的数字化与智能化实践。