Skip to content

Commit bb3838c

Browse files
committed
Move to new nav location
2 parents 4b28a62 + 11ea98d commit bb3838c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+2652
-7887
lines changed

.github/images/netlify-preview.png

63.8 KB
Loading

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ Gemfile.lock
55
vendor
66
.bundle
77
.sass-cache
8+
.nox
9+
__pycache__/

README.md

+96-61
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,100 @@
11
# Jupyter's main website
22

3-
[![Build Status](https://travis-ci.org/jupyter/jupyter.github.io.svg?branch=master)](https://travis-ci.org/jupyter/jupyter.github.io)
4-
53
This is the source to [Jupyter.org](https://jupyter.org/).
64

7-
# Build instructions
5+
## Build the site locally
86

9-
The site is built using GitHub Pages Jekyll, see [Jekyll
10-
website](https://jekyllrb.com/) for customizing the build process, and detail on how
11-
what where.
7+
The site is built with Jekyll, see [the Jekyll website](https://jekyllrb.com/) for how to customize the build process.
128

13-
# Quick local testing
9+
There are a few ways to build the site locally, see the sections below.
1410

15-
Clone this repository locally, and cd into it:
11+
### Build the site automatically with `nox`
1612

17-
```
18-
git clone https://github.com/jupyter/jupyter.github.io
19-
cd jupyter.github.io
20-
```
13+
The easiest way to build the site locally is by using the [`nox` command line tool](https://nox.thea.codes/). This tool makes it easy to automate commands in a repository, and we have included a `build` command to quickly install the dependencies and build the site.
2114

22-
Install `bundler`, and use it to install the dependencies to build the website:
15+
To build and preview the site locally, follow these steps:
2316

24-
```
25-
gem install bundler
26-
bundle install
27-
```
17+
1. **Clone this repository**.
18+
19+
```console
20+
$ git clone https://github.com/jupyter/jupyter.github.io
21+
$ cd jupyter.github.io
22+
```
23+
2. **Install `nox`**
2824

29-
Now you can ask Jekyll to build the website.
25+
```console
26+
$ pip install nox
27+
```
28+
3. **Run the `build` command**
29+
30+
```console
31+
$ nox -s build
32+
```
3033

31-
```
32-
bundle exec jekyll serve liveserve
33-
```
3434

35-
Open your browser to localhost:4000.
35+
This will install the needed dependencies in a virtual environment using [the `conda` package manager](https://docs.conda.io/en/latest/).
36+
37+
**When the build is finished, go to `localhost:4000`**. When Jekyll finishes building your site, it will open a port on your computer and serve the website there so that you may preview it.
3638

37-
Edit the various parts, the `liveserve` option should automatically rebuild and
38-
refresh the pages when changes occur.
39+
**You can make changes and watch the preview auto-update**. When you make changes to the website, they will automatically be updated in your preview in the browser.
3940

4041
To stop serving the website, press **`Ctrl`**-`C` in your terminal
4142

42-
Enjoy.
43+
### Build the site manually
4344

44-
# What is where
45+
To build the site manually, you'll need Ruby, Jekyll, and the packages that Jekyll uses to build the site (these are defined in [`Gemfile`](Gemfile)).
4546

46-
Most pages are located at the place where their URL is, nothing fancy. Headers
47-
and footer are in `_includes/head.html`, `_includes/header.html`,
48-
`_includes/footer.html`.
47+
Follow these steps:
4948

50-
The **navbar** is in `_data/nav.yml` and looks like that:
49+
1. **Install Jekyll**. You have two options:
50+
- [Follow the Jekyll installation instructions](https://jekyllrb.com/docs/#instructions). These steps will guide you through installing Ruby and Jekyll locally.
51+
- Use [the anaconda distribution](https://conda.io) and [conda-forge](https://conda-forge.org/).
5152

52-
```
53-
head:
54-
- Home
55-
- title: Install
56-
url: https://jupyter.readthedocs.io/en/latest/install.html
57-
- About
58-
- title: Documentation
59-
url: https://jupyter.readthedocs.io/en/latest/install.html
60-
- title: Blog
61-
url: https://blog.jupyter.org
62-
- Donate
63-
```
53+
First [install miniconda](https://conda.io/miniconda.html), then run the following command:
54+
55+
```console
56+
$ conda install -c conda-forge ruby c-compiler compilers cxx-compiler
57+
```
58+
59+
Finally install Jekyll and Bundler, which will let you install the site's dependencies:
60+
61+
```console
62+
$ gem install jekyll bundler
63+
```
64+
2. **Install the site's build dependencies**. These are specified in [`Gemfile`](Gemfile).
65+
66+
```console
67+
$ bundle install
68+
```
69+
70+
This step might take a few moments as it must download and install a number of local extensions. It will create a local file called `Gemfile.lock`. These are the "frozen" dependencies and their version numbers needed to build the site.
71+
72+
3. **Build the site locally**.
73+
74+
```console
75+
$ bundle exec jekyll serve liveserve
76+
```
6477

65-
which means, insert in order the following links into the navbar:
78+
This will build the site's HTML and open a server at `localhost:4000` for you to preview the site.
6679

67-
- Link to `Home` page, guess the url by yourself.
68-
- link to `Install` page, the url is...
69-
- Link to `About`, guess the url by yourself,
70-
- ... etc.
7180

72-
The navbar will automatically target `_blank` pages where the url is explicit,
73-
and mark the correct link as the "current" one.
81+
## Where the site is hosted
7482

75-
# How do I create a new page?
83+
The site is automatically built with [Netlify](https://netlify.com), a hosting service for static websites. When any changes are merged into the `master` branch, Netlify will automatically build them and update the website at [jupyter.org](https://jupyter.org).
84+
85+
## Preview changes in a Pull Request
86+
87+
Netlify will automatically build a preview of the website in an open Pull Request. To see this, click on the **`Show all checks`** button just above the comment box in the Pull Request window. Then click on the **`details`** link on the **`deploy/netlify`** row to see a preview of the built site.
88+
89+
Here's an image of this box on a GitHub PR page:
90+
91+
![Netlify Preview Button](.github/images/netlify-preview.png)
92+
93+
## Structure of this website
94+
95+
Most pages are located at the place where their URL is, nothing fancy. Some are written in HTML. Others are written in Markdown. The homepage is in `index.html. The about page is in `about.md`.
96+
97+
## Create a new page
7698

7799
Create `my_page.html` (will have url `https://jupyter.org/my_page.html`)
78100
or `my_page/index.html` (will have url `https://jupyter.org/my_page/`), start with the following:
@@ -90,19 +112,32 @@ You cannot do it yet with .md file, but you will be able soon.
90112

91113
Add commit (and don't forget to add to `_data/nav.yml`).
92114

93-
# Continuous integration testing on Travis
115+
## Site quirks and tips
94116

95-
Travis will run and test:
117+
### SCSS variables
96118

97-
- jekyll build
98-
- html-proofer
99-
- csslint
119+
Shortcuts with colors and other common variables can be found in `_sass/settings`. They can be used in SCSS files.
100120

101-
# Previewing a Pull Request
121+
```scss
122+
@import "settings/colors"
102123

103-
Netlify is used to provide a link to a rendered website with the changes proposed
104-
in a PR. This convenience helps reviewers see how the change would look
105-
before it is deployed in production.
124+
a {
125+
color: $orange;
126+
}
127+
```
106128

107-
The link is found in the GitHub PR status box. In the **deploy/netlify** section,
108-
click on the `Details` link.
129+
### Lazy loading of images
130+
131+
The Jupyter website uses [lazy loading of images](https://web.dev/browser-level-image-lazy-loading/). In general, images that are "below the fold" (below the browser window on page load) for laptop-sized screen sizes are encouraged to be configured for "lazy loading".
132+
133+
Add lazy loading to an image by adding a `loading="lazy"` configuration to the `<img>` element. For example:
134+
135+
```html
136+
<img class="my-class" src="my/src.png" loading="lazy" />
137+
```
138+
139+
For images that are "above the fold" (that will be seen by users immediately after page load), use "eager" loading to make sure they are loaded immediately. For example:
140+
141+
```html
142+
<img class="my-class" src="my/src.png" loading="eager" />
143+
```

_data/nav.yml

-19
This file was deleted.

_data/try.yml

-55
This file was deleted.

_includes/cards.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ <h4 class="col-sm-12">{{include.cohort_name}}</h4>
77
<img
88
class="council-member-photo"
99
alt="{{member.name}}"
10-
src='{{site.baseurl}}/assets/distinguished/{{member.photo}}' />
10+
src='{{site.baseurl}}/assets/distinguished/{{member.photo}}'
11+
loading="lazy"
12+
/>
1113
<div class="card-header text-nowrap">{{member.name}}</div>
1214
<div>&nbsp;</div>
1315
<div class='badges'>

0 commit comments

Comments
 (0)