This repository hosts the homepage of the Astropy Learn project, https://learn.astropy.org, and serves the tutorial content from the astropy-learn organization. The site itself is built with Gatsby and the Algolia search service. Records for the Algolia database are curated and formatted by the learn-astropy-librarian app.
Create a fork on https://github.com/astropy-learn/learn.
npm installYou can run a development server that will serve the site and reload as you develop the app:
npm run developBy default the app is hosted at http://localhost:8000. You can also interact with the GraphQL data layer by browsing
npm run buildPreview the built site by running:
npm run serveThis app uses ESLint to lint JavaScript, which in turn runs Prettier to format JavaScript. The configuration is based on wesbos/eslint-config-wesbos.
A Git pre-commit hooks runs both ESLint and Prettier and automatically lints and reformats code before every commit. These hooks are run by husky and should already be installed when you ran npm install.
To manually lint the code base:
npm run lintTo also fix issues and format the code base:
npm run lint:fixIdeally your editor will also apply eslint/prettier on save, though these commands are handy as a fallback.
This project is intended to be built with a Node.js version that's encoded in the .nvmrc file. To adopt this Node version, we recommend installing and using the node version manager.
Then you can use the preferred node version by running nvm from the project root:
nvm useLearn more about Gatsby:
Learn more about Algolia: