Skip to content

Commit 55bef2e

Browse files
stefanvagoose77choldgraf
authored
👣 Add example footer (#1)
* Add example footer * Tweak footer * Remove error from index * Use footer-descriptiong and footer-column blocks * Add footer styling * wip: styling * fix: remove broken style * feat: use col-screen * Further iterate on footer spacing and adjust content for landing pages * Update documentation for grids to be more understandable --------- Co-authored-by: Angus Hollands <[email protected]> Co-authored-by: choldgraf <[email protected]>
1 parent 89a8445 commit 55bef2e

File tree

4 files changed

+106
-10
lines changed

4 files changed

+106
-10
lines changed

css/footer.css

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
.footer {
2+
background: #013243;
3+
color: white;
4+
padding-left: 2rem;
5+
padding-right: 2rem;
6+
7+
/* Outer content grid */
8+
& .outer-grid {
9+
/* spacer, project description, spacer, link columns, spacer */
10+
grid-template-columns: 0.1fr 3fr 3fr 4fr 0.1fr;
11+
align-items: center;
12+
margin-bottom: 0rem;
13+
14+
& li {
15+
list-style: none;
16+
}
17+
18+
}
19+
20+
/* Heading colours */
21+
& a,
22+
h1,
23+
h2,
24+
h3,
25+
h4,
26+
h5,
27+
h6 {
28+
color: white;
29+
}
30+
31+
& h1 {
32+
font-size: 1.25rem;
33+
font-weight: bold;
34+
}
35+
}

footer.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
% This defines the footer of the site, and is not parsed as a regular "page"
2+
% We point to it with the following in `myst.yml`:
3+
% site:
4+
% parts:
5+
% footer: footer.md
6+
7+
% Here we use `grid` to add a basic grid structure to the HTML,
8+
% but the formatting column sizes are defined manually in css/footer.css
9+
% see the `grid-template-columns` line.
10+
:::::{grid} 3 3 5 5
11+
:class: outer-grid col-screen
12+
13+
<!-- Left spacer -->
14+
::::{div}
15+
::::
16+
17+
<!-- Project description -->
18+
::::{div}
19+
20+
# Landing Pages
21+
22+
```{image} https://jupyterbook.org/en/stable/_images/logo-square.svg
23+
:width: 50px
24+
:align: left
25+
```
26+
27+
This is a description of our project. And a [link to its homepage](https://github.com/jupyter-book/example-landing-pages).
28+
::::
29+
30+
<!-- Spacer between project description and links columns -->
31+
::::{div}
32+
::::
33+
34+
<!-- Link columns -->
35+
% This a *second* grid embedded within the first one, to create nicer
36+
% responsive design experience. This grid will have a single column on narrow screens,
37+
% and fan out into three columns on wide screens. However, it always remains within
38+
% its parent grid column.
39+
::::{grid} 1 1 3 3
40+
41+
:::{div}
42+
43+
- [About](https://mystmd.org/overview/ecosystem)
44+
- [Guide](https://mystmd.org/guide)
45+
- [Sandbox](https://mystmd.org/sandbox)
46+
:::
47+
48+
:::{div}
49+
50+
- A second column!
51+
- With multiple entries
52+
:::
53+
54+
:::{div}
55+
56+
- And what about a third
57+
:::
58+
59+
::::
60+
61+
<!-- Right-most spacer -->
62+
::::{div}
63+
::::
64+
65+
:::::

index.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
title: Welcome to My Landing Page
33
site:
4-
hide_outline: true
5-
hide_toc: true
64
hide_title_block: true
5+
hide_toc: true
6+
hide_outline: true
77
---
88

99
+++ { "kind": "split-image" }
@@ -102,11 +102,3 @@ A wild caption appeared!
102102
+++ { "kind": "no-such-block" }
103103

104104
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
105-
106-
## Error State
107-
108-
When you do not provide an image to the `split-image` block, it will error at you and look like this:
109-
110-
+++ { "kind": "split-image" }
111-
112-
Uh oh, no image!

myst.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@ site:
1212
favicon: favicon.ico
1313
logo: site_logo.png
1414
logo_text: Landing Pages
15+
style: ./css/footer.css
16+
17+
parts:
18+
footer: footer.md

0 commit comments

Comments
 (0)