
Security News
Rust RFC Proposes a Security Tab on crates.io for RustSec Advisories
Rustâs crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.
astro-relative-links
Advanced tools
This Astro integration builds Astro with relative links.
The astro add command-line tool automates the installation for you. Run one of the following commands in a new terminal window. (If you aren't sure which package manager you're using, run the first command.) Then, follow the prompts, and type "y" in the terminal (meaning "yes") for each one.
# Using NPM
npx astro add astro-relative-links
# Using Yarn
yarn astro add astro-relative-links
# Using PNPM
pnpm astro add astro-relative-links
If you run into any issues, feel free to report them to me on GitHub and try the manual installation steps below.
First, install the astro-relative-links packages using your package manager. If you're using npm or aren't sure, run this in the terminal:
npm install astro-relative-links
Then, apply this integration to your astro.config.* file using the integrations property:
astro.config.mjs
import { defineConfig } from 'astro/config';
import relativeLinks from 'astro-relative-links';
export default defineConfig({
// ...
integrations: [relativeLinks()],
});
Build as usual with npm run build etc. All links in the project will be generated as relative paths.
dist/index.html
<link rel="stylesheet" href="./_astro/index.*.css" />
<script type="module" src="./_astro/hoisted.*.js"></script>
dist/sub/index.html
<link rel="stylesheet" href="../_astro/index.*.css" />
<script type="module" src="../_astro/hoisted.*.js"></script>
src/components/Header.astro
<a href="/">Home</a>
<a href="/apple/">
<img src="/images/apple.png" alt="" />
Apple
</a>
<a href="/banana/">
<img src="/images/banana.png" alt="" />
Banana
</a>
The above components will be generated as follows.
dist/index.html
<a href="./">Home</a>
<a href="./apple/">
<img src="./images/apple.png" alt="" />
Apple
</a>
<a href="./banana/">
<img src="./images/banana.png" alt="" />
Banana
</a>
dist/apple/index.html
<a href="../">Home</a>
<a href="../apple/">
<img src="../images/apple.png" alt="" />
Apple
</a>
<a href="../banana/">
<img src="../images/banana.png" alt="" />
Banana
</a>
dist/banana/index.html
<a href="../">Home</a>
<a href="../apple/">
<img src="../images/apple.png" alt="" />
Apple
</a>
<a href="../banana/">
<img src="../images/banana.png" alt="" />
Banana
</a>
base configastro.config.mjs
import { defineConfig } from 'astro/config';
import relativeLinks from 'astro-relative-links';
export default defineConfig({
base: 'fruits',
integrations: [relativeLinks()],
});
src/components/Header.astro
<a href="/">Home</a>
<a href="/fruits/">Fruits</a>
<a href="/fruits/apple/">
<img src="/fruits/images/apple.png" alt="" />
Apple
</a>
<a href="/fruits/banana/">
<img src="/fruits/images/banana.png" alt="" />
Banana
</a>
The above components will be generated as follows.
dist/index.html
<a href="/">Home</a>
<a href="./">Fruits</a>
<a href="./apple/">
<img src="./images/apple.png" alt="" />
Apple
</a>
<a href="./banana/">
<img src="./images/banana.png" alt="" />
Banana
</a>
dist/apple/index.html
<a href="/">Home</a>
<a href="../">Fruits</a>
<a href="../apple/">
<img src="../images/apple.png" alt="" />
Apple
</a>
<a href="../banana/">
<img src="../images/banana.png" alt="" />
Banana
</a>
dist/banana/index.html
<a href="/">Home</a>
<a href="../">Fruits</a>
<a href="../apple/">
<img src="../images/apple.png" alt="" />
Apple
</a>
<a href="../banana/">
<img src="../images/banana.png" alt="" />
Banana
</a>
FAQs
Build Astro with relative links.
We found that astro-relative-links demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Rustâs crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.

Security News
/Research
Socket found a Rust typosquat (finch-rust) that loads sha-rust to steal credentials, using impersonation and an unpinned dependency to auto-deliver updates.

Research
/Security Fundamentals
A pair of typosquatted Go packages posing as Googleâs UUID library quietly turn helper functions into encrypted exfiltration channels to a paste site, putting developer and CI data at risk.