![38% of CISOs Fear They’re Not Moving Fast Enough on AI](https://cdn.sanity.io/images/cgdhsj6q/production/faa0bc28df98f791e11263f8239b34207f84b86f-1024x1024.webp?w=400&fit=max&auto=format)
Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
metalsmith-prefix
Advanced tools
A metalsmith plugin to prefix internal URLs on your site. Helpful for deploying to nested urls (like example.com/blog) while developing locally. Written because metalsmith-prefixoid wasn't working for me.
It rewrites all absolute internal URLs to use this prefix, but no external or relative ones. So the rendered html
<a href="http://example.com"></a>
<a href="path/to/url"></a>
<a href="/path/to/url"></a>
Would become this when prefixed with 'prefix'
<a href="http://example.com"></a>
<a href="path/to/url"></a>
<a href="/prefix/path/to/url"></a>
npm install metalsmith-prefix
Because metalsmith-prefix
parses output HTML, it should be placed near the end of your plugin chain, after all your templates have already been rendered.
Install through npm and then add the metalsmith-prefix
key to your metalsmith.json
.
{
"plugins": {
"metalsmith-prefix": "blog"
}
}
Or by passing in options
{
"plugins": {
"metalsmith-prefix": {
"prefix": "blog",
"selector": "a, img, link, script"
}
}
}
Pass options
to the plugin and pass it to Metalsmith with the use
method:
var prefix = require('metalsmith-prefix')
metalsmith.use(prefix({
prefix: 'blog',
selector: 'a, img, link, script'
}))
You can pass options to metalsmith-prefix
with the Javascript API or CLI. The options are:
The prefix used to rewrite urls.
The selector used to find elements with URLs to rewrite. Metalsmith-prefix uses cheerio to parse any HTML outputs for URLs and rewrites them. This option defaults to a, link, script, img, video, audio, source
MIT
FAQs
A metalsmith plugin to prefix internal URLs
The npm package metalsmith-prefix receives a total of 0 weekly downloads. As such, metalsmith-prefix popularity was classified as not popular.
We found that metalsmith-prefix demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.