Skip to content

Commit 849bbeb

Browse files
committed
The new AeroRust website
1 parent 36c0e6b commit 849bbeb

37 files changed

+597
-126
lines changed

.github/workflow/deploy.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
6+
name: Build and deploy GH Pages
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v3
13+
- uses: actions/setup-node@v3
14+
with:
15+
node-version: 18
16+
cache: 'npm'
17+
- name: Install npm dependencies
18+
run: npm install
19+
- name: Build npm
20+
env:
21+
NODE_ENV: production
22+
run: npm build
23+
- name: Build zola and_deploy
24+
uses: shalzz/[email protected]
25+
env:
26+
# Target branch
27+
PAGES_BRANCH: gh-pages
28+
# Provide personal access token
29+
TOKEN: ${{ secrets.TOKEN }}

.github/workflows/gh-pages.yml

-28
This file was deleted.

.gitignore

+5-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
book
1+
public
2+
package-lock.json
3+
node_modules
4+
.env
5+
static/dist

.travis.yml

-18
This file was deleted.

README.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# AeroRust community website
2+
3+
### Development
4+
5+
#### Run `Zola`
6+
7+
You need to [install `zola`](https://www.getzola.org/documentation/getting-started/installation/) (a static site generator).
8+
9+
Run in your terminal:
10+
11+
```bash
12+
zola serve
13+
```
14+
15+
#### Run `npm`
16+
For the front-end part (scss, javascript) you need `npm` & `webpack`.
17+
18+
Run in a separate terminal window:
19+
20+
```bash
21+
npm run dev
22+
```

book.toml

-45
This file was deleted.

build/ci.sh

-11
This file was deleted.

config.toml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# The URL the site will be built for
2+
base_url = "https://aerorust.github.io"
3+
4+
# Whether to automatically compile all Sass files in the sass directory
5+
compile_sass = false
6+
7+
# Whether to build a search index to be used later on by a JavaScript library
8+
build_search_index = true
9+
10+
[markdown]
11+
# Whether to do syntax highlighting
12+
# Theme can be customised by setting the `highlight_theme` variable to a theme supported by Zola
13+
highlight_code = true
14+
15+
[extra]
16+
# Put all your custom variables here
17+
github_repo = "https://github.com/AeroRust/aerorust.github.io"
18+
github_org = "https://github.com/AeroRust"
19+
discord_invite = "https://discord.gg/6wFvsFWfnu"
20+
discord_members_count = "300+"
21+
rustlang_website = "https://rust-lang.org"

content/_index.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
+++
2+
title = "The AeroRust (ÄR) community"
3+
template = "index.html"
4+
+++

content/catalogue/_index.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
+++
2+
title = "Are we in space yet?"
3+
template = "catalogue.html"
4+
+++

content/catalogue/crates.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
+++
2+
title = "Crates catalogue"
3+
template = "catalogue.html"
4+
+++

frontend/bootstrap.js

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import * as bootstrap from "bootstrap";
2+
3+
export const initBootstrap = function (config) {
4+
// Enabling tooltips
5+
if (config.tooltip) {
6+
const tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
7+
8+
tooltipTriggerList.map(function (tooltipTriggerEl) {
9+
return new bootstrap.Tooltip(tooltipTriggerEl)
10+
})
11+
}
12+
13+
// Enabling popovers
14+
if (config.popover) {
15+
const popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]'))
16+
17+
popoverTriggerList.map(function (popoverTriggerEl) {
18+
return new bootstrap.Popover(popoverTriggerEl, {})
19+
})
20+
}
21+
22+
// Enabling toasts
23+
if (config.toasts) {
24+
const toastTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="toast"]'))
25+
26+
toastTriggerList.map(function (toastTriggerEl) {
27+
// Define the target property
28+
let toastTarget = null
29+
30+
if ("A" === toastTriggerEl.nodeName) {
31+
toastTarget = toastTriggerEl.href || null
32+
33+
if (toastTarget.includes('#')) {
34+
toastTarget = `#${toastTarget.split("#").pop()}`
35+
} else {
36+
return
37+
}
38+
} else if ("BUTTON" === toastTriggerEl.nodeName) {
39+
toastTarget = toastTriggerEl.dataset.bsTarget || null
40+
}
41+
42+
// Check if the target exists
43+
const toastTargetEl = document.querySelector(toastTarget);
44+
45+
if (!toastTargetEl) {
46+
return
47+
}
48+
49+
// Init toast
50+
const toast = new bootstrap.Toast(toastTargetEl)
51+
52+
// Add click even to trigger
53+
toastTriggerEl.addEventListener("click", function (event) {
54+
event.preventDefault();
55+
toast.show()
56+
})
57+
})
58+
}
59+
}

frontend/index.js

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import 'bootstrap';
2+
3+
// or get all of the named exports for further usage
4+
// import * as bootstrap from 'bootstrap';
5+
6+
import 'bootstrap-icons/font/fonts/bootstrap-icons.woff';
7+
import 'bootstrap-icons/font/fonts/bootstrap-icons.woff2';
8+
9+
if (process.env.NODE_ENV !== 'production') {
10+
console.log('Looks like we are in development mode!');
11+
}
12+
13+
// Load Styles
14+
import './scss/main.scss';
15+
16+
// Load Bootstrap init
17+
import {initBootstrap} from "./bootstrap";
18+
19+
// Loading bootstrap with optional features
20+
initBootstrap({
21+
tooltip: true,
22+
popover: true,
23+
toasts: true,
24+
});

frontend/scss/_custom.scss

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
// 1. Include functions first (so you can manipulate colors, SVGs, calc, etc)
2+
@import "~bootstrap/scss/functions";
3+
4+
// 2. Include any default variable overrides here
5+
$aerorust-light: #e35f33;
6+
$aerorust-dark: #98381f;
7+
8+
// Include before variables, because of the hover color!
9+
$link-color: $aerorust-light;
10+
11+
// 3. Include remainder of required Bootstrap stylesheets
12+
@import "~bootstrap/scss/variables";
13+
14+
$body-bg: $black;
15+
$body-color: $gray-300;
16+
17+
// 4. Include any default map overrides here
18+
19+
$spacers: map-merge($spacers, (
20+
"0-5": $spacer * .125,
21+
));
22+
23+
// Create your own map
24+
$custom-colors: (
25+
"aerorust-light": $aerorust-light,
26+
"aerorust-dark": $aerorust-dark,
27+
"gray-100": $gray-100,
28+
"gray-200": $gray-200,
29+
"gray-300": $gray-300,
30+
"gray-400": $gray-400,
31+
"gray-500": $gray-500,
32+
"gray-600": $gray-600,
33+
"gray-700": $gray-700,
34+
"gray-800": $gray-800,
35+
"gray-900": $gray-900
36+
);
37+
38+
// Merge the maps
39+
$theme-colors: map-merge($theme-colors, $custom-colors);
40+
41+
// 5. Include remainder of required parts
42+
@import "~bootstrap/scss/maps";
43+
@import "~bootstrap/scss/mixins";
44+
@import "~bootstrap/scss/root";
45+
@import "~bootstrap/scss/utilities";
46+
47+
// 6. Optionally include any other parts as needed
48+
49+
// Layout & components TODO: remove unneeded!
50+
@import "~bootstrap/scss/reboot";
51+
@import "~bootstrap/scss/type";
52+
@import "~bootstrap/scss/images";
53+
@import "~bootstrap/scss/containers";
54+
@import "~bootstrap/scss/grid";
55+
@import "~bootstrap/scss/tables";
56+
@import "~bootstrap/scss/forms";
57+
@import "~bootstrap/scss/buttons";
58+
@import "~bootstrap/scss/transitions";
59+
@import "~bootstrap/scss/dropdown";
60+
@import "~bootstrap/scss/button-group";
61+
@import "~bootstrap/scss/nav";
62+
@import "~bootstrap/scss/navbar";
63+
@import "~bootstrap/scss/card";
64+
@import "~bootstrap/scss/accordion";
65+
@import "~bootstrap/scss/breadcrumb";
66+
@import "~bootstrap/scss/pagination";
67+
@import "~bootstrap/scss/badge";
68+
@import "~bootstrap/scss/alert";
69+
@import "~bootstrap/scss/progress";
70+
@import "~bootstrap/scss/list-group";
71+
@import "~bootstrap/scss/close";
72+
@import "~bootstrap/scss/toasts";
73+
@import "~bootstrap/scss/modal";
74+
@import "~bootstrap/scss/tooltip";
75+
@import "~bootstrap/scss/popover";
76+
@import "~bootstrap/scss/carousel";
77+
@import "~bootstrap/scss/spinners";
78+
@import "~bootstrap/scss/offcanvas";
79+
@import "~bootstrap/scss/placeholders";
80+
81+
// Helpers
82+
@import "~bootstrap/scss/helpers";
83+
84+
// 7. Optionally include utilities API last to generate classes based on the Sass map in `_utilities.scss`
85+
@import "~bootstrap/scss/utilities/api";
86+
87+
// 8. Add additional custom code here
88+
@import "~bootstrap-icons/font/bootstrap-icons"
89+
90+

0 commit comments

Comments
 (0)