# makestatic-page-id

> Utility to generate a page identifier

Latest version **2.0.0** (published 2018-05-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install makestatic-page-id
pnpm add makestatic-page-id
yarn add makestatic-page-id
bun add makestatic-page-id
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2018-05-23 |
| First published | 2017-01-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node |  >= 6.1.x |
| Dependencies | 0 |
| Unpacked size | 4.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | muji |
| Maintainers | muji, tmpfs |
| Keywords | makestatic, page, id, css |

## Links

- npm: https://www.npmjs.com/package/makestatic-page-id
- Repository: https://github.com/makestatic/compiler
- Homepage: https://makestatic.ws
- Issues: https://github.com/makestatic/compiler/issues
- npm.io page: https://npm.io/package/makestatic-page-id

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2018-05-23
- 1.0.23 — 2018-01-18
- 1.0.22 — 2018-01-17
- 1.0.21 — 2017-03-08
- 1.0.20 — 2017-03-08
- 1.0.19 — 2017-03-07
- 1.0.18 — 2017-03-04
- 1.0.17 — 2017-02-28
- 1.0.16 — 2017-02-25
- 1.0.15 — 2017-02-21
- 1.0.14 — 2017-02-21
- 1.0.13 — 2017-02-15
- 1.0.12 — 2017-02-14
- 1.0.11 — 2017-02-12
- 1.0.10 — 2017-02-11
- … 10 more at https://npm.io/package/makestatic-page-id/versions

## README

# Page Identifier

> Generate a page identifier

Generates a page identifier to expose to template locals for CSS scoping.

---

- [Install](#install)
- [API](#api)
  - [identifier](#identifier)
- [License](#license)

---

## Install

```
yarn add makestatic-page-id
```

## API

### identifier

```javascript
identifier(ctx)
```

Generates an identifier for a file.

Useful when exposing template locals so that the identifier can be assigned
to an element to allow easier CSS scoping.

The generated identifier is equal to the file name with the file extension
removed unless the page is an index page.

If the page is an index page and is not at the context root the name of the
parent directory is used, if the index page is at the root then the file
name is used.

```javascript
identifier({resourcePath: '/index.html'})      // index
identifier({resourcePath: '/features.html'})   // features
identifier({resourcePath: '/api/index.html'})  // api
```

Returns a page identifier.

* `ctx` Object the webpack loader context.

## License

MIT

---

Created by [mkdoc](https://github.com/mkdoc/mkdoc) on March 12, 2017

[docs]: https://makestatic.ws/docs/ "Documentation"
[standalone manual]: https://github.com/makestatic/website/blob/master/MANUAL.md "Standalone Manual"
[yarn]: https://yarnpkg.com "Yarn"
[webpack]: https://webpack.js.org "Webpack"
[babel]: https://babeljs.io "Babel"
[postcss]: http://postcss.org "Postcss"
[sugarss]: https://github.com/postcss/sugarss "Sugarss"
[reshape]: https://github.com/reshape/reshape "Reshape Source Code"
[reshapeml]: https://reshape.ml "Reshape"
[clean-css]: https://github.com/jakubpawlowicz/clean-css "Clean CSS"
[html-minifier]: https://github.com/kangax/html-minifier "Html Minifier"
[uglify-js]: https://github.com/mishoo/UglifyJS2 "Uglify JS"
[imagemin]: https://github.com/imagemin/imagemin "Imagemin"
[mkdoc]: https://github.com/mkdoc/mkdoc "Mkdoc"
[browsersync]: https://www.browsersync.io "Browsersync"
[yeoman]: http://yeoman.io "Yeoman"
[spike]: https://www.spike.cf "Spike"
[validator]: https://github.com/validator/validator "HTML Validator"
[github pages]: https://pages.github.com "Github Pages"
[amazon s3]: https://aws.amazon.com/s3/ "Amazon S3"
[google sitemaps]: https://support.google.com/webmasters/answer/183668?hl=en&ref_topic=4581190 "Google Sitemaps"
[sitemaps]: https://www.sitemaps.org/ "Sitemaps"

---
_Source: https://npm.io/package/makestatic-page-id · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
