Git Product home page Git Product logo

community-project-boilerplate's Introduction

community-project-boilerplate

Note: this boilerplate is outdated, and should be reviewed before used. There are critical vulnerabilites in the dependencies used for building the site.

Table of Contents generated with DocToc

What is it

A simple community boilerplate to replicate Algolia websites like InstantSearch*.

Requirements

To run this project, you will need:

Initial setup

git clone [email protected]:algolia/community-project-boilerplate.git my-project
cd my-project
nvm use
rm -rf .git
git init
git remote add origin [email protected]:algolia/my-project.git
yarn
yarn docs:update
git add docs README.md CONTRIBUTING.md
git commit -m 'first commit'
git push

You need to activate GitHub pages for your repository (in settings on GitHub), choose "master branch /docs folder".

Every time you want to update your production website, do:

yarn docs:update
git add docs README.md CONTRIBUTING.md
git commit -m 'docs(update): something'
git push

At some point this will be moved to Netlify.

Local development

yarn
yarn start

Go to https://localhost:3000. There should be auto reload for almost everything, but when it fails just restart the server.

Test build

This will run the build of the website and serve it. Useful when you are modifying production middlewares and want to ensure the resulting website will be working. Like when adding CSS minification.

yarn docs:test-build

Changes to be done before going live

Project structure

Assets and links references

To reference assets and links from any HTML page in this website, always reference them from the root of the website, without any leading "." or "/". Links from HTML pages are always relative to the root of your website, not the current file.

To ease hosting on different subpaths (https://community.algolia.com/website/ and http://localhost:3000/), we use a <base href> tag that allow us to easily achieve that.

If your image is in assets/images/image.png then you can reference it in your HTML page like that: <img src="assets/images/image.png" /> and it will always work no matter how the website is hosted.

Same for linking to a particular page, if you are in index.html (or index.md), to link to about/team.html just do this: <a href="about/team.html">team</a>.

For ressources inside CSS files, always use relative paths from the CSS file itself like background-image: url("../assets/image/image.png"));

Deploy previews

deploy preview example image.

If you want to have deploy previews, which are live deployments of your website from pull requests submitted to this repository, please:

  • Go to https://www.netlify.com/
  • Login with GitHub
  • Add "New site from Git"
  • Leave everything by default
  • Go to your Netlify project, click on Deploys > Notifications
  • Open a new tab Login to GitHub on a bot like account (algobot for Algolia)
  • Return to Netlify, add a notification as a GitHub comment
  • Choose "Deploy succeeded"
  • Click on "generate access token in GitHub"

Now the bot you logged in will generate a dedicated token for this project and will be the author of the comments when something new is deployed.

You can now logout from GitHub and login again with your real account.

Contributing

See CONTRIBUTING.

community-project-boilerplate's People

Contributors

haroenv avatar rarkins avatar renovate-bot avatar renovate[bot] avatar vvo 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.