Merge pull request #21 from Mastermindzh/content/lego-league
Content/lego league
6
.vscode/settings.json
vendored
@ -11,5 +11,9 @@
|
||||
"language": "markdown",
|
||||
"scheme": "file"
|
||||
}
|
||||
]
|
||||
],
|
||||
"sonarlint.connectedMode.project": {
|
||||
"connectionId": "public-sonarcloud",
|
||||
"projectKey": "Mastermindzh_rickvanlieshout.com"
|
||||
}
|
||||
}
|
||||
|
32
CHANGELOG.md
@ -2,6 +2,38 @@
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
## [1.3.0](https://github.com/mastermindzh/rickvanlieshout.com/compare/v1.2.3...v1.3.0) (2023-09-23)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* added my public keys to a keys.json file in the root of the website ([8a2f19e](https://github.com/mastermindzh/rickvanlieshout.com/commits/8a2f19e8a9abec4a3529c08cd06cf7e042e67725))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 404 on lego.com page of removed product ([0dc9773](https://github.com/mastermindzh/rickvanlieshout.com/commits/0dc97732e81458b39cccc6c100516e05f245697f))
|
||||
* added links to orphaned categories and tags pages ([0e9946c](https://github.com/mastermindzh/rickvanlieshout.com/commits/0e9946c92eb5022961a9f457ce82636a60e0e9ee))
|
||||
* added opengraph tags ([e6ebd5b](https://github.com/mastermindzh/rickvanlieshout.com/commits/e6ebd5b79f17ac41e4e1954857da8cd8ab50224a))
|
||||
* **opengraph:** added mandatory opengraph tags to all pages. Also fixed some other minor bugs ([98a3eb7](https://github.com/mastermindzh/rickvanlieshout.com/commits/98a3eb71f55c17da7964d6c5014e599a459329e1))
|
||||
* package.json & package-lock.json to reduce vulnerabilities ([9dc1f62](https://github.com/mastermindzh/rickvanlieshout.com/commits/9dc1f6275fdd1f6fe5fd9485f554345a1df268ec))
|
||||
* remove noindex and noindex follow tags ([d72e301](https://github.com/mastermindzh/rickvanlieshout.com/commits/d72e30196df5ca6944ae6dde7b4417c9efeb38d3))
|
||||
* removed nofollow links to my own website ([bebfe16](https://github.com/mastermindzh/rickvanlieshout.com/commits/bebfe1638e9ef1dc35b0b0fd6e8907edd344951f))
|
||||
* several pages linked to redirected urls. This replaces those links with the destination instead ([b5126bf](https://github.com/mastermindzh/rickvanlieshout.com/commits/b5126bf051dcdfe7159d24eb2cddeb3f8e1ceee8))
|
||||
* solve 404 on front-thumb image ([5344b98](https://github.com/mastermindzh/rickvanlieshout.com/commits/5344b98f8e37fb661a1ec70aaba1c5ef92cfa370))
|
||||
* updated npm packages and pinned unist-util-find to 1.0.2 to fix build errors ([5ea6e0a](https://github.com/mastermindzh/rickvanlieshout.com/commits/5ea6e0a20f9c8aff33a9ae18143e6f8fd3634127))
|
||||
* upgrade gatsby-plugin-image from 3.11.0 to 3.12.0 ([05662d2](https://github.com/mastermindzh/rickvanlieshout.com/commits/05662d2c492ae70575947b9327d64fa642a63698))
|
||||
* upgrade multiple dependencies with Snyk ([cbaca6f](https://github.com/mastermindzh/rickvanlieshout.com/commits/cbaca6f4cd9ba9ff290fcb2ede5a81d8c0e3f285))
|
||||
* upgrade multiple dependencies with Snyk ([10cbe94](https://github.com/mastermindzh/rickvanlieshout.com/commits/10cbe94397c43f80ff28cb5c81126fc3af632547))
|
||||
* upgrade multiple dependencies with Snyk ([3ef5ca5](https://github.com/mastermindzh/rickvanlieshout.com/commits/3ef5ca570b05e0cbc6c670eb9df179b1be1dba9c))
|
||||
* upgrade multiple dependencies with Snyk ([46c12f8](https://github.com/mastermindzh/rickvanlieshout.com/commits/46c12f8c98ab8beb7b6be040fa73761eb73b2dd9))
|
||||
|
||||
|
||||
### New content
|
||||
|
||||
* A new blog about the LegoLeague event held at INFORIT ([4e6b042](https://github.com/mastermindzh/rickvanlieshout.com/commits/4e6b042a44d9a9f5d68dba653c1472be80d21ce9))
|
||||
* **legoleague:** fixed some writing ([92245be](https://github.com/mastermindzh/rickvanlieshout.com/commits/92245be1883f7e136dae7888a64a472cf6597180))
|
||||
|
||||
### [1.2.3](https://github.com/mastermindzh/rickvanlieshout.com/compare/v1.2.2...v1.2.3) (2023-04-19)
|
||||
|
||||
### Bug Fixes
|
||||
|
@ -64,6 +64,7 @@ Building an interactive and fully customizable dashboard on top of VAA's existin
|
||||
I'll list some of the training courses I've had whilst working.
|
||||
Some of these have (official) certificates, some don't, but all have brought value and knowledge.
|
||||
|
||||
- Young Executive Program (YEP) - [De Baak](https://debaak.nl/trainingen/young-executives-program)
|
||||
- Hiring & interview training ([icm.nl](https://www.icm.nl/opleidingen-en-trainingen/hrm/selectiegesprekken-voeren/))
|
||||
- Conversation techniques & de-escalation ([TIJDwinst.com](https://gesprekstechnieken.com/cursus-gesprekstechnieken/)](<https://gesprekstechnieken.com/cursus-gesprekstechnieken/>)).
|
||||
- Kubernetes (NobleProg Certification Kubernetes on Azure (AKS), 26 August 2019 - 27 August 2019)
|
||||
|
Before Width: | Height: | Size: 2.5 MiB |
After Width: | Height: | Size: 243 KiB |
Before Width: | Height: | Size: 1.3 MiB |
After Width: | Height: | Size: 89 KiB |
@ -50,7 +50,7 @@ We also started working on the controllers. The final design will be compromised
|
||||
![back](./media/back.jpg "Back of the controller")
|
||||
![bottom](./media/bottom.jpg "bottom of the controller")
|
||||
![controller_pot](./media/controller_pot.jpg "potentiometer used inside the controller")
|
||||
![front](./media/Front_thumb.png "The front of the controller with the logo")
|
||||
![front](./media/front-thumb.png "The front of the controller with the logo")
|
||||
![inside](./media/inside.jpg "the inside of an assembled controller")
|
||||
![left_side](./media/left_side.jpg "The left side of the controller")
|
||||
![right_side](./media/right_side.jpg "The right side of the controller")
|
||||
|
@ -11,23 +11,23 @@ disqusId: "17"
|
||||
socialImage: "./media/wiring1.jpg"
|
||||
---
|
||||
|
||||
In the 3rd part of my TekTree project I'll show you guys how to wire everything. This time I even used separate colours for the power,ground and signal wires. So no more complaining ! ^\_^ All in all I think the result looks absolutely wicked. Even without the arduino case which has yet to come in the mail. (and probably won't fit)
|
||||
In the 3rd part of my TekTree project I'll show you guys how to wire everything. This time I even used separate colours for the power, ground and signal wires. So no more complaining! ^\_^ All in all I think the result looks absolutely wicked. Even without the Arduino case which has yet to come in the mail. (and probably won't fit)
|
||||
|
||||
## Wiring part 1 - schematics
|
||||
|
||||
Before I started to jam wires in every nook and cranny I could find I had to come up with a plan. Most of that plan has been put into a "Fritzing" sketch which can be found below and on [Github](https://github.com/Mastermindzh/TekTree). The only thing I couldn't figure out how to model on fritzing is the actual christmas tree and the power cord for the arduino.
|
||||
Before I started to jam wires in every nook and cranny I could find I had to come up with a plan. Most of that plan has been put into a "Fritzing" sketch which can be found below and on [Github](https://github.com/Mastermindzh/TekTree). The only thing I couldn't figure out how to model on fritzing is the actual Christmas tree and the power cord for the Arduino.
|
||||
|
||||
The arduino will get power from a regular adaptor. The only modification I did to the adapter is putting a button on one of the wires. And the only reason I did that is because I'm too lazy to unplug the TekTree when I want to turn it off :)
|
||||
The Arduino will get power from a regular adaptor. The only modification I made to the adapter was putting a button on one of the wires. The only reason I did that is because I'm too lazy to unplug the TekTree when I want to turn it off :)
|
||||
|
||||
![Wiring of the back of the Tektree. You can see a lot of jumper wires sticking out and connecting to LEDs](./media/wiring1.jpg)
|
||||
|
||||
## Why so many wires?
|
||||
|
||||
I want the project to be "manageable" for everyone. To do this I kept the wiring as simple as possible. Every LED has 2 prongs, 1 goes to ground 1 goes to the arduino. Simple. Same goes for the potentiometers, 3 legs, 1 power 1 ground 1 signal. The only led's I did bundle together (in terms of wiring) is the star. I did this to create a single star instead of multiple led's.
|
||||
I want the project to be "manageable" for everyone. To do this I kept the wiring as simple as possible. Every LED has 2 prongs, 1 goes to ground 1 goes to the Arduino. Simple. Same goes for the potentiometers, 3 legs, 1 power 1 ground 1 signal. The only leds I did bundle together (in terms of wiring) is the star. I did this to create a single star instead of multiple led's.
|
||||
|
||||
## Well you could've made it way prettier... and
|
||||
|
||||
Well yes, as all of us know I'm perfectly capable of designing a [refined build](/images/blogs/han4pi/Front_thumb.png). I didn't want to go with a pcb this time however because that would make the barrier to entry way higher on this project. And that is something I definitely **don't** want.
|
||||
Well yes, as all of us know I'm perfectly capable of designing a [refined build](/images/blogs/han4pi/front.png). I didn't want to go with a pcb this time however because that would make the barrier to entry way higher on this project. And that is something I definitely **don't** want.
|
||||
|
||||
I also didn't "group" all my ground wires together. (led -> led -> led -> board) This would've made the project a lot neater but it wouldn't be anywhere near as service friendly. (which was kinda the idea...)
|
||||
|
||||
|
BIN
content/posts/2015/tektree-part-3-wiring/media/front.png
Normal file
After Width: | Height: | Size: 280 KiB |
97
content/posts/2023/lego-league/index.md
Normal file
@ -0,0 +1,97 @@
|
||||
---
|
||||
title: LegoLeague - Battling it out with little robots made from Lego
|
||||
date: "2023-09-18"
|
||||
template: "post"
|
||||
category: "Lego"
|
||||
tags:
|
||||
- "lego"
|
||||
- "spike"
|
||||
- "programming"
|
||||
- "team"
|
||||
- "work"
|
||||
description: "At INFORIT we love to play! Be it DND, board games or in this case... Legos. Read on to find out what we've been up to this past summer vacation"
|
||||
socialImage: ./media/lego-spike-set.png
|
||||
---
|
||||
|
||||
![The 2023 LegoLeague play-mat laid out on an improvised table](./media/board.jpg "The 2023 LegoLeague battle board")
|
||||
|
||||
A little before the start of the summer period my colleague Jan-Kees came up to me and proposed the idea of an internal LegoLeague. After a little bit of back-and-forth about what LegoLeague exactly was I agreed it would be a great idea to bring some colleagues together and have a little fun during work hours.
|
||||
Pretty much right away excitement got the better of us and we started drafting a plan... when? where? how? prizes? teams!?? A lot.
|
||||
But First...
|
||||
|
||||
## What is LegoLeague?
|
||||
|
||||
LegoLeague is an event where teams come together to build, program and test a [Lego Spike robot](https://www.lego.com/en-nl/product/lego-education-spike-prime-set-45678) to perform autonomous tasks. The tasks range from collecting "power cores", pushing or pulling levers, to dropping Lego blocks in a hopper to get some bonus points.
|
||||
|
||||
All of this is accompanied by a theme, in our case energy production, which adds a layer of fun to solving these challenges.
|
||||
The video below shows a teaser of 2022-2023's "SuperPowered" event, the very thing we based our LegoLeague on:
|
||||
|
||||
<iframe
|
||||
width="560"
|
||||
height="315"
|
||||
src="https://www.youtube.com/embed/okR1AMFNV3Q?si=cq4KqyVVK6sAsCpY"
|
||||
title="YouTube video player"
|
||||
frameborder="0"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
||||
allowfullscreen>
|
||||
</iframe>
|
||||
|
||||
For each task a team completes successfully they will score points.
|
||||
Teams get 2 minutes and 30 seconds (2:30) to score as many points as they can.
|
||||
The video below outlines some of the challenges the teams have available to them with a little explanation of how they function and even some info on the scores. This video is especially useful for teams that don't want to peruse the entire rule book but still wanted to figure out an optimal strategy.
|
||||
|
||||
<iframe
|
||||
width="560"
|
||||
height="315"
|
||||
src="https://www.youtube.com/embed/ILTjo0LHZQA?si=YqJvSYX3JNclPPeJ"
|
||||
title="YouTube video player"
|
||||
frameborder="0"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
||||
allowfullscreen>
|
||||
</iframe>
|
||||
|
||||
To build the robot each team gets a [Lego Spike Prime set](https://www.lego.com/nl-nl/product/lego-education-spike-prime-set-45678) and nothing more!
|
||||
In the original event, teams had access to a little more Lego in various kits but for our little event at [INFORIT](https://inforit.nl), we were only able to source the basic kits in time.
|
||||
Having said that, we wouldn't have been able to get our hands on any of the kits at all if it wasn't for the ["PReT" organization in Weesp](https://www.pretweesp.nl/). Thanks guys!
|
||||
|
||||
![A Lego spike set](./media/lego-spike-set.png "A Lego spike set laid out on display")
|
||||
|
||||
As for the programming... Teams are free to use either "[scratch](https://scratch.mit.edu/)" or "Python" to program their robots.
|
||||
Scratch being much easier for those who don't spend all day behind their computer working on software development whilst Python allows for more flexibility in what can be achieved.
|
||||
Spoiler alert: all teams chose scratch, it's much more accessible for non-developers!
|
||||
|
||||
## The competition at INFORIT
|
||||
|
||||
So yeah, we now know what a LegoLeague is and we have the approval to host the competition at [INFORIT](https://inforit.nl), now what?
|
||||
Well, Jan-Kees got to work building the arena and setting it up and I set out to gather team members. Given that it was the summer break I had to hustle to get teams together but eventually we managed to create some beautiful teams.
|
||||
|
||||
Fortunately, [INFORIT](https://inforit.nl) values employee happiness, autonomy and continuous improvement. As such I was able to offer the 2 Friday afternoons free of day-to-day work, to work on the robot whilst providing catering, music, and the like to the teams whilst they are participating!
|
||||
|
||||
In the end, we were successful in creating 4 teams of at least 3 people who were all mixed with developers and non-developers to keep the balance fair. Meanwhile, Jan-Kees also finished building the arena which you can see in the header of this blog or the pictures in the picture section.
|
||||
|
||||
## Pictures
|
||||
|
||||
Of course, we've taken loads of pictures during the event but those are mostly for internal use.
|
||||
Below I've included some pictures of the event that are all cleared for social media distribution with a little description of what's happening in each picture to, hopefully, convey some of the vibes of the event itself.
|
||||
|
||||
![One of the competing robots on display. This one seems to have a little grabby arm to perform the tasks with.](./media/robot-warrior.jpg "one of the competing robots")
|
||||
![A contestant is looking at the board figuring out where the robot needs to go](./media/lex-counting.jpg "A contestant calculating exactly where to go. Such a pathfinder!")
|
||||
![two teams continuing to test their implementations](./media/testing-coding-repeat.jpg "code -> test -> repeat. Soooo important")
|
||||
![a picture of a laptop screen with lots of scratch code blocks on it](./media/complicated.png "This team might have overcomplicated things a tad. Looks impressive though.")
|
||||
|
||||
## Winners, losers, etc
|
||||
|
||||
In the end, this is still a competition. People competed hard to come out on top and 1 team did so successfully.
|
||||
Congratulations guys!
|
||||
|
||||
![a group picture of all the contestants, some wearing their medals and carrying their candy prize](./media/winners.jpg "All of our winners! (excluding myself 😢)")
|
||||
|
||||
## Nah, we are all winners in the end
|
||||
|
||||
Having 4 teams gave us the unique opportunity to reward them all with something nice. The 3 teams that got podium places all got their medals and their rewards and the team in fourth place got their consolation prize.
|
||||
|
||||
Luckily though, we're all winners, even the Jury members and the organizers.
|
||||
This event has brought us all closer together and improved the connection between our colleagues.
|
||||
I, personally, had a blast and would love to do similar things in the future.
|
||||
|
||||
That's it again, thanks for reading and see you next time!
|
BIN
content/posts/2023/lego-league/media/board.jpg
Normal file
After Width: | Height: | Size: 4.4 MiB |
BIN
content/posts/2023/lego-league/media/complicated.png
Normal file
After Width: | Height: | Size: 284 KiB |
BIN
content/posts/2023/lego-league/media/lego-spike-set.png
Normal file
After Width: | Height: | Size: 297 KiB |
BIN
content/posts/2023/lego-league/media/lex-counting.jpg
Normal file
After Width: | Height: | Size: 3.8 MiB |
BIN
content/posts/2023/lego-league/media/robot-warrior.jpg
Normal file
After Width: | Height: | Size: 3.9 MiB |
BIN
content/posts/2023/lego-league/media/testing-coding-repeat.jpg
Normal file
After Width: | Height: | Size: 4.2 MiB |
BIN
content/posts/2023/lego-league/media/winners.jpg
Normal file
After Width: | Height: | Size: 4.4 MiB |
@ -171,7 +171,7 @@ export default {
|
||||
stripQueryString: true,
|
||||
},
|
||||
},
|
||||
// remove the old serviceworker if it is available.
|
||||
// remove the old service worker if it is available.
|
||||
"gatsby-plugin-remove-serviceworker",
|
||||
"gatsby-plugin-image",
|
||||
"gatsby-plugin-catch-links",
|
||||
|
40
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "rickvanlieshout-com",
|
||||
"version": "1.2.3",
|
||||
"version": "1.3.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "rickvanlieshout-com",
|
||||
"version": "1.2.3",
|
||||
"version": "1.3.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@fortawesome/fontawesome-svg-core": "^6.4.2",
|
||||
@ -11321,9 +11321,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/conventional-changelog-core/node_modules/read-pkg/node_modules/semver": {
|
||||
"version": "5.7.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
|
||||
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
|
||||
"version": "5.7.2",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
|
||||
"integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"semver": "bin/semver"
|
||||
@ -17439,9 +17439,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/generate-robotstxt/node_modules/semver": {
|
||||
"version": "5.7.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
|
||||
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
|
||||
"version": "5.7.2",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
|
||||
"integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
|
||||
"bin": {
|
||||
"semver": "bin/semver"
|
||||
}
|
||||
@ -28099,9 +28099,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/password-prompt/node_modules/semver": {
|
||||
"version": "5.7.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
|
||||
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
|
||||
"version": "5.7.2",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
|
||||
"integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
|
||||
"bin": {
|
||||
"semver": "bin/semver"
|
||||
}
|
||||
@ -30099,9 +30099,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/read-pkg/node_modules/semver": {
|
||||
"version": "5.7.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
|
||||
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
|
||||
"version": "5.7.2",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
|
||||
"integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
|
||||
"bin": {
|
||||
"semver": "bin/semver"
|
||||
}
|
||||
@ -31841,9 +31841,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/semver": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
||||
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
|
||||
"version": "6.3.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
|
||||
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
|
||||
"bin": {
|
||||
"semver": "bin/semver.js"
|
||||
}
|
||||
@ -35326,9 +35326,9 @@
|
||||
"integrity": "sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ=="
|
||||
},
|
||||
"node_modules/word-wrap": {
|
||||
"version": "1.2.3",
|
||||
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
|
||||
"integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==",
|
||||
"version": "1.2.5",
|
||||
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz",
|
||||
"integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "rickvanlieshout-com",
|
||||
"version": "1.2.3",
|
||||
"version": "1.3.0",
|
||||
"description": "My personal blog / website",
|
||||
"keywords": [
|
||||
"gatsby",
|
||||
@ -159,4 +159,4 @@
|
||||
"path": "@commitlint/cz-commitlint"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ interface Props {
|
||||
socialImage?: string;
|
||||
children: React.ReactNode;
|
||||
noIndex?: boolean;
|
||||
slug?: string;
|
||||
}
|
||||
|
||||
const Layout: React.FC<Props> = ({
|
||||
@ -19,6 +20,7 @@ const Layout: React.FC<Props> = ({
|
||||
description,
|
||||
socialImage = "",
|
||||
noIndex = false,
|
||||
slug,
|
||||
}: Props) => {
|
||||
const { author, url } = useSiteMetadata();
|
||||
const metaImage = socialImage || author.photo;
|
||||
@ -33,6 +35,7 @@ const Layout: React.FC<Props> = ({
|
||||
<meta property="og:description" content={description} />
|
||||
<meta property="og:site_name" content={title} />
|
||||
<meta property="og:image" content={metaImageUrl} />
|
||||
{slug && <meta property="og:url" content={`${url}${slug}`} />}
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content={title} />
|
||||
<meta name="twitter:description" content={description} />
|
||||
|
@ -1,8 +1,8 @@
|
||||
import React, { useEffect, useRef } from "react";
|
||||
|
||||
import * as styles from "./Page.module.scss";
|
||||
import type { Nullable } from "@/types";
|
||||
|
||||
import { Helmet } from "react-helmet";
|
||||
import * as styles from "./Page.module.scss";
|
||||
|
||||
interface Props {
|
||||
title?: string;
|
||||
@ -19,12 +19,17 @@ const Page: React.FC<Props> = ({ title, children }: Props) => {
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div ref={pageRef} className={styles.page}>
|
||||
<div className={styles.inner}>
|
||||
{title && <h1 className={styles.title}>{title}</h1>}
|
||||
<div className={styles.body}>{children}</div>
|
||||
<>
|
||||
<Helmet>
|
||||
<meta property="og:type" content="website" />
|
||||
</Helmet>
|
||||
<div ref={pageRef} className={styles.page}>
|
||||
<div className={styles.inner}>
|
||||
{title && <h1 className={styles.title}>{title}</h1>}
|
||||
<div className={styles.body}>{children}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -13,7 +13,7 @@ const CategoriesTemplate: React.FC = () => {
|
||||
const categories = useCategoriesList();
|
||||
|
||||
return (
|
||||
<Layout title={`Categories - ${title}`} description={subtitle}>
|
||||
<Layout title={`Categories - ${title}`} description={subtitle} slug="/categories/">
|
||||
<Sidebar />
|
||||
<Page title="Categories">
|
||||
<ul>
|
||||
|
@ -28,7 +28,7 @@ const CategoryTemplate: React.FC<Props> = ({ data, pageContext }: Props) => {
|
||||
currentPage > 0 ? `${group} - Page ${currentPage} - ${siteTitle}` : `${group} - ${siteTitle}`;
|
||||
|
||||
return (
|
||||
<Layout title={pageTitle} description={siteSubtitle}>
|
||||
<Layout title={pageTitle} description={siteSubtitle} slug={`/category/${group}/`}>
|
||||
<Sidebar />
|
||||
<Page title={group}>
|
||||
<Feed edges={edges} />
|
||||
|
@ -26,7 +26,7 @@ const IndexTemplate: React.FC<Props> = ({ data, pageContext }: Props) => {
|
||||
const pageTitle = currentPage > 0 ? `Posts - Page ${currentPage} - ${siteTitle}` : siteTitle;
|
||||
|
||||
return (
|
||||
<Layout title={pageTitle} description={siteSubtitle}>
|
||||
<Layout title={pageTitle} description={siteSubtitle} slug="">
|
||||
<Sidebar isIndex />
|
||||
<Page>
|
||||
<Feed edges={edges} />
|
||||
|
@ -10,7 +10,7 @@ const NotFoundTemplate: React.FC = () => {
|
||||
const { title, subtitle } = useSiteMetadata();
|
||||
|
||||
return (
|
||||
<Layout title={`Not Found - ${title}`} description={subtitle}>
|
||||
<Layout title={`Not Found - ${title}`} description={subtitle} slug="/404.html">
|
||||
<Sidebar />
|
||||
<Page title="Oh no! page be lost">
|
||||
<p>
|
||||
|
@ -26,6 +26,7 @@ const PageTemplate: React.FC<Props> = ({ data }: Props) => {
|
||||
title={`${title} - ${siteTitle}`}
|
||||
description={metaDescription}
|
||||
socialImage={socialImage?.publicURL}
|
||||
slug={data.markdownRemark.fields.slug}
|
||||
>
|
||||
<Sidebar />
|
||||
<Page title={title}>
|
||||
@ -40,6 +41,9 @@ export const query = graphql`
|
||||
markdownRemark(fields: { slug: { eq: $slug } }) {
|
||||
id
|
||||
html
|
||||
fields {
|
||||
slug
|
||||
}
|
||||
frontmatter {
|
||||
title
|
||||
date
|
||||
|
@ -24,6 +24,7 @@ const PostTemplate: React.FC<Props> = ({ data }: Props) => {
|
||||
title={`${title} - ${siteTitle}`}
|
||||
description={metaDescription}
|
||||
socialImage={socialImage?.publicURL}
|
||||
slug={data.markdownRemark.fields.slug}
|
||||
>
|
||||
<Post post={data.markdownRemark} />
|
||||
</Layout>
|
||||
|
@ -28,7 +28,7 @@ const TagTemplate: React.FC<Props> = ({ data, pageContext }: Props) => {
|
||||
currentPage > 0 ? `${group} - Page ${currentPage} - ${siteTitle}` : `${group} - ${siteTitle}`;
|
||||
|
||||
return (
|
||||
<Layout title={pageTitle} description={siteSubtitle}>
|
||||
<Layout title={pageTitle} description={siteSubtitle} slug={`/tag/${group}/`}>
|
||||
<Sidebar />
|
||||
<Page title={group}>
|
||||
<Feed edges={edges} />
|
||||
|
@ -13,7 +13,7 @@ const TagsTemplate: React.FC = () => {
|
||||
const tags = useTagsList();
|
||||
|
||||
return (
|
||||
<Layout title={`Tags - ${title}`} description={subtitle}>
|
||||
<Layout title={`Tags - ${title}`} description={subtitle} slug="/tags/">
|
||||
<Sidebar />
|
||||
<Page title="Tags">
|
||||
<ul>
|
||||
|