open-index/open-npm huggingface dataset:
npm package: @nera-static/installer
Description: CLI tool to scaffold new Nera static site projects
Author: Michael Becker
Latest version: 1.1.1

# 🛠️ Nera Installer

A simple CLI tool to create new [Nera](https://github.com/seebaermichi/nera) static site projects.

## 📦 Installation

```bash
npm install -g @nera-static/installer
```

## 🚀 Usage

### Create new project
```bash
nera new <project-name>
```

This will:

1. Clone the official Nera starter template
2. Remove the `.git` folder
3. Run `npm install`
4. Print next steps

### Example

```bash
nera new my-website
cd my-website
npm run dev
```

### Update existing project
```bash
nera update
```

**⚠️ Important:** Always commit your changes before running `nera update` to ensure you can revert if needed.

This will:

1. Check that you're in a Nera project
2. Create a backup of `assets/`, `config/` and `pages/` folder
3. Clone the latest main branch from https://github.com/seebaermichi/nera.git
4. Update all files in `src/` and `views/_defaults/`, and merge `package.json`
5. Restore backup files
6. Install updated dependencies

### Example

```bash
cd my-website
nera update
npm run dev
```

## 🧪 Development

Clone the installer and run tests with:

```bash
npm install
npm test
```

Or run a specific test file:

```bash
npx vitest run test/create.test.js
npx vitest run test/update.test.js
```

## 🔧 Troubleshooting

If an update fails, the installer will attempt to restore your files from backup automatically. If you encounter issues:

1. Check that you're in a Nera project directory (must have `package.json` with `nera` metadata)
2. Ensure you have internet access for downloading updates
3. Make sure you have write permissions in the project directory
4. Try running the command with elevated permissions if needed

## 📁 Project Structure

```
.
├── bin/             # CLI entrypoint
├── src/             # Internal logic
├── test/            # Vitest test files
└── package.json
```

## 🧑‍💻 Author

Michael Becker
[GitHub](https://github.com/seebaermichi)

## 📦 License

MIT
npm package: @nera-static/plugin-link-attributes
Description: A plugin for static side generator Nera to add attributes to external links.
Author: Michael Becker
Latest version: 2.0.4

# @nera-static/plugin-link-attributes

A plugin for the [Nera](https://github.com/seebaermichi/nera) static site generator that automatically adds attributes to external links (e.g. `target="_blank"` and `rel="noopener noreferrer"`). Ensures external links are secure, accessible, and SEO-friendly.

## ✨ Features

- Automatically adds attributes to links starting with `http` or `www`
- Prevents overwriting existing attributes
- Uses a safe and structured HTML parser (Cheerio)
- Configuration via `config/link-attributes.yaml`
- Lightweight and zero-runtime overhead
- Full compatibility with Nera v4.1.0+

## 🚀 Installation

Install the plugin in your Nera project:

```bash
npm install @nera-static/plugin-link-attributes
```

Then publish the default configuration:

```bash
npx @nera-static/plugin-link-attributes run publish-config
```

This creates:

```
config/
└── link-attributes.yaml
```

Nera will automatically detect the plugin and apply the transformations during the build.

## ⚙️ Configuration

Configure link behavior via `config/link-attributes.yaml`:

```yaml
attributes:
  - target="_blank"
  - rel="noopener noreferrer"
```

### Attribute notes

- `target="_blank"`: Opens external links in a new tab.
- `rel="noopener noreferrer"`: Improves security and prevents referrer leakage.
- You can define any valid HTML attributes (e.g., `class="external"`, `aria-label="..."`).

The plugin will not overwrite existing attributes on links.

## 🧩 Usage

No usage setup required – all external links in rendered HTML will be automatically processed during the build. Internal links are left untouched.

### Before

```html
<a href="https://example.com">Example</a>
```

### After

```html
<a href="https://example.com" target="_blank" rel="noopener noreferrer">Example</a>
```

## 🧪 Development

```bash
npm install
npm test
npm run lint
```

Tests use [Vitest](https://vitest.dev) and validate:

- Attributes are added only to external links
- Internal or malformed links are ignored
- Existing attributes are preserved
- Output HTML remains valid and clean

## 🧑‍💻 Author

Michael Becker
[https://github.com/seebaermichi](https://github.com/seebaermichi)

## 🔗 Links

- [Plugin Repository](https://github.com/seebaermichi/nera-plugin-link-attributes)
- [NPM Package](https://www.npmjs.com/package/@nera-static/plugin-link-attributes)
- [Nera Static Site Generator](https://github.com/seebaermichi/nera)

## 🧩 Compatibility

- **Nera**: v4.1.0+
- **Node.js**: >= 18
- **Plugin API**: Uses `getMetaData()` for HTML transformation

## 📦 License

MIT