Skip to content

Commit

Permalink
Translations (#161)
Browse files Browse the repository at this point in the history
* lock update

* move english files to new directory

* fragments

* wip - index page refactor

* 404 site nav and page head component

* wip index content parity

* exercise index navigation

* content parity with room for improvement

* remove unfinished tests
  • Loading branch information
mimiflynn authored Dec 18, 2024
1 parent 57c1561 commit efdfe22
Show file tree
Hide file tree
Showing 184 changed files with 818 additions and 636 deletions.
18 changes: 0 additions & 18 deletions site/content/exercises/circuitpython/index.mdx

This file was deleted.

25 changes: 25 additions & 0 deletions site/content/exercises/en-US/circuitpython/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
order: 1
title: CircuitPython
category: CircuitPython
---

![Mu Blink](../../../images/circuitpython/mu.png)

## Introduction to CircuitPython - Level 1

This is the original single day workshop with Circuit Playground Express and CircuitPython. Includes an overview of the board's sensors and lights through code. Allows students to dig into an aspect of the device they enjoy for an afternoon of exploration.

[Go to exercises](/exercises/en-US/circuitpython/level-1/)

## Programming with CircuitPython - Level 2

This course builds on the original single day workshop with Circuit Playground Express and CircuitPython to fill out the student's understanding of basic programming concepts.

[Go to exercises](/exercises/en-US/circuitircuitpython/level-2/)

## Programming with CircuitPython - Robotics

This course builds on the original single day workshop with Circuit Playground Express and CircuitPython to fill out the student's understanding of basic programming concepts.

[Go to exercises](/exercises/en-US/circuitircuitpython/robotics/)
10 changes: 10 additions & 0 deletions site/content/exercises/en-US/circuitpython/level-1/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
order: 1
title: CircuitPython with Circuit Playground Express
category: CircuitPython
level: 1
---

import Setup from '../../circuitpython/start-here.mdx';

<Setup />
14 changes: 14 additions & 0 deletions site/content/exercises/en-US/circuitpython/level-2/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
order: 1
title: CircuitPython
category: CircuitPython
level: 2
---

![Mu Blink](../../images/circuitpython/mu.png)

## Introduction to CircuitPython - Level 1

This is the original single day workshop with Circuit Playground Express and CircuitPython. Includes an overview of the board's sensors and lights through code. Allows students to dig into an aspect of the device they enjoy for an afternoon of exploration.

[Go to exercises](/exercises/en-US/circuitpython/level-1/)
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ while True:
- [cp.play_tone](https://docs.circuitpython.org/projects/circuitplayground/en/latest/api.html#adafruit_circuitplayground.circuit_playground_base.CircuitPlaygroundBase.play_tone)

## Making Music
If you want to try out some music here are variables you need to get started. See below for [sample songs](http://opensource.morganstanley.com/exercises/circuitpython/robotics/E3/#sample-songs).

If you want to try out some music here are variables you need to get started. See below for [sample songs](http://opensource.morganstanley.com/exercises/en-US/circuitpython/robotics/E3/#sample-songs).

Copy these musical note variables into your code:

```python
deep_A = 116.541
deep_B = 123.471
Expand Down Expand Up @@ -77,6 +79,7 @@ high_B = 987.767
# Sample Songs

## The Star Spangled Banner - USA National Anthem

```python
cp.play_tone(mid_G, 0.75)
cp.play_tone(mid_E, 0.25)
Expand All @@ -94,6 +97,7 @@ cp.play_tone(mid_G, 2)
```

## Für Elise - by Ludwig van Beethoven

```python
cp.play_tone(high_E, 0.25)
cp.play_tone(high_D_sharp, 0.25)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
---
order: 1
title: Robotics with CircuitPython
title: Advanced Robotics with CircuitPython
category: Robotics
level: 4
---

## Intro to Robotics with CircuitPython

Our curriculum for robotics with CircuitPython.

### [Microcontroller Setup Instructions](http://opensource.morganstanley.com/cpx-training/exercises/circuitpython/setup_bluefruit/)
### [Microcontroller Setup Instructions](http://opensource.morganstanley.com/cpx-training/exercises/en-US/circuitpython/setup_bluefruit/)
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ title: CircuitPython Start Here

## Programming with CircuitPython on an Adafruit's Circuit Playground Express

### [Start Here](/exercises/circuitpython/setup)
### [Start Here](/exercises/en-US/circuitpython/setup)

If you haven't set up your Circuit Playground Express board to support CircuitPython yet, please refer to the [setup instructions](/exercises/circuitpython/setup).
If you haven't set up your Circuit Playground Express board to support CircuitPython yet, please refer to the [setup instructions](/exercises/en-US/circuitircuitpython/setup).
38 changes: 38 additions & 0 deletions site/content/exercises/en-US/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
order: 1
title: Learn
subtitle: An interactive introduction to coding. Learn the basics through simple exercises designed to inspire.
---

## Multi-week Programs

### [Introduction to MakeCode](/exercises/en-US/makecode/intro)

_Grades 5-7_
Multi-week course with Circuit Playground Express and MakeCode. Best for beginners of ages 9-15, this graphical block based coding format translates to Javascript for a more comprehensive coding experience.

### [Introduction to CircuitPython](/exercises/en-US/circuitpython)

_Grades 6-9_
Based on the original single day workshop with Circuit Playground Express and CircuitPython. Starts with an overview of how to work with the board's sensors and lights through code and ends with a capstone project of the student's creation.

- [Intro to CircuitPython - Level 1](/exercises/en-US/circuitpython/level-1/)
- [Coding with CircuitPython - Level 2](/exercises/en-US/circuitpython/level-2)

### Robotics

_Grades 8-11_
Learn the fundamentals of robotics through combining components such as sensors, servos and gears to an Adafruit CircuitPlayground Express microcontroller board.

- [Robotics with MakeCode](/exercises/en-US/makecode/robotics)
- [Advanced Robotics with CircuitPython](/exercises/en-US/circuitpython/robotics)

## Single Day Programs

### [Intro to CircuitPython - Level 1](/exercises/en-US/circuitpython/level-1/)

This is the original single day workshop with Circuit Playground Express and CircuitPython. Includes an overview of the board's sensors and lights through code. Allows students to dig into an aspect of the device they enjoy for an afternoon of exploration.

### [Coding with CircuitPython - Level 2](/exercises/en-US/circuitpython/level-2)

This course builds on the original single day workshop with Circuit Playground Express and CircuitPython to fill out the student's understanding of basic programming concepts.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
order: 1
title: MakeCode
category: MakeCode
---

## Intro to programming with Adafruit's Circuit Playground Express and MakeCode
Expand Down
16 changes: 16 additions & 0 deletions site/content/exercises/en-US/makecode/intro/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
order: 1
title: Introduction to MakeCode
level: 1
category: MakeCode
---

## Intro to programming with Adafruit's Circuit Playground Express and MakeCode

![MakeCode Blink](../../../images/makecode/blink.png)

### Open the MakeCode environment

Before jumping in, [go to MakeCode website](https://makecode.adafruit.com) and select the "New? Start here" tutorial.

Documentation is [here](https://makecode.adafruit.com/docs) and if you run into odd issues, you might be getting [error codes](https://makecode.adafruit.com/device/error-codes).
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
order: 1
title: CPX Robotics with MakeCode
category: Robotics
level: 3
---

## Intro to CPX Robotics with MakeCode
11 changes: 11 additions & 0 deletions site/content/exercises/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
order: 1
title: Learn
subtitle: An interactive introduction to coding. Learn the basics through simple exercises designed to inspire.
---

### Select a Language

We are working towards providing our programs in a variety of languages. Curriculum is currently available in the following languages:

<Translations />
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
13 changes: 10 additions & 3 deletions site/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,18 @@ exports.createPages = async ({ graphql, actions }) => {

// Create pages.
const pages = result.data.allMdx.nodes;
const exerciseTemplate = path.resolve(`./src/templates/exercise.js`);
const pageTemplate = path.resolve(`./src/templates/page.js`);
const exerciseTemplate = path.resolve(`./src/templates/exercise.jsx`);
const indexTemplate = path.resolve(`./src/templates/index.jsx`);
const pageTemplate = path.resolve(`./src/templates/page.jsx`);

function getTemplate(page) {
return page.frontmatter.exercise ? exerciseTemplate : pageTemplate;
const path = page.internal.contentFilePath;
const isExerciseIndex = path.includes('index') && path.includes('exercise');
return page.frontmatter.exercise
? exerciseTemplate
: isExerciseIndex
? indexTemplate
: pageTemplate;
}

pages.forEach((page) => {
Expand Down
Loading

0 comments on commit efdfe22

Please sign in to comment.