Skip to content

๐Ÿ“– Preact documentation website.

License

Notifications You must be signed in to change notification settings

JDLT-Ltd/preact-www

This branch is 4 commits ahead of, 786 commits behind preactjs/preact-www:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

2fbfcec ยท Jun 15, 2021
Dec 27, 2020
May 11, 2021
Jun 15, 2021
Apr 27, 2020
Jul 15, 2019
Oct 3, 2020
Aug 1, 2019
Dec 29, 2020
Feb 14, 2019
Jan 12, 2021
Dec 27, 2020
Mar 6, 2020
Apr 16, 2021
Jul 14, 2020
Apr 12, 2021
Apr 12, 2021
Apr 12, 2021
Nov 14, 2020
Jul 14, 2020

Repository files navigation

Preact Documentation Website

Build Status Preact Slack Community

Built with preact-cli

๐Ÿš€ master is automatically deployed to preactjs.com


Application Structure

This website is built as a prerendered static app, following the Application Shell pattern.

Content

Content is fetched and rendered on the fly from Markdown documents located in content/, similar to how Jekyll works. Documents can contain optional YAML FrontMatter for specifying page metadata or layout information. Once fetched, content is parsed using marked and rendered to VDOM via preact-markup.

Custom Elements

Since preact is used to render the Markdown content, HTML contained in a document reference any of the Components listed in src/components/widget.js as Custom Elements, useful for dynamic content:

## Example Page

<!-- Jumbotron and Logo are actually Preact components! -->
<jumbotron>
    <h1><logo text>Preact</logo></h1>
</jumbotron>

Navigation

Currently, the navigation menu and route handling is controlled by src/config.json. This is likely to change, but in the meantime it means any new pages must be linked from the "nav" section of the config.


Local Development

Clone & Install Dependencies

git clone https://github.com/preactjs/preact-www.git
cd preact-www

npm install

Development Workflow

To start a live-reload development server:

PORT=8080 npm run dev

Any time you make changes within the src directory, it will rebuild and even refresh your browser.

Generate a production build in ./build:

npm run build

License

MIT

About

๐Ÿ“– Preact documentation website.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 70.0%
  • Less 26.2%
  • HTML 2.2%
  • CSS 1.6%