Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@takeshape/routing
Advanced tools
`@takeshape/routing` is a module designed to be used on the frontend of a site generated with [TakeShape](https://www.takeshape.io). It is library agnostic so it can be used with React, Vue, etc.
@takeshape/routing
is a module designed to be used on the frontend of a site generated with
TakeShape. It is library agnostic so it can be used with React, Vue, etc.
npm install --save @takeshape/routing
The route
function is used to generate links on the client side. It allows you to create links to your static site
with content fetched from the TakeShape GraphQL API. It's
especially useful when building out dynamic search or
taxonomy pages.
route
is a curried function which consumes the following params
config
- Object - The tsg.yml
config object use yaml-loader
to import itrouteName
- String - The name of the desired routecontent
- Object - An object containing the properties referenced in the route stringtsg.yml
templatePath: src/templates
staticPath: static
buildPath: build
routes:
post:
path: /blog/:title/
template: pages/posts/individual.html
search-result-link.jsx
import {route as createRoute} from '@takeshape/routing';
import config from '../tsg.yml';
const route = createRoute(config);
export default function SearchResultLink({content}) {
return <a href={route(content._contentTypeName, content)}>{content.title}</a>;
}
where the content
prop would be:
{
"_contentTypeName": "post",
"title": "How TakeShape Routing Works"
}
Rendered HTML:
<a href="/blog/how-@takeshape/routing-works">How TakeShape Routing Works</a>
getImageUrl
converts asset paths into URLs suitable for use in an <img>
tag.
import {getImageUrl} from '@takeshape/routing';
<img src={getImageUrl('/my/image/path')}/>
<img src={getImageUrl('/my/image/path', {w: 300, h: 250})}/> // image resized to 300x250
TakeShape uses Imgix as its image CDN. Imgix provides rich suite of image manipulation
capatbilities that are accessible using the second argument of getImageUrl
. See
their docs for all the possibilites!
Not all assets in TakeShape are images and sometimes you just want a simple download link. Use getAssetUrl
in this
case.
import {getAssetUrl} from '@takeshape/routing';
<a href={getAssetUrl('/my/asset/path')} download>
Download Me
</a>;
FAQs
`@takeshape/routing` is a module designed to be used on the frontend of a site generated with [TakeShape](https://www.takeshape.io). It is library agnostic so it can be used with React, Vue, etc.
The npm package @takeshape/routing receives a total of 252 weekly downloads. As such, @takeshape/routing popularity was classified as not popular.
We found that @takeshape/routing demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.