Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
astro-layers
Advanced tools
Note: This plugin is still under development and could have bugs. Current version offers only basic functionality.
Extend and override any Astro project files using a layered architecture - perfect for themes, white-labeling, and feature variations.
This package allows you to create multiple layers of files that override your base Astro application. Think of it like CSS cascading - each layer can override any file from your source code or previous layers, while keeping the rest intact. This includes pages, components, layouts, styles, public assets, and any other project files.
Key Features:
For example, you can have a base e-commerce site and create different layers for:
Install the plugin using your preferred package manager:
pnpm install astro-layers
Add the plugin to your astro.config.mjs
:
import layers from 'astro-layers';
export default defineConfig({
plugins: [layers()],
//...
});
Add .layers
to your .gitignore
:
# Astro Layers
.layers
Now, create a layers
directory in the root of your project and add some layers to it. Every file you put in a layer will override the default one in src
folder.
project-root/
layers/
layer-1/
pages/
index.astro # This will override default index.astro
src/
pages/
index.astro
Layers are processed in alphabetical order. To control the priority, prefix your layer directories with numbers:
your-project/
├── layers/
│ ├── 1.base/
│ │ └── pages/
│ │ └── index.astro
│ ├── 2.theme/
│ │ └── pages/
│ │ └── index.astro
│ └── 3.premium/
│ └── pages/
│ └── index.astro
└── src/
└── pages/
└── index.astro
In this example:
1.base
will be checked first2.theme
will be checked second3.premium
will be checked lastThis naming convention makes it easy to:
1.5.feature
)layers/
├── 1.base/ # Base components and layouts
├── 2.theme/ # Theme-specific overrides
├── 3.features/ # Feature-specific changes
└── 4.customization/ # Customer-specific customizations
MIT License © 2024-PRESENT Filip Rakowski
FAQs
Astro plugin for managing layout layers
The npm package astro-layers receives a total of 264 weekly downloads. As such, astro-layers popularity was classified as not popular.
We found that astro-layers 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.