Silex
Silex copied to clipboard
Pageable script rewrite
Pageable script is a js script used in Silex. It is used only before publication - in the editor and the preview. It makes it possible to have the hole website in 1 single HTML page. It mimics a normal website navigation but instead of having multiple pages at different paths, it handles deep links or URL hash: https://editor.silex.me/ ... /editable.html#!page-home
Current state
- depends on jquery + jquery UI
- is included in Silex repo
- it is strange to interact with it from the editor
Pageable script should have 1 single feature: watch current URL and add .pageable-hide
, .pageable-show
css classes to corresponding .pageable
Also it should
- no jquery, no dependencies
- basic documentation
- npm package
- ? use history API
- options:
- pageable selector (
[data-pageable]
by default) - show class (
.pageable-show
) - hide class (
.pageable-hide
) - hash prefix (
#!page-
)
- pageable selector (
Todo in Silex
- in preview links should be real links with
href="#!page-
- change page => change iframe hash