【发布时间】:2023-03-09 12:35:01
【问题描述】:
我正在寻找一种编辑数千个 .html 文件的方法,将它们添加为 og:url ,其 URL 基本上取自文件名。基本上,对于我想要的每个 .html:
<meta property="og:url" content="https://www.example.com/NAME-OF-THE-FILE.html" />
--
我的想法是搜索 并将其替换为所需的代码: 我不知道如何找到文件名。如何做到这一点?
--
简单来说:
我在所有 .html 文件中搜索和替换。
地点:
</head>
替换为:
<meta property="og:url" content="https://www.example.com/{FILENAME}" />
</head>
我该怎么做?我不知道如何获取 {FILENAME}(文件名)
编辑:Bash 看起来很有趣,但我是个菜鸟,不知道如何获得它。非常欢迎任何帮助。
谢谢,谢谢,谢谢!
【问题讨论】: