Code Monkey home page Code Monkey logo

preact-www's Introduction

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

preact-www's People

Contributors

marvinhagemeister avatar developit avatar size-plugin[bot] avatar vitormalencar avatar prateekbh avatar lcxfs1991 avatar hassanbazzi avatar joaolucasl avatar 38elements avatar rosskhanas avatar reznord avatar huruji avatar pazguille avatar impronunciable avatar addyosmani avatar tao1991123 avatar jovidecroock avatar andrewiggins avatar robertknight avatar david-zzg avatar rykdesjardins avatar download avatar shaedrich avatar marabyte avatar dandv avatar sapegin avatar danielbayerlein avatar pl12133 avatar malcolmyu avatar paranoidjk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.