Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.hugo*
*~
resources/
public/
_build/
content/_build/
.DS_Store
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "themes/scientific-python-hugo-theme"]
path = themes/scientific-python-hugo-theme
url = https://github.com/scientific-python/scientific-python-hugo-theme
[submodule "external-content/cookie"]
path = external-content/cookie
url = https://github.com/scientific-python/cookie
22 changes: 14 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: help prepare cookie external html serve clean
.PHONY: help prepare cookie external html serve build-serve clean
.DEFAULT_GOAL := help

# Add help text after each target name starting with '\#\#'
Expand All @@ -18,17 +18,23 @@ cookie:

external: cookie

html: ## Build learn site (without external content) in `./public`
html: ## Build learn site in `./content/_build/html`
html: prepare
hugo
(cd content && myst build --html)

html-all: ## Buildlearn site (with external content) in `./public`
html-all: html external
html-all: ## Build learn site with external content in `./public`
html-all: html
mkdir -p public && cp -r content/_build/html/. public/
$(MAKE) external

serve: ## Serve site, typically on http://localhost:1313
serve: ## Serve site, typically on http://localhost:3000
serve: prepare
@hugo --printI18nWarnings server
(cd content && myst start)

build-serve: ## Build full site (learn + cookie) and serve `./public` at http://localhost:3000
build-serve: html-all
python3 scripts/serve.py 3000 public

clean: ## Remove built files
clean:
rm -rf public
rm -rf content/_build public
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,36 @@
# learn.scientific-python.org

Source for [learn.scientific-python.org](https://learn.scientific-python.org),
built with [MyST-MD](https://mystmd.org/) (the `mystmd` CLI).

## Layout

- `content/` — the MyST source project (`myst.yml` lives here). This is the
main site.
- `external-content/cookie/` — the [cookie](https://github.com/scientific-python/cookie)
submodule, a separate MyST site. Its build is overlaid at `/development/`.
- `public/` — build output. The merged, deployable static site (main +
cookie). Written by `make html-all`; published by Netlify.

## Prerequisites

- **mystmd** — the `myst` CLI. See the
[MyST install guide](https://mystmd.org/guide/quickstart).
- **Node** — the cookie overlay builds via `npx mystmd`, so a full build needs
Node available.
- **git** — the cookie content is a submodule; `make prepare` initializes it.

## Local development

| Command | What it does |
| ------------------ | ----------------------------------------------------------------------- |
| `make serve` | Live-reload dev server for the **main site only**, at `localhost:3000`. |
| `make html` | Build the main site to `content/_build/html/`. |
| `make html-all` | Build main + cookie, merged into `public/`. |
| `make build-serve` | Run `html-all`, then serve the full merged site at `localhost:3000`. |
| `make clean` | Remove build output (`content/_build`, `public/`). |

**Previewing `/development/` (cookie) locally:** `make serve` (and `myst start`)
serve `content/` only — the cookie overlay is **not** visible there. To preview
the full site, including `/development/`, use `make build-serve`. It is a static
build (no live reload); rerun it after edits.
3 changes: 0 additions & 3 deletions assets/css/custom.css

This file was deleted.

73 changes: 0 additions & 73 deletions config.yaml

This file was deleted.

7 changes: 7 additions & 0 deletions content/.copier-answers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: 9002ff6
_src_path: gh:scientific-python/scientific-python-myst-theme
favicon: https://raw.githubusercontent.com/scientific-python/scientific-python.org/main/static/favicon.ico
footer_items_json: assets/json/footer_items.json
project_name: Learn Scientific Python
project_url: learn.scientific-python.org
File renamed without changes.
135 changes: 135 additions & 0 deletions content/assets/css/scientific-python.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
body {
display: flex;
flex-direction: column;
min-height: 100vh;
}

main {
min-height: 0;
flex: 1 0 auto;
}

.article.content {
/* Override 100vh from myst-theme:styles/typography.css so content div
* doesn't grow <main> to push the footer offscreen.
*/
min-height: 0;
}

.footer {
/* Make footer "sticky" to page bottom (also the above flex rules), per
* the flexbox strategy described here:
* https://css-tricks.com/couple-takes-sticky-footer/#aa-there-is-flexbox
* and here:
* https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/
* This solution does not require hardcoding a fixed footer height in the
* style rules.
*/
flex-shrink: 0;
background: #013243;
color: white;
padding-left: 2rem;
padding-right: 2rem;

/* Outer content grid */
& .outer-grid {
/* logo, project description, link columns, social icons */
grid-template-columns: 2fr 6fr 8fr 3fr;
column-gap: 4rem;
align-items: center;
margin: 0rem 4rem;

& li {
list-style: none;
}
}

@media (max-width: 640px) {
& .outer-grid {
grid-template-columns: 1fr;
justify-items: start;
}
}

/* Heading colours */
& a,
h1,
h2,
h3,
h4,
h5,
h6 {
color: white;
}

& h1 {
font-size: 1.25rem;
font-weight: bold;
}
& .footer-links {
column-gap: 1.5rem;
line-height: normal;

& a {
color: white;
text-decoration-color: white;
inline-size: min-content;
display: inline-block;
text-wrap: nowrap;
}
}

& .footer-icons {
column-gap: 3rem;
row-gap: 1rem;

& img {
filter: invert(100%);
margin-bottom: 0.1rem;
margin-top: 0.1rem;
min-width: 1.75rem;
width: 1.75rem;
}
}
}

.footer-logo {
min-width: 60px;
}

/* Hide download button */
.myst-fm-downloads-button {
display: none;
}

/* Set site title bold */
.myst-home-link {
font-weight: bold;
}

/* Unsure where this CSS came from, but keeping it for now */
/* --- Make layout feel less "book-ish" and closer to a website --- */
.bd-main .bd-content .bd-article-container {
max-width: 900px; /* keep readable, less wide than default "docs" feel */
}

h1,
h2,
h3,
h4 {
letter-spacing: -0.01em;
}

/* Slightly tighten the top spacing so it feels more like a marketing/docs site */
.bd-header {
box-shadow: none;
}

/* If the left sidebar feels too dominant, reduce its visual weight */
.bd-sidebar-primary {
border-right: 0;
}

.copyright {
font-size: smaller;
}
8 changes: 8 additions & 0 deletions content/assets/icons/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
You can find more free icons at:

- https://fonts.google.com/icons (Search and then click the SVG download button at the bottom of the right-hand column.)
- https://simpleicons.org/

Apache licensed, but with a notice at https://github.com/google/material-design-icons:

> We'd love attribution in your app's about screen, but it's not required.
1 change: 1 addition & 0 deletions content/assets/icons/bluesky.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions content/assets/icons/discord.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions content/assets/icons/discourse.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions content/assets/icons/facebook.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions content/assets/icons/github.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions content/assets/icons/instagram.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions content/assets/icons/linkedin.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions content/assets/icons/mail.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions content/assets/icons/mastodon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions content/assets/icons/rss-feed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions content/assets/icons/scientific-python.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions content/assets/icons/sent.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions content/assets/icons/tiktok.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading