2.0.0 • Published 6 years ago

makestatic-page-id v2.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

Page Identifier

Generate a page identifier

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



Install

yarn add makestatic-page-id

API

identifier

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.

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 on March 12, 2017

2.0.0

6 years ago

1.0.23

6 years ago

1.0.22

6 years ago

1.0.21

7 years ago

1.0.20

7 years ago

1.0.19

7 years ago

1.0.18

7 years ago

1.0.17

7 years ago

1.0.16

7 years ago

1.0.15

7 years ago

1.0.14

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago