-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit dd379ef
Showing
16 changed files
with
222 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: CD | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
target: wasm32-unknown-unknown | ||
|
||
- name: Install Trunk | ||
uses: jetli/[email protected] | ||
with: | ||
version: 'latest' | ||
|
||
- uses: jetli/[email protected] | ||
|
||
- name: Build | ||
run: trunk build --release --public-url /me/ | ||
|
||
- name: Upload Artifact | ||
uses: actions/upload-pages-artifact@v1 | ||
with: | ||
path: ./dist | ||
|
||
- name: Deploy | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: ["master", "ci"] | ||
pull_request: | ||
branches: ["master", "ci"] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
ci: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
target: wasm32-unknown-unknown | ||
|
||
- name: Install Trunk | ||
uses: jetli/[email protected] | ||
with: | ||
version: 'latest' | ||
|
||
- name: Build | ||
run: trunk build | ||
|
||
- name: Test | ||
run: cargo test --verbose --verbose | ||
|
||
- name: Check Format | ||
run: cargo fmt --all -- --check | ||
|
||
- name: Check Warnings | ||
run: cargo clippy -- -D warnings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# OS | ||
.DS_Store | ||
|
||
# Build | ||
dist/ | ||
target/ | ||
|
||
# IDE | ||
.fleet/ | ||
.idea/ | ||
.vscode/ | ||
|
||
# Other | ||
Cargo.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[package] | ||
name = "me" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
yew = { version = "0.20", features = ["csr"] } | ||
yew-hooks = "0.2" | ||
yew-router = "0.17" | ||
wasm-bindgen = "0.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Source code of my personal page | ||
|
||
[ci]: https://github.com/offluck/me/actions/workflows/ci.yaml/badge.svg | ||
[cd]: https://github.com/offluck/me/actions/workflows/cd.yaml/badge.svg | ||
|
||
![CI][ci] | ||
![CD][cd] |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
|
||
<link data-trunk rel="sass" href="index.scss" /> | ||
<link data-trunk rel="copy-dir" href="assets" /> | ||
|
||
<title>Oleg's personal page</title> | ||
</head> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
html, | ||
body { | ||
height: 100%; | ||
margin: 0; | ||
} | ||
|
||
body { | ||
display: flex; | ||
justify-content: center; | ||
|
||
background: linear-gradient(to bottom right, #ffffff, #fff6d5); | ||
font-size: 1.5rem; | ||
} | ||
|
||
main { | ||
color: #000000; | ||
font-family: sans-serif; | ||
text-align: center; | ||
} | ||
|
||
.profile.profile { | ||
height: 60%; | ||
width: auto; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use crate::router::{switch, Route}; | ||
use yew::prelude::*; | ||
use yew_router::{HashRouter, Switch}; | ||
|
||
#[function_component(App)] | ||
pub fn app() -> Html { | ||
html! { | ||
<main> | ||
<HashRouter> | ||
<Switch<Route> render={switch} /> | ||
</HashRouter> | ||
</main> | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
pub mod app; | ||
pub mod pages; | ||
pub mod router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
use me::app::App; | ||
|
||
fn main() { | ||
yew::Renderer::<App>::new().render(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
use yew::prelude::*; | ||
|
||
#[function_component(General)] | ||
pub fn general() -> Html { | ||
html! { | ||
<> | ||
<div class="profile"> | ||
<p> {"Hey there! The name's Oleg"} </p> | ||
<img class="profile" src={ "assets/images/profile.png" } alt="Profile" /> | ||
</div> | ||
</> | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pub mod general; | ||
pub mod not_found; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
use yew::prelude::*; | ||
|
||
#[function_component(NotFound)] | ||
pub fn not_found() -> Html { | ||
html! { | ||
<> | ||
<p> {"Page not found"} </p> | ||
</> | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use crate::pages::{general::General, not_found::NotFound}; | ||
use yew::prelude::*; | ||
use yew_router::prelude::*; | ||
|
||
#[derive(Debug, Clone, Copy, PartialEq, Routable)] | ||
pub enum Route { | ||
#[at("/")] | ||
General, | ||
#[not_found] | ||
#[at("/not-found")] | ||
NotFound, | ||
} | ||
|
||
pub fn switch(route: Route) -> Html { | ||
match route { | ||
Route::General => html! { | ||
<General/> | ||
}, | ||
Route::NotFound => html! { | ||
<> | ||
<NotFound/> | ||
</> | ||
}, | ||
} | ||
} |