|
1 | | -PecanProject.github.io |
2 | | -====================== |
| 1 | +# PEcAn Project Website |
3 | 2 |
|
4 | | -PEcAn webpage |
| 3 | +This repository contains the content of the PEcAn Project website. |
| 4 | + |
| 5 | +This README is written for members of the PEcAn Project community who wish to add content to or otherwise modify the website. |
| 6 | +The website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator. |
| 7 | +The [Docusaurus Documentation](https://docusaurus.io/docs) provides details on maintaining the website; this README is not intended to replace the Docusaurus documentation. |
| 8 | +Rather, it is intended to provide a brief introduction to common tasks as well as project specific information. |
| 9 | + |
| 10 | +This site was created by Eshan Tripathi with mentorship from Prakher Prashank as part of [GSoC '21](https://summerofcode.withgoogle.com/). |
| 11 | + |
| 12 | +## Table of contents |
| 13 | + |
| 14 | +<details open="open"> |
| 15 | + <summary>Table of Contents</summary> |
| 16 | + <ol> |
| 17 | + <li> |
| 18 | + <a href="#getting-started">Getting Started</a> |
| 19 | + <ul> |
| 20 | + <li><a href="#prerequisites">Prerequisites</a></li> |
| 21 | + <li><a href="#installation">Installation</a></li> |
| 22 | + <li><a href="#local-development">Local Development</a></li> |
| 23 | + <li><a href="#build">Build</a></li> |
| 24 | + </ul> |
| 25 | + </li> |
| 26 | + <li> |
| 27 | + <a href="#adding-content">Adding Content</a> |
| 28 | + <ul> |
| 29 | + <li><a href="#feature-cards">Feature Cards</a></li> |
| 30 | + <li><a href="#pecan-people">PEcAn People</a></li> |
| 31 | + <li><a href="#blog">Blog</a></li> |
| 32 | + </ul> |
| 33 | + </li> |
| 34 | + <li><a href="#screenshots">Screenshots</a></li> |
| 35 | + <li><a href="#contributing">Contributing</a></li> |
| 36 | + <li> |
| 37 | + <a href="#next-steps">Next Steps</a> |
| 38 | + <ul> |
| 39 | + <li><a href="#optimising-documentation">Optimising documentation</a></li> |
| 40 | + <li><a href="#adding-tutorials">Adding tutorials section</a></li> |
| 41 | + <li><a href="#blog">Blog</a></li> |
| 42 | + </ul> |
| 43 | + </li> |
| 44 | + </ol> |
| 45 | +</details> |
| 46 | + |
| 47 | +## Getting Started - Setting up the project for local development |
| 48 | + |
| 49 | +This section will help one to setup the project for local development. |
| 50 | + |
| 51 | +### Requirements |
| 52 | + |
| 53 | +- Node version >= 12.13.0 |
| 54 | +- yarn |
| 55 | + |
| 56 | +This project has been built using [Docusaurus 2](https://docusaurus.io/), which requires Node version >=12.13.0, you can check this using `node -v`. [Install node](https://nodejs.org/en/download/). |
| 57 | +Make sure yarn is installed. [Install yarn](https://classic.yarnpkg.com/en/docs/install/#debian-stable). |
| 58 | + |
| 59 | +### Installation |
| 60 | + |
| 61 | +```console |
| 62 | +yarn install |
| 63 | +``` |
| 64 | + |
| 65 | +### Local Development |
| 66 | + |
| 67 | +```console |
| 68 | +yarn start |
| 69 | +``` |
| 70 | + |
| 71 | +This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. |
| 72 | + |
| 73 | +### Build |
| 74 | + |
| 75 | +```console |
| 76 | +yarn build |
| 77 | +``` |
| 78 | + |
| 79 | +This command generates static content into the `build` directory and can be served using any static contents hosting service. |
| 80 | + |
| 81 | +## Adding Content |
| 82 | + |
| 83 | +This describes how to add or modify the Website's content. |
| 84 | + |
| 85 | +### Add or Edit Feature Cards |
| 86 | + |
| 87 | +Feature Cards on the website homepage highlight the key features of the PEcAn Project. |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | +To modify the feature cards- |
| 92 | + |
| 93 | +- Navigate to `src/components/HomepageFeatures.js` |
| 94 | +- Navigate to `const FeatureList` inside `HomepageFeatures.js` |
| 95 | + |
| 96 | + |
| 97 | + |
| 98 | +Every item inside the `FeatureList` array contains a JavaScript object enclosed `{}` and separated by `,` . |
| 99 | +Each of these objects is a feature that is displayed on the homepage and contains a `title`, `Svg` and `description`. |
| 100 | +You can edit or remove feature cards and the changes will be reflected after the code passes build test. |
| 101 | +If you are adding or editing an image file, the image file must is present inside `static/img` directory, otherwise the compiler would return an error. |
| 102 | +You should use SVG images when available. |
| 103 | + |
| 104 | +### Add or Edit a Person (Contributors) |
| 105 | + |
| 106 | +The people page contains details of the PEcAn team. The image here is a representation of how the page should look like with placeholder values. |
| 107 | + |
| 108 | + |
| 109 | + |
| 110 | +```javascript |
| 111 | +const contributors = [ |
| 112 | + { |
| 113 | + name: "John Doe", |
| 114 | + |
| 115 | + role: "Lead PEcAn Developer", |
| 116 | + education: "PhD at MIT, USA", |
| 117 | + img: "https://previews.123rf.com/images/stockbroker/stockbroker1710/stockbroker171000524/89639450-portrait-of-a-young-smiling-professional-man-arms-crossed.jpg", |
| 118 | + }, |
| 119 | +]; |
| 120 | +``` |
| 121 | + |
| 122 | +To add and modify information move to the `static/utils/contributors.js` file. |
| 123 | +It contains an array called `contributors` which contains JavaScript objects which are enclosed by `{}` and contain following fields- |
| 124 | + |
| 125 | + |
| 126 | + |
| 127 | +To add a contributor: |
| 128 | + |
| 129 | +1. Copy an existing user's information and paste as a new object in the appropriate order. |
| 130 | +2. Make sure two objects are separated by a `,`. |
| 131 | +3. Edit information in the pasted object. |
| 132 | +4. Add an image to `static/img/people` |
| 133 | +5. Add link to image |
| 134 | +6. Build site and check that the new contributor record appears where expected |
| 135 | + |
| 136 | +The new contributor and / or any changes will appear on the website automatically after changes are successfully merged into the main branch. |
| 137 | + |
| 138 | +### Add or Edit a Blog Post |
| 139 | + |
| 140 | +A link to blog posts can be found in the navigation menue at the top of the website. |
| 141 | +The Docusaurus blog feature is described in detail in the [Docusaurus documentation](https://docusaurus.io/docs/blog). |
| 142 | +By default when someone clicks on `blog` link they will be directed to a page containing list of all present blogs on the website. |
| 143 | + |
| 144 | +Steps to add a blog post: |
| 145 | + |
| 146 | +1. Create a new file named `blog/yyyy-mm-dd-title.md` |
| 147 | +2. In the top of your blog file add a yaml header. |
| 148 | +3. Add at least `title`, `author` and `tags` yaml fields. |
| 149 | + - These metadata fields help with search and navigation on the site. |
| 150 | + - These and other yaml header options are described in the [blog header options](https://docusaurus.io/docs/blog#header-options) section of the Docusaurus documentation. |
| 151 | +4. writing your blog and save the file. |
| 152 | +5. any images can be put in `static/img/` and referenced using a relative path `static/img/myimage.png` |
| 153 | +6. build the website to make sure the blog shows up as expected |
| 154 | +7. After the new changes are merged into the main branch, the new blog post will appear on the website. |
| 155 | + |
| 156 | +```yml |
| 157 | +title: GSoC '21 Report- Webpage Updates |
| 158 | +author: Eshan Tripathi |
| 159 | +author_title: GSoC'21 participant @PEcAn Project |
| 160 | +author_url: https://github.com/eshantri |
| 161 | +author_image_url: https://avatars.githubusercontent.com/u/48446729?v=4 |
| 162 | +tags: [gsoc, gsoc21] |
| 163 | +``` |
| 164 | +
|
| 165 | +## Screenshots |
| 166 | +
|
| 167 | +This section contains screenshots of website's homepage in light and dark theme. |
| 168 | +
|
| 169 | + |
| 170 | +
|
| 171 | + |
| 172 | +
|
| 173 | +## Contributing |
| 174 | +
|
| 175 | +This is an open source project and contributions are what make an open source community. |
| 176 | +Everyone is welcome to contribute to this project. |
| 177 | +All involved are expected to follow the [PEcAn code of conduct](https://pecanproject.github.io/pecan-documentation/master/contributor-covenant-code-of-conduct.html) and contribute to a positive and inclusive environment. |
| 178 | +
|
| 179 | +First time contributors are welcome. Contributions can be very simple, make sure to check out beginner friendly issues, if present. |
| 180 | +
|
| 181 | +## Next Steps |
| 182 | +
|
| 183 | +This section contains future plans for the website. New contributors can use this section as a reference for planning their contributions. |
| 184 | +
|
| 185 | +### Optimising Documentation |
| 186 | +
|
| 187 | +At present the PEcAn's documentation is being served from (<https://pecanproject.github.io/pecan-documentation/master/>) using an iframe. While this saves a lot of overhead in converting Rmd files in (<https://github.com/PecanProject/pecan/tree/develop/book_source>) to md files so that docusaurus could render them, it also increases the loading time for documentation, it also looks less consistent. |
| 188 | +In future, it is suggested to find an optimised way to convert rmd files to md and integrate them via docusaurus's native documentation parser. |
| 189 | +
|
| 190 | +### Adding tutorials section |
| 191 | +
|
| 192 | +The tutorials section from old site need to be migrated into the new site. |
| 193 | +One can find tutorials here (<https://github.com/PecanProject/pecan/tree/develop/documentation/tutorials>). |
0 commit comments