Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
053b5784aa | ||
|
|
543522ea7f | ||
|
|
d92074b59b | ||
|
|
537dcd6536 | ||
|
|
8ff3722780 | ||
|
|
479a4d8ebc | ||
|
|
ffd9b46bd8 | ||
|
|
fd70e7a0fa
|
@@ -10,25 +10,53 @@ defaults:
|
|||||||
working-directory: ./
|
working-directory: ./
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
cd:
|
build:
|
||||||
timeout-minutes: 6
|
timeout-minutes: 6
|
||||||
name: CD
|
name: Build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup hugo
|
- name: Setup hugo
|
||||||
uses: peaceiris/actions-hugo@v2
|
uses: peaceiris/actions-hugo@v3
|
||||||
with:
|
with:
|
||||||
hugo-version: "latest"
|
hugo-version: "latest"
|
||||||
extended: true
|
extended: true
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: hugo -D -F
|
run: hugo --minify
|
||||||
- name: Create GitHub deployment
|
|
||||||
uses: chrnorm/deployment-action@releases/v1
|
- name: Upload deployment
|
||||||
id: deployment
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
token: "${{ github.token }}"
|
name: public-html
|
||||||
target_url: https://maik.dev/
|
path: ./public
|
||||||
environment: production
|
|
||||||
initial_status: "success"
|
deploy:
|
||||||
|
timeout-minutes: 6
|
||||||
|
name: Deploy
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build
|
||||||
|
environment:
|
||||||
|
name: production
|
||||||
|
url: https://maik.dev/
|
||||||
|
steps:
|
||||||
|
- name: Download deployment
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: public-html
|
||||||
|
path: ./public-html
|
||||||
|
|
||||||
|
- name: Setup SSH config for remote server
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
|
||||||
|
echo "${{ secrets.SSH_HOST }} ssh-ed25519 ${{ secrets.SSH_HOST_KEY }}" > ~/.ssh/known_hosts
|
||||||
|
chmod 600 ~/.ssh/id_ed25519
|
||||||
|
eval "$(ssh-agent -s)"
|
||||||
|
ssh-add ~/.ssh/id_ed25519
|
||||||
|
|
||||||
|
- name: Transfer deployment to remote server
|
||||||
|
run: |
|
||||||
|
rsync -avh --delete-after ./public-html/ ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }}:~/maik.dev
|
||||||
|
|||||||
@@ -22,11 +22,13 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup hugo
|
- name: Setup hugo
|
||||||
uses: peaceiris/actions-hugo@v2
|
uses: peaceiris/actions-hugo@v3
|
||||||
with:
|
with:
|
||||||
hugo-version: "latest"
|
hugo-version: "latest"
|
||||||
extended: true
|
extended: true
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: hugo -D -F
|
run: hugo -D -F
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
+++
|
|
||||||
author = "Maik de Kruif"
|
|
||||||
title = "{{ replace .Name "-" " " | title }}"
|
|
||||||
date = {{ .Date }}
|
|
||||||
description = ""
|
|
||||||
images = []
|
|
||||||
tags = [
|
|
||||||
"untagged",
|
|
||||||
]
|
|
||||||
categories = [
|
|
||||||
"uncategorized",
|
|
||||||
]
|
|
||||||
+++
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
+++
|
|
||||||
author = "Maik de Kruif"
|
|
||||||
title = "{{ replace .Name "-" " " | title }}"
|
|
||||||
date = {{ .Date }}
|
|
||||||
description = ""
|
|
||||||
images = []
|
|
||||||
tags = [
|
|
||||||
"untagged",
|
|
||||||
]
|
|
||||||
categories = [
|
|
||||||
"uncategorized",
|
|
||||||
]
|
|
||||||
+++
|
|
||||||
|
After Width: | Height: | Size: 50 KiB |
|
After Width: | Height: | Size: 67 KiB |
|
After Width: | Height: | Size: 1.5 MiB |
|
After Width: | Height: | Size: 5.2 MiB |
|
After Width: | Height: | Size: 572 KiB |
|
After Width: | Height: | Size: 174 KiB |
|
After Width: | Height: | Size: 630 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 610 KiB |
|
After Width: | Height: | Size: 1.5 MiB |
|
After Width: | Height: | Size: 1.5 MiB |
|
After Width: | Height: | Size: 254 KiB |
|
After Width: | Height: | Size: 969 KiB |
|
After Width: | Height: | Size: 41 KiB |
@@ -1,12 +1,8 @@
|
|||||||
baseURL = "https://maik.dev/"
|
baseURL = "http://localhost:1313/"
|
||||||
# baseURL = "http://localhost:1313/"
|
|
||||||
title = "Maik de Kruif"
|
title = "Maik de Kruif"
|
||||||
languageCode = "en-us"
|
languageCode = "en-us"
|
||||||
theme = "maik-blog"
|
theme = "maik-blog"
|
||||||
|
|
||||||
paginate = 12
|
|
||||||
rssLimit = 10
|
|
||||||
|
|
||||||
copyright = "© Maik de Kruif (maik_dev). All rights reserved."
|
copyright = "© Maik de Kruif (maik_dev). All rights reserved."
|
||||||
|
|
||||||
PygmentsCodeFences = true
|
PygmentsCodeFences = true
|
||||||
@@ -27,36 +23,27 @@ canonifyURLs = true
|
|||||||
enableRobotsTXT = true
|
enableRobotsTXT = true
|
||||||
enableGitInfo = true
|
enableGitInfo = true
|
||||||
enableEmoji = true
|
enableEmoji = true
|
||||||
enableMissingTranslationPlaceholders = false
|
|
||||||
disableRSS = false
|
|
||||||
disableSitemap = false
|
|
||||||
disable404 = false
|
|
||||||
disableHugoGeneratorInject = false
|
|
||||||
|
|
||||||
googleAnalytics = "UA-136337666-1"
|
|
||||||
|
|
||||||
[permalinks]
|
[permalinks]
|
||||||
|
[permalinks.page]
|
||||||
posts = "/posts/:title/"
|
posts = "/posts/:title/"
|
||||||
writeups = "/:sections/:title/"
|
writeups = "/:sections/:title/"
|
||||||
|
# writeups = "/writeups/:title/"
|
||||||
[author]
|
portfolio = "/portfolio/:title/"
|
||||||
name = "Maik de Kruif"
|
|
||||||
email = "maik@maik.dev"
|
|
||||||
twitter = "@maik_dev"
|
|
||||||
image = "/img/home/portrait.png"
|
|
||||||
|
|
||||||
[social]
|
|
||||||
twitter = "@maik_dev"
|
|
||||||
|
|
||||||
[outputs]
|
[outputs]
|
||||||
home = ["HTML", "RSS"]
|
home = ["HTML", "RSS"]
|
||||||
page = ["HTML", "RSS"]
|
page = ["HTML", "RSS"]
|
||||||
|
|
||||||
|
[pagination]
|
||||||
|
pagerSize = 12
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
dateform = "Jan 2, 2006"
|
dateform = "Jan 2, 2006"
|
||||||
dateformShort = "Jan 2"
|
dateformShort = "Jan 2"
|
||||||
dateformNum = "2006-01-02"
|
dateformNum = "2006-01-02"
|
||||||
dateformNumTime = "2006-01-02 15:04 -0700"
|
dateformNumTime = "2006-01-02 15:04 -0700"
|
||||||
|
dateformMonth = "Jan, 2006"
|
||||||
|
|
||||||
# Metadata mostly used in document's head
|
# Metadata mostly used in document's head
|
||||||
description = "Hey there, my name is Maik de Kruif, I create websites, bots and other kinds of software. At the moment, I'm still studying computer science at Avans University of Applied Sciences. I am also a big fan of open-source software, which is why you'll find many of my projects on Github. And last but not least, I love playing around with cyber-security related stuff."
|
description = "Hey there, my name is Maik de Kruif, I create websites, bots and other kinds of software. At the moment, I'm still studying computer science at Avans University of Applied Sciences. I am also a big fan of open-source software, which is why you'll find many of my projects on Github. And last but not least, I love playing around with cyber-security related stuff."
|
||||||
@@ -65,6 +52,8 @@ googleAnalytics = "UA-136337666-1"
|
|||||||
|
|
||||||
genre = "Blog"
|
genre = "Blog"
|
||||||
|
|
||||||
|
rssLimit = 15
|
||||||
|
|
||||||
showReadingTimeInList = false
|
showReadingTimeInList = false
|
||||||
|
|
||||||
homeSubtitle = "Software Engineering, Linux and Cyber Security"
|
homeSubtitle = "Software Engineering, Linux and Cyber Security"
|
||||||
@@ -72,6 +61,12 @@ googleAnalytics = "UA-136337666-1"
|
|||||||
# Prefix of link to the git commit detail page. GitInfo must be enabled.
|
# Prefix of link to the git commit detail page. GitInfo must be enabled.
|
||||||
gitUrl = "https://github.com/maikka39/Personal-Website/commit/"
|
gitUrl = "https://github.com/maikka39/Personal-Website/commit/"
|
||||||
|
|
||||||
|
# Add domain for GoatCounter to enable
|
||||||
|
goatCounter = "webstats.maik.dev"
|
||||||
|
|
||||||
|
# Show pageviews on posts, writeups, etc.
|
||||||
|
showPageViews = true
|
||||||
|
|
||||||
# Set disableReadOtherPosts to true in order to hide the links to other posts.
|
# Set disableReadOtherPosts to true in order to hide the links to other posts.
|
||||||
disableReadOtherPosts = false
|
disableReadOtherPosts = false
|
||||||
|
|
||||||
@@ -111,6 +106,15 @@ googleAnalytics = "UA-136337666-1"
|
|||||||
alt = "Portrait"
|
alt = "Portrait"
|
||||||
size = "175px"
|
size = "175px"
|
||||||
|
|
||||||
|
[params.author]
|
||||||
|
name = "Maik de Kruif"
|
||||||
|
email = "maik@maik.dev"
|
||||||
|
twitter = "@maik_dev"
|
||||||
|
image = "/img/home/portrait.png"
|
||||||
|
|
||||||
|
[params.general]
|
||||||
|
twitter = "@maik_dev"
|
||||||
|
|
||||||
# Wallets
|
# Wallets
|
||||||
[[params.wallets]]
|
[[params.wallets]]
|
||||||
name = "XMR"
|
name = "XMR"
|
||||||
@@ -175,7 +179,6 @@ googleAnalytics = "UA-136337666-1"
|
|||||||
|
|
||||||
[languages]
|
[languages]
|
||||||
[languages.en]
|
[languages.en]
|
||||||
subtitle = "maik.dev"
|
|
||||||
weight = 1
|
weight = 1
|
||||||
copyright = "© Maik de Kruif (maik_dev). All rights reserved."
|
copyright = "© Maik de Kruif (maik_dev). All rights reserved."
|
||||||
|
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
baseURL = "https://maik.dev/"
|
||||||
|
|
||||||
|
[services]
|
||||||
|
[services.googleAnalytics]
|
||||||
|
id = "UA-136337666-1"
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
+++
|
||||||
|
author = "Maik de Kruif"
|
||||||
|
title = "Advent of Code"
|
||||||
|
start_date = 2020-10-15
|
||||||
|
end_date = 2099-05-04
|
||||||
|
company_name = "Personal"
|
||||||
|
company_url = "https://maik.dev"
|
||||||
|
cover = "img/portfolio/adventofcode/screenshot.png"
|
||||||
|
description = "Advent of Code is an annual programming event that presents daily coding puzzles. I actively participate in the events, solving the challenges and improving my coding skills."
|
||||||
|
source_code = "https://github.com/maikka39/Advent-of-Code"
|
||||||
|
skills = [
|
||||||
|
"Problem-solving",
|
||||||
|
"Programming efficiency",
|
||||||
|
"Time management",
|
||||||
|
]
|
||||||
|
+++
|
||||||
|
|
||||||
|
|
||||||
|
[Advent of Code](https://adventofcode.com/) is a popular annual programming event that presents a series of coding puzzles, one for each day of December until Christmas. Each puzzle involves solving a problem using a programming language of your choice, with (generally) increasing difficulty as the event progresses.
|
||||||
|
|
||||||
|
I actively participate in Advent of Code, relishing the daily challenges and the opportunity to sharpen my coding skills. The puzzles covered a wide range of topics, from string manipulation and data structures to algorithms and game theory.
|
||||||
|
|
||||||
|
By consistently solving the puzzles, I hone my problem-solving abilities, improve my understanding of different programming paradigms, and discover new and innovative approaches to coding challenges.
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
+++
|
||||||
|
author = "Maik de Kruif"
|
||||||
|
title = "Google Foobar"
|
||||||
|
start_date = 2020-10-15
|
||||||
|
end_date = 2021-05-04
|
||||||
|
company_name = "Personal"
|
||||||
|
company_url = "https://maik.dev"
|
||||||
|
cover = "img/portfolio/google-foobar/screenshot.png"
|
||||||
|
description = "Google Foobar is a mysterious coding challenge platform launched by Google. I successfully solved all the challenges presented by the platform, showcasing my coding abilities and problem-solving skills."
|
||||||
|
source_code = "https://github.com/maikka39/Google-Foobar"
|
||||||
|
skills = [
|
||||||
|
"Problem-solving",
|
||||||
|
"Algorithm design",
|
||||||
|
"Time management",
|
||||||
|
]
|
||||||
|
+++
|
||||||
|
|
||||||
|
Google Foobar is a mysterious coding challenge platform launched by Google. It's designed to identify exceptional engineering talent through a series of progressively difficult coding problems. The platform's unique approach involves inviting users to solve challenges directly via the Google Search page, adding an element of intrigue and surprise.
|
||||||
|
|
||||||
|
I was fortunate enough to receive an invitation to Google Foobar. The initial challenge was a simple warm-up, but subsequent levels escalated in complexity, requiring me to delve into various algorithms and data structures.
|
||||||
|
|
||||||
|
Throughout my journey, I faced a diverse range of problems, from graph traversal and dynamic programming to string manipulation and number theory. Each challenge presented a unique opportunity to test my problem-solving skills and explore new coding techniques.
|
||||||
|
|
||||||
|
With dedication and perseverance, I managed to successfully solve all the challenges presented by Google Foobar. It was a rewarding experience that allowed me to showcase my coding abilities and learn new maths concepts.
|
||||||
|
|
||||||
|
~~If you're a passionate coder looking for a stimulating challenge, Google Foobar is definitely worth exploring. It's a great way to test your skills, learn new concepts, and potentially open doors to exciting opportunities.~~ Unfortunately, Google shut down the platform, and the challenges are no longer available. You can still try them by taking a look at the challenge texts in my GitHub repo, by clicking the link at the top of this post.
|
||||||
@@ -7,11 +7,12 @@ company_name = "Personal"
|
|||||||
company_url = "https://maik.dev"
|
company_url = "https://maik.dev"
|
||||||
cover = "img/portfolio/learn-to-program/screenshot.png"
|
cover = "img/portfolio/learn-to-program/screenshot.png"
|
||||||
description = "This website was created for a school assignment. It was created with HTML and CSS only and no frameworks were used."
|
description = "This website was created for a school assignment. It was created with HTML and CSS only and no frameworks were used."
|
||||||
|
source_code = "https://github.com/maikka39/Learn-to-Program"
|
||||||
|
live_demo = "https://maikka39.github.io/Learn-to-Program/"
|
||||||
skills = [
|
skills = [
|
||||||
"Pure HTML and CSS",
|
"Pure HTML and CSS",
|
||||||
|
"Web design",
|
||||||
]
|
]
|
||||||
+++
|
+++
|
||||||
|
|
||||||
This website was created for a school assignment. It was created with HTML and CSS only and no frameworks were used.
|
This website was created for a school assignment. It was created with HTML and CSS only and no frameworks were used. Not even JS was allowed (so I had to get creative with animations).
|
||||||
|
|
||||||
[Github](https://github.com/maikka39/Learn-to-Program)
|
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
+++
|
||||||
|
author = "Maik de Kruif"
|
||||||
|
title = "MailServerSetup"
|
||||||
|
start_date = 2021-04-22
|
||||||
|
end_date = 2021-06-24
|
||||||
|
company_name = "Personal"
|
||||||
|
company_url = "https://maik.dev"
|
||||||
|
description = "A script that automates the grueling process of installing and setting up an email server. It perfectly reproduces my successful steps to ensure the same setup time and time again, now with many improvements."
|
||||||
|
source_code = "https://github.com/maikka39/MailServerSetup"
|
||||||
|
skills = [
|
||||||
|
"Mailing protocol",
|
||||||
|
"SPF, DKIM, DMARC",
|
||||||
|
"Bash scripting",
|
||||||
|
]
|
||||||
|
+++
|
||||||
|
|
||||||
|
A script that automates the grueling process of installing and setting up an email server. It perfectly reproduces my successful steps to ensure the same setup time and time again, now with many improvements.
|
||||||
|
|
||||||
|
MailServerSetup ensures a consistent and efficient deployment. It leverages Postfix, Dovecot, and SpamAssassin, providing an all-round email solution.
|
||||||
|
|
||||||
|
Simply specify your desired domain, and the script will handle the setup, including generating the necessary SPF, DMARC, and DKIM records and providing them to you.
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
+++
|
||||||
|
author = "Maik de Kruif"
|
||||||
|
title = "MinecraftClient"
|
||||||
|
start_date = 2022-08-30
|
||||||
|
end_date = 2022-12-29
|
||||||
|
company_name = "Personal"
|
||||||
|
company_url = "https://maik.dev"
|
||||||
|
cover = "img/portfolio/minecraft-client/cover.png"
|
||||||
|
description = "A Minecraft client that was designed to overcome a series of challenges presented by a YouTuber named LiveOverflow. The client was built using Kotlin and Fabric, and it featured creative solutions to bypass the server's defenses."
|
||||||
|
source_code = "https://github.com/maikka39/MinecraftClient"
|
||||||
|
skills = [
|
||||||
|
"Java code injection",
|
||||||
|
"Reverse engineering",
|
||||||
|
"Java & Gradle",
|
||||||
|
]
|
||||||
|
+++
|
||||||
|
|
||||||
|
A Minecraft client that was designed to overcome a series of challenges presented by a YouTuber named LiveOverflow. The client was built using Kotlin and Fabric, and it featured creative solutions to bypass the server's defenses.
|
||||||
|
|
||||||
|
LiveOverflow set up a secret Minecraft server with a twist: finding it was the first challenge. After some clever detective work, including exploiting a slip-up in one of LiveOverflow's videos, I gained access.
|
||||||
|
|
||||||
|
The real fun began with the server's challenges. One required the client to move the player in a way that mimicked a bot, not a human. This meant overcoming the limitations of how computers represent numbers to ensure the server wouldn't detect "human-like" rounding errors.
|
||||||
|
|
||||||
|
Another challenge involved reaching a protected chest. The initial solution involved some trickery, but the server was patched. To adapt, the client needed to exploit a loophole in how the server tracked player movement. By manipulating the game's internal state and sending carefully crafted packets, the client achieved imperceptible movements, bypassing the server's defenses.
|
||||||
|
|
||||||
|
Reverse engineering the server's code was crucial in finding these exploits. By understanding the server's logic and implementation, I could identify vulnerabilities and devise strategies to exploit them. This process required a deep dive into the Minecraft server's source code and a keen eye for potential weaknesses.
|
||||||
|
|
||||||
|
The code for this client was written in Kotlin and injected into the Minecraft client using Fabric. This approach allowed for flexibility and customization, perfectly suited for tackling the server's unique challenges.
|
||||||
|
|
||||||
|
This project was a fascinating exploration of Minecraft's inner workings and the creativity required to overcome seemingly impossible challenges. As new challenges emerge, this client was ready to evolve and conquer them!
|
||||||
|
|
||||||
|
See also [my post about the experience]({{% ref "posts/liveoverflow-minecraft-server.md" %}}) for a more in-depth explanation.
|
||||||
@@ -6,6 +6,7 @@ end_date = 2021-04-24
|
|||||||
company_name = "Personal"
|
company_name = "Personal"
|
||||||
company_url = "https://maik.dev"
|
company_url = "https://maik.dev"
|
||||||
description = "A Discord bot I wrote for my own server so that I could manage the server better and listen to music in voice channels."
|
description = "A Discord bot I wrote for my own server so that I could manage the server better and listen to music in voice channels."
|
||||||
|
source_code = "https://github.com/maikka39/SuperBot"
|
||||||
skills = [
|
skills = [
|
||||||
"Python",
|
"Python",
|
||||||
"Asynchronous programming",
|
"Asynchronous programming",
|
||||||
@@ -15,8 +16,6 @@ skills = [
|
|||||||
|
|
||||||
An amazing Discord bot with lots of functionalities!
|
An amazing Discord bot with lots of functionalities!
|
||||||
|
|
||||||
A Discord bot I wrote for my own server so that I could manage the server better and listen to music in voice channels.
|
SuperBot is a Discord bot I wrote for my own server so that I could manage the server better and listen to music together in voice channels.
|
||||||
|
|
||||||
SuperBot is the solution to your crowded and chaotic Discord server!
|
I developed SuperBot using Python. Through this project, I gained experience in Discord bot development, including API interactions, event handling, and user interface design. Additionally, I learned valuable lessons in error handling, optimization, and scalability.
|
||||||
|
|
||||||
[Github](https://github.com/maikka39/SuperBot)
|
|
||||||
|
|||||||
@@ -2,10 +2,11 @@
|
|||||||
author = "Maik de Kruif"
|
author = "Maik de Kruif"
|
||||||
title = "Toy-Neural-Network-Py"
|
title = "Toy-Neural-Network-Py"
|
||||||
start_date = 2019-03-02
|
start_date = 2019-03-02
|
||||||
end_date = 2019-04-16
|
end_date = 2021-06-07
|
||||||
company_name = "Personal"
|
company_name = "Personal"
|
||||||
company_url = "https://maik.dev"
|
company_url = "https://maik.dev"
|
||||||
description = "Neural Network Python library for experimenting with Machine Learning"
|
description = "Neural Network Python library for experimenting with Machine Learning."
|
||||||
|
source_code = "https://github.com/maikka39/Toy-Neural-Network-Py"
|
||||||
skills = [
|
skills = [
|
||||||
"Machine Learning",
|
"Machine Learning",
|
||||||
"Neural Networks",
|
"Neural Networks",
|
||||||
@@ -14,6 +15,8 @@ skills = [
|
|||||||
]
|
]
|
||||||
+++
|
+++
|
||||||
|
|
||||||
Neural Network Python library for experimenting with Machine Learning
|
Neural Network Python library for experimenting with Machine Learning.
|
||||||
|
|
||||||
[Github](https://github.com/maikka39/Toy-Neural-Network-Py)
|
Based on the amazing work done by [Daniel Shiffman](https://github.com/shiffman) at [TheCodingTrain](https://thecodingtrain.com/), I built my own Neural Network library in Python. I used [Chapter 10: Neural Networks](https://natureofcode.com/neural-networks/) of his Nature of Code book as a reference.
|
||||||
|
|
||||||
|
Building this library was a very valuable learning experience. It’s helped me grasp the underlying principles of these models, from basic neuron structures to more complex algorithms like backpropagation.
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
+++
|
||||||
|
author = "Maik de Kruif"
|
||||||
|
title = "UnEngine"
|
||||||
|
start_date = 2022-11-09
|
||||||
|
end_date = 2022-12-22
|
||||||
|
company_name = "Personal"
|
||||||
|
company_url = "https://maik.dev"
|
||||||
|
cover = "img/portfolio/unengine/screenshot.png"
|
||||||
|
description = "Together with three other students, I built a game engine from the ground up using C++. To put our engine to the test, we also developed a fun racing game."
|
||||||
|
skills = [
|
||||||
|
"Low level programming",
|
||||||
|
"Game engine architecture",
|
||||||
|
"Event-driven programming",
|
||||||
|
"Networking",
|
||||||
|
"Teamwork",
|
||||||
|
]
|
||||||
|
|
||||||
|
[source_code]
|
||||||
|
engine = "https://github.com/Systems-Programming-in-C-Minor/engine"
|
||||||
|
game = "https://github.com/Systems-Programming-in-C-Minor/game"
|
||||||
|
server = "https://github.com/Systems-Programming-in-C-Minor/server"
|
||||||
|
+++
|
||||||
|
|
||||||
|
Together with three other students, I built a game engine from the ground up using C++. To put our engine to the test, we also developed a fun racing game.
|
||||||
|
|
||||||
|
The racing game offered a variety of features: AI-controlled opponents that challenged players, controller support for a more immersive experience, local multiplayer for split-screen fun, and online multiplayer capabilities using a game server.
|
||||||
|
|
||||||
|
To add variety and replayability, we included multiple maps and game modes. Players could race on different tracks, each with its own unique challenges, obstacles and sound effects.
|
||||||
|
|
||||||
|
Our game engine was crafted using C++ and SDL2, and provided the foundation for our racing game. We adopted an event-driven architecture, allowing our engine to efficiently handle various inputs and events. To create a realistic experience, we implemented physics calculations for collisions, speed, and traction.
|
||||||
|
|
||||||
|
To enhance the audio experience, we developed a sound engine that allowed us to incorporate a variety of sound effects into our game. To optimize performance and memory usage, we implemented texture pooling, which efficiently manages and reuses textures. Finally, to enable multiplayer functionality, we integrated networking capabilities into our engine, allowing players to connect and compete with each other online.
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
author = "Maik de Kruif"
|
author = "Maik de Kruif"
|
||||||
title = "WatchTogether"
|
title = "WatchTogether"
|
||||||
start_date = 2018-08-17
|
start_date = 2018-08-17
|
||||||
end_date = 9999-01-01
|
end_date = 2021-01-25
|
||||||
company_name = "Personal"
|
company_name = "Personal"
|
||||||
company_url = "https://maik.dev"
|
company_url = "https://maik.dev"
|
||||||
cover = "img/portfolio/watch-together/screenshot.png"
|
cover = "img/portfolio/watch-together/screenshot.png"
|
||||||
@@ -15,10 +15,16 @@ skills = [
|
|||||||
"Real time synchronization",
|
"Real time synchronization",
|
||||||
"REST API",
|
"REST API",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[source_code]
|
||||||
|
frontend = "https://github.com/maikka39/WatchTogether"
|
||||||
|
backend = "https://github.com/maikka39/WatchTogether-Server"
|
||||||
+++
|
+++
|
||||||
|
|
||||||
WatchTogether is an online service that lets you watch a video together with your friends without being in the same room!
|
WatchTogether is an online service that lets you watch a video together with your friends without being in the same room!
|
||||||
|
|
||||||
[Github](https://github.com/maikka39/WatchTogether)
|
WatchTogether is an online service that synchronizes video playback across users' web browsers, allowing friends to enjoy videos together virtually. This project challenged me to build both the front-end and back-end. I utilized React to create a user-friendly interface and Node.js with Socket.IO in the back-end to handle the real-time communication and video synchronization.
|
||||||
|
|
||||||
[Github (backend)](https://github.com/maikka39/WatchTogether-Server)
|
However, I quickly realized that synchronizing anything between clients on terrible network connections is a real challenge. This project pushed me to find solutions to ensure a smooth viewing experience, even on potato internet connections.
|
||||||
|
|
||||||
|
WatchTogether not only provided a fun solution for remote movie nights, but also deepened my knowledge of front-end frameworks like React and back-end technologies like Node.js and Socket.IO.
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ company_name = "Personal"
|
|||||||
company_url = "https://maik.dev"
|
company_url = "https://maik.dev"
|
||||||
cover = "img/portfolio/youtube-music-desktop-player/screenshot.png"
|
cover = "img/portfolio/youtube-music-desktop-player/screenshot.png"
|
||||||
description = "YouTube Music Desktop Player converts YouTube Music to a standalone desktop app. Because of this, you will never have to go through all your tabs to control your music."
|
description = "YouTube Music Desktop Player converts YouTube Music to a standalone desktop app. Because of this, you will never have to go through all your tabs to control your music."
|
||||||
|
source_code = "https://github.com/maikka39/Youtube-Music-Desktop-Player"
|
||||||
skills = [
|
skills = [
|
||||||
"Desktop Application Development",
|
"Desktop Application Development",
|
||||||
"Electron",
|
"Electron",
|
||||||
@@ -17,6 +18,8 @@ skills = [
|
|||||||
|
|
||||||
YouTube Music Desktop Player converts YouTube Music to a standalone desktop app. Because of this, you will never have to go through all your tabs to control your music.
|
YouTube Music Desktop Player converts YouTube Music to a standalone desktop app. Because of this, you will never have to go through all your tabs to control your music.
|
||||||
|
|
||||||
_This software has no affiliation this Google, YouTube Music is a trademark of Google LCC._
|
Before Google released their official YouTube Music desktop app, I created my own using Electron. I used script injection to add custom features like buttons, media key control, Discord rich presence, and custom styling. Additionally, I implemented [MPRIS](https://specifications.freedesktop.org/mpris-spec/latest/) support for integration with desktop environments.
|
||||||
|
|
||||||
[Github](https://github.com/maikka39/Youtube-Music-Desktop-Player)
|
This project was a valuable learning experience, as it allowed me to explore the capabilities of Electron and deepen my understanding of web technologies and desktop app development. It also gave me the opportunity to solve real-world problems and create a tool that enhanced the YouTube Music experience.
|
||||||
|
|
||||||
|
_This software has no affiliation this Google, YouTube Music is a trademark of Google LLC._
|
||||||
|
|||||||
@@ -0,0 +1,77 @@
|
|||||||
|
+++
|
||||||
|
author = "Maik de Kruif"
|
||||||
|
title = "FIRST LEGO League"
|
||||||
|
date = 2020-01-01T08:00:00+02:00
|
||||||
|
description = "Together with the other members of Brainbuddies, I participated twice in the FIRST LEGO League competition. We reached the Benelux finals and received prizes for both our Robot and Core Values presentations."
|
||||||
|
cover = "img/posts/first-lego-league/cover.jpg"
|
||||||
|
tags = [
|
||||||
|
"personal",
|
||||||
|
]
|
||||||
|
categories = [
|
||||||
|
"personal",
|
||||||
|
"misc",
|
||||||
|
]
|
||||||
|
+++
|
||||||
|
|
||||||
|
|
||||||
|
Together with the other members of Brainbuddies, I participated twice in the FIRST LEGO League competition. We reached the Benelux finals and received prizes for both our Robot and Core Values presentations.
|
||||||
|
|
||||||
|
[FIRST LEGO League (FLL)](https://en.wikipedia.org/wiki/FIRST_Lego_League_Challenge) is an international competition for elementary and middle school students. Each year in August FIRST LEGO League introduces a scientific and real-world challenge for teams to focus and research on. The robotics part of the competition involves designing and programming LEGO Mindstorms robots to complete tasks. The students also work out a solution to a problem related to the theme (changes every year) and then meet for regional, national and international tournaments to compete, share their knowledge, compare ideas, and display their robots.
|
||||||
|
|
||||||
|
## The beginning
|
||||||
|
|
||||||
|
The story starts in 2014. Being 12 years old at the time, the amount of things you need to manage as a team can be overwhelming.
|
||||||
|
|
||||||
|
The FLL challenge consists of three parts; research a real-world problem, design a solution, and create a LEGO robot to complete missions related to the theme. At the finals, the teams also present their research project and robot design to judges, demonstrating their creativity, problem-solving skills, and teamwork.
|
||||||
|
|
||||||
|
Our team consisted of six people, one of which being [Raymon](https://raymon.dev/). Since we each had different strenths, we each were in charge of own subject. My primary focus was on developing the robot.
|
||||||
|
|
||||||
|
## Robot design and programming
|
||||||
|
|
||||||
|
When I started, I had hardly any knowledge of LEGO Mindstorms, let alone how to program one. I had played around a bit with [Scratch](https://en.wikipedia.org/wiki/Scratch_(programming_language)) at the time, which is what got me interested in programming, but never developed something tangible.
|
||||||
|
|
||||||
|
As a team we went to work on an old track from a previous edition first. This way, we could increase our knowledge of LEGO Mindstorms, and how its programming works. In the beginning it was quite a challenge. As it turns out, physics is a real thing, and telling the robot to go straight doesn't mean it actually will:smiling_face_with_tear:. In the end we were able to solve most of the challenges from this previous edition.
|
||||||
|
|
||||||
|
Since we were young and had plenty of other things to distract us, we took our time, and worked on the robot on and off for a few years. As we were perfecting the previous track, the new theme was announced: Hydrodynamics. The track that came with it was on a completely different level. It took us quite some time to adapt.
|
||||||
|
|
||||||
|
{{< figure class="small" src="/img/posts/first-lego-league/robot.jpg" title="Our robot around 2016" >}}
|
||||||
|
|
||||||
|
## Regionals
|
||||||
|
|
||||||
|
It's now November 24th 2017, regional finals time!
|
||||||
|
|
||||||
|
There were many teams present. Each and every one of them prepared themselves and now the competition can truly begin. All the teams were putting the finishing touches on their robot, and it was fun to see the creative solutions the other teams came up with.
|
||||||
|
|
||||||
|
### The Robot Competition
|
||||||
|
|
||||||
|
In the first round we got 80 points, which gave us first place for the first round. After that we remained high, but the Facimus team overtook us in the second round. In the third round we were unfortunately again overtaken, this time by the Robodirck team. We eventually came third in the robot section.
|
||||||
|
|
||||||
|
### The Project Presentation
|
||||||
|
|
||||||
|
When we walked into the jury room, and put the project on the table, you could already see that the jury was impressed. The presentation itself went well, and they thought it was a nice project.
|
||||||
|
|
||||||
|
### The Core Values presentation
|
||||||
|
|
||||||
|
The core values presentation went fantastically, we were able to tell a lot about our team, how we worked and how we experienced it. The jury gave us full points, they really liked our team and presentation.
|
||||||
|
|
||||||
|
### The Robot presentation
|
||||||
|
|
||||||
|
Finally we showed our robot. We explained how we came up with the robot, how we first we had an internal competition within the team to experiment, and later had brought back the best aspects of all robots in one new robot. This presentation was also well received.
|
||||||
|
|
||||||
|
### The award ceremony
|
||||||
|
|
||||||
|
Finally the most exciting moment came, the award ceremony. We were not called forward for the 'smaller' prizes for the separate components, which we thought was a bit strange having received very good feedback from the juries. But in the end we turned out to have won the main prize!!! This meant that we could go straight to the Benelux finals. A moment never to forget.
|
||||||
|
|
||||||
|
{{< figure class="small" src="/img/posts/first-lego-league/nationals-invitation.jpg" title="Invitation to the Benelux finals" >}}
|
||||||
|
|
||||||
|
_Note: Benelux is an intergovernmental union of Belgium, the Netherlands, and Luxembourg._
|
||||||
|
|
||||||
|
## The Benelux finals
|
||||||
|
|
||||||
|
The moment we won the regional finals, we could breathe again. The pressure from the regionals came of, but was partly replaced by the upcoming finals. Luckily there was quite a bit of time between the events, and we needed it. We decided to mainly work on improving our robot. We gained a lot of experience from the regional finals, and our most important lesson was that changing the robot for the different challenges took far too long. The runs on the table are time limited, and we were losing half our time changing the extensions. Extensions were the LEGO constructions that we were adding to the robot to perform certain tasks. We had to think of a different design and create it quickly.
|
||||||
|
|
||||||
|
Unfortunately, we couldn't win this one:cry:. The competition was simply too fierce.
|
||||||
|
|
||||||
|
## Looking back
|
||||||
|
|
||||||
|
Looking back at this all, I learned a lot. Working with a team on a complex project at that age, was an experience that helped me throughout my early career. To all kids between age 9 and 15 I would say to try and participate in an event like this if they have the chance. I certainly would do it again.
|
||||||
@@ -0,0 +1,425 @@
|
|||||||
|
+++
|
||||||
|
author = "Maik de Kruif"
|
||||||
|
title = "LiveOverflow's Minecraft Server"
|
||||||
|
date = 2022-09-14T02:46:01+02:00
|
||||||
|
description = "Around five months ago LiveOverflow started a series called Minecraft:HACKED. He invited everyone to find the server and join, but that was easier said than done."
|
||||||
|
cover = "img/posts/liveoverflow-minecraft-server/cover.png"
|
||||||
|
tags = [
|
||||||
|
"minecraft",
|
||||||
|
"challenge",
|
||||||
|
"hacking",
|
||||||
|
]
|
||||||
|
categories = [
|
||||||
|
"games",
|
||||||
|
"hacking",
|
||||||
|
]
|
||||||
|
+++
|
||||||
|
|
||||||
|
Around five months ago [LiveOverflow](https://www.youtube.com/c/LiveOverflow) started a series called [Minecraft:HACKED](https://www.youtube.com/playlist?list=PLhixgUqwRTjwvBI-hmbZ2rpkAl4lutnJG). He invited everyone to find the server and join, but that was easier said than done.
|
||||||
|
|
||||||
|
## Concept
|
||||||
|
|
||||||
|
During one of his earlier videos, LiveOverflow challenged his viewers to find the Minecraft server he was playing on and come join it. At first, this was the only challenge, but as time went on and the server existed for longer, more challenge were added. At first, players had to bypass an algorithm that would kick players who moved like humans, but later on, we had to bypass a popular server plugin. All in all, I had/have a great time playing on the server and learned a lot about how Minecraft works, and how to write mods for it.
|
||||||
|
|
||||||
|
## Finding the server
|
||||||
|
|
||||||
|
In LiveOverflow's eighth video, [he told his viewers that the server has been opened to the public](https://youtu.be/QradKmQ27JY?t=1246). I immediately started looking for ways to find it. After researching for a while, I found multiple ways to find it, but I thought they would all take a fair bit of time (I'll get back to this later). So, instead of spending time actually learning stuff, I rewatched his videos to see if there would be a clue in there. Luckily it worked out. In [one video](https://youtu.be/Hmmr1oLt-V8?t=28) he blurred the IP inside the terminal, but forgot about the terminal title bar :smile:. I notified him of this, as it was obviously unintended, and the IP was changed shortly after, as many people apparently found it.
|
||||||
|
|
||||||
|
|
||||||
|
{{< figure src="/img/posts/liveoverflow-minecraft-server/first_ip_screenshot.png" title="Screenshot of video containing the IP address" >}}
|
||||||
|
|
||||||
|
### IP change
|
||||||
|
|
||||||
|
The IP change happened of the 26th of August. Finding the new IP was going to be a harder challenge, as the change meant there was no way to find the server using the videos. At the time I was looking into it, no new video had been released, after all.
|
||||||
|
|
||||||
|
During my research, I came across masscan. This is a piece of software that lets you scan the entire internet, and even does it pretty quickly. This may come as a surprise, but It doesn't support Minecraft packets… I could add support for this, but I would have to get familiar with the code base, and I thought it would over all just be easier to write a python script that interfaces or uses the output from masscan.
|
||||||
|
|
||||||
|
I got to work and wrote a script that scans the IP range in which the old IP was located. It starts by using masscan to scan the entire range of IP addresses, and saves it to a file to use later. I then read this file, and request basic Minecraft server information like its MOTD, players and favicon. This information was saved in another file, in which, I could easily search for LiveOverflow. In the end, the new IP only had one digit changed.
|
||||||
|
|
||||||
|
{{< code language="python" title="scan.py" isCollapsed="true" >}}
|
||||||
|
|
||||||
|
```py
|
||||||
|
import masscan
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
from mcstatus import JavaServer
|
||||||
|
from queue import Queue, Empty
|
||||||
|
from threading import Thread
|
||||||
|
import base64
|
||||||
|
from time import sleep
|
||||||
|
from contextlib import suppress
|
||||||
|
from os import remove
|
||||||
|
|
||||||
|
ip_ranges = [
|
||||||
|
"116.202.0.0/16",
|
||||||
|
"116.203.0.0/16",
|
||||||
|
"128.140.0.0/17",
|
||||||
|
"135.181.0.0/16",
|
||||||
|
"136.243.0.0/16",
|
||||||
|
"138.201.0.0/16",
|
||||||
|
"142.132.128.0/17",
|
||||||
|
"144.76.0.0/16",
|
||||||
|
"148.251.0.0/16",
|
||||||
|
"157.90.0.0/16",
|
||||||
|
"159.69.0.0/16",
|
||||||
|
"162.55.0.0/16",
|
||||||
|
"167.233.0.0/16",
|
||||||
|
"167.235.0.0/16",
|
||||||
|
"168.119.0.0/16",
|
||||||
|
"171.25.225.0/24",
|
||||||
|
"176.9.0.0/16",
|
||||||
|
"178.212.75.0/24",
|
||||||
|
"178.63.0.0/16",
|
||||||
|
"185.107.52.0/22",
|
||||||
|
"185.110.95.0/24",
|
||||||
|
"185.112.180.0/24",
|
||||||
|
"185.126.28.0/22",
|
||||||
|
"185.12.65.0/24",
|
||||||
|
"185.136.140.0/23",
|
||||||
|
"185.157.176.0/23",
|
||||||
|
"185.157.178.0/23",
|
||||||
|
"185.157.83.0/24",
|
||||||
|
"185.171.224.0/22",
|
||||||
|
"185.189.228.0/24",
|
||||||
|
"185.189.229.0/24",
|
||||||
|
"185.189.230.0/24",
|
||||||
|
"185.189.231.0/24",
|
||||||
|
"185.209.124.0/22",
|
||||||
|
"185.213.45.0/24",
|
||||||
|
"185.216.237.0/24",
|
||||||
|
"185.226.99.0/24",
|
||||||
|
"185.228.8.0/23",
|
||||||
|
"185.242.76.0/24",
|
||||||
|
"185.36.144.0/22",
|
||||||
|
"185.50.120.0/23",
|
||||||
|
"188.34.128.0/17",
|
||||||
|
"188.40.0.0/16",
|
||||||
|
"193.110.6.0/23",
|
||||||
|
"193.163.198.0/24",
|
||||||
|
"193.25.170.0/23",
|
||||||
|
"194.35.12.0/23",
|
||||||
|
"194.42.180.0/22",
|
||||||
|
"194.42.184.0/22",
|
||||||
|
"194.62.106.0/24",
|
||||||
|
"195.201.0.0/16",
|
||||||
|
"195.248.224.0/24",
|
||||||
|
"195.60.226.0/24",
|
||||||
|
"195.96.156.0/24",
|
||||||
|
"197.242.84.0/22",
|
||||||
|
"201.131.3.0/24",
|
||||||
|
"213.133.96.0/19",
|
||||||
|
"213.232.193.0/24",
|
||||||
|
"213.239.192.0/18",
|
||||||
|
"23.88.0.0/17",
|
||||||
|
"45.136.70.0/23",
|
||||||
|
"45.148.28.0/22",
|
||||||
|
"45.15.120.0/22",
|
||||||
|
"46.4.0.0/16",
|
||||||
|
"49.12.0.0/16",
|
||||||
|
"49.13.0.0/16",
|
||||||
|
"5.75.128.0/17",
|
||||||
|
"5.9.0.0/16",
|
||||||
|
"65.108.0.0/16",
|
||||||
|
"65.109.0.0/16",
|
||||||
|
"65.21.0.0/16",
|
||||||
|
"78.46.0.0/15",
|
||||||
|
"85.10.192.0/18",
|
||||||
|
"88.198.0.0/16",
|
||||||
|
"88.99.0.0/16",
|
||||||
|
"91.107.128.0/17",
|
||||||
|
"91.190.240.0/21",
|
||||||
|
"91.233.8.0/22",
|
||||||
|
"94.130.0.0/16",
|
||||||
|
"94.154.121.0/24",
|
||||||
|
"95.216.0.0/16",
|
||||||
|
"95.217.0.0/16",
|
||||||
|
]
|
||||||
|
|
||||||
|
thread_count = 100
|
||||||
|
# selected_range = "176.9.0.0/16"
|
||||||
|
selected_range = None
|
||||||
|
|
||||||
|
mas = masscan.PortScanner()
|
||||||
|
|
||||||
|
ip_ranges_to_scan = [selected_range] if selected_range else ip_ranges
|
||||||
|
|
||||||
|
for i, ip_range in enumerate(ip_ranges_to_scan):
|
||||||
|
print(f"Starting on range: {ip_range} [{i+1}/{len(ip_ranges_to_scan)}]")
|
||||||
|
mas.scan(ip_range, ports="25565", arguments="--max-rate 8000")
|
||||||
|
with open("hosts.json", "r+") as file:
|
||||||
|
hosts_json = json.load(file)
|
||||||
|
previous_hosts = hosts_json.get(ip_range, [])
|
||||||
|
hosts_json[ip_range] = list(set(previous_hosts) | set(mas.all_hosts))
|
||||||
|
file.seek(0)
|
||||||
|
json.dump(hosts_json, file)
|
||||||
|
|
||||||
|
with open("hosts.json", "r") as file:
|
||||||
|
hosts_json = json.load(file)
|
||||||
|
|
||||||
|
if selected_range:
|
||||||
|
hosts = hosts_json.get(selected_range, [])
|
||||||
|
else:
|
||||||
|
hosts = [host for ip_range in hosts_json.values() for host in ip_range]
|
||||||
|
|
||||||
|
hosts = list(set(hosts))
|
||||||
|
hosts[:5], len(hosts)
|
||||||
|
|
||||||
|
with open("masscans/hosts.json", "r") as file:
|
||||||
|
json_data = json.load(file)
|
||||||
|
|
||||||
|
hosts = [entry['ip'] for entry in json_data]
|
||||||
|
|
||||||
|
hosts = list(set(hosts))
|
||||||
|
hosts[:5], len(hosts)
|
||||||
|
|
||||||
|
with open("valid_hosts.json", "r") as file:
|
||||||
|
valid_hosts = json.load(file)
|
||||||
|
|
||||||
|
def handle_ip(ip):
|
||||||
|
try:
|
||||||
|
server = JavaServer.lookup(ip)
|
||||||
|
status = server.status()
|
||||||
|
|
||||||
|
server_info = {
|
||||||
|
"version": status.version.name,
|
||||||
|
"motd": status.description,
|
||||||
|
"favicon": status.favicon is not None,
|
||||||
|
"player_count": status.players.online,
|
||||||
|
"players": [player.name for player in status.players.sample or []],
|
||||||
|
}
|
||||||
|
|
||||||
|
valid_hosts[ip] = server_info
|
||||||
|
|
||||||
|
if status.favicon:
|
||||||
|
with open(f"servers/{ip}.png", 'wb') as file:
|
||||||
|
file.write(base64.b64decode(status.favicon[len("data:image/png;base64,"):]))
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Failed for IP: {ip} ({type(e)})")
|
||||||
|
|
||||||
|
|
||||||
|
def do_stuff(queue):
|
||||||
|
with suppress(Empty):
|
||||||
|
while True:
|
||||||
|
handle_ip(queue.get(block=False))
|
||||||
|
queue.task_done()
|
||||||
|
|
||||||
|
|
||||||
|
def print_progress(queue):
|
||||||
|
initial_size = queue.qsize()
|
||||||
|
def p(current_size):
|
||||||
|
print(f"Progress: {(((initial_size-current_size)/initial_size)*100):.2f}% [{initial_size-current_size}/{initial_size}]")
|
||||||
|
|
||||||
|
while (current_size := queue.qsize()) > 0:
|
||||||
|
p(current_size)
|
||||||
|
sleep(1)
|
||||||
|
p(current_size)
|
||||||
|
|
||||||
|
|
||||||
|
queue = Queue(maxsize=0)
|
||||||
|
for host in hosts:
|
||||||
|
queue.put(host)
|
||||||
|
|
||||||
|
threads = []
|
||||||
|
|
||||||
|
progress_printer = Thread(target=print_progress, args=(queue,))
|
||||||
|
progress_printer.daemon = True
|
||||||
|
progress_printer.start()
|
||||||
|
threads.append(progress_printer)
|
||||||
|
|
||||||
|
for _ in range(thread_count):
|
||||||
|
worker = Thread(target=do_stuff, args=(queue,))
|
||||||
|
worker.daemon = True
|
||||||
|
worker.start()
|
||||||
|
threads.append(worker)
|
||||||
|
|
||||||
|
queue.join()
|
||||||
|
for thread in threads:
|
||||||
|
thread.join()
|
||||||
|
|
||||||
|
with open("valid_hosts.json", "w") as file:
|
||||||
|
json.dump(valid_hosts, file)
|
||||||
|
|
||||||
|
|
||||||
|
with open("valid_hosts.json", "r") as file:
|
||||||
|
valid_hosts_data = json.load(file)
|
||||||
|
|
||||||
|
|
||||||
|
# list({data.get("version") for ip, data in valid_hosts_data.items()})
|
||||||
|
current_servers = [filename[:-4] for filename in os.listdir("possible_hits")]
|
||||||
|
|
||||||
|
def is_1_19(ip) -> bool:
|
||||||
|
return "1.19" in valid_hosts_data.get(ip).get("version")
|
||||||
|
|
||||||
|
|
||||||
|
valid_servers = list(filter(is_1_19, current_servers))
|
||||||
|
|
||||||
|
for filename in os.listdir("possible_hits"):
|
||||||
|
if filename[:-4] not in valid_servers:
|
||||||
|
remove(f"possible_hits/{filename}")
|
||||||
|
|
||||||
|
print(len(current_servers))
|
||||||
|
print(len(valid_servers))
|
||||||
|
```
|
||||||
|
|
||||||
|
{{< /code >}}
|
||||||
|
|
||||||
|
_This code is copied from a Jupyter Notebook, so it's not the most efficient and may not even work, the [here for the Github Gist of the Notebook](https://gist.github.com/maikka39/8019e2f1a45e1021fff05bd1e1688e14)_
|
||||||
|
|
||||||
|
Later, I found out the physical server was actually the same, and you could also use `traceroute` to find the new server as well.
|
||||||
|
|
||||||
|
```txt
|
||||||
|
traceroute to 176.9.20.201 (176.9.20.201), 30 hops max, 60 byte packets
|
||||||
|
1 _gateway (10.0.0.1) 1.435 ms 1.407 ms 1.381 ms
|
||||||
|
2 192.168.2.254 (192.168.2.254) 16.733 ms 16.722 ms 16.712 ms
|
||||||
|
3 static.kpn.net (195.190.228.90) 17.893 ms 17.882 ms 17.882 ms
|
||||||
|
4 139.156.98.101 (139.156.98.101) 128.740 ms 128.730 ms 128.720 ms
|
||||||
|
5 * * *
|
||||||
|
6 core24.fsn1.hetzner.com (213.239.224.253) 32.245 ms core23.fsn1.hetzner.com (213.239.224.249) 30.209 ms core24.fsn1.hetzner.com (213.239.224.253) 43.727 ms
|
||||||
|
7 ex9k1.dc6.fsn1.hetzner.com (213.239.229.94) 30.182 ms 19.697 ms 22.575 ms
|
||||||
|
8 static.205.20.9.176.clients.your-server.de (176.9.20.205) 19.665 ms 22.329 ms 22.306 ms
|
||||||
|
9 * * *
|
||||||
|
10 * * *
|
||||||
|
```
|
||||||
|
|
||||||
|
### Third IP change
|
||||||
|
|
||||||
|
The “new” IP quickly got leaked, and so a new server had been created. This time, `traceroute` did not yield any useful results, so I used the above script again. The only change I made, was adding all Hetzner ranges to the list of ranges.
|
||||||
|
|
||||||
|
### Abuse emails
|
||||||
|
|
||||||
|
Not every ISP likes people scanning the internet. I ran the script on both a VPS, and on my home network. Especially the latter was a mistake, though, as I quickly received an email telling me to stop, or I would have my internet cut off. So, If you want to scan the whole internet, don't do it from home :smile:.
|
||||||
|
|
||||||
|
{{< figure src="/img/posts/liveoverflow-minecraft-server/kpn_abuse.png" title="Screenshot of abuse email (in Dutch)" >}}
|
||||||
|
|
||||||
|
## Challenges
|
||||||
|
|
||||||
|
I had a great time playing on the server. The other players were mostly nice, having to have some technical skills to find the server probably kept most griefers out. What I found most fun about the server, were the challenges, though.
|
||||||
|
|
||||||
|
### Bot movement challenge
|
||||||
|
|
||||||
|
After some time playing on the server, the first challenge was released. As LiveOverflow explained in [this video](https://www.youtube.com/watch?v=WEMOCFe4EFE), if you move on the server, without rounding your player position to 1/100th, you get kicked with the following message:
|
||||||
|
|
||||||
|
{{< figure src="/img/posts/liveoverflow-minecraft-server/human_movement_kick_message.png" title="Human movement kick message" >}}
|
||||||
|
|
||||||
|
#### Writing a Fabric mod
|
||||||
|
|
||||||
|
Where do you even get started with solving this challenge? I didn't have any Minecraft modding experience, but had heard about [Fabric](https://fabricmc.net/). I downloaded [an example mod](https://github.com/FabricMC/fabric-example-mod) from their GitHub, and got it to intercept `PlayerMoveC2SPacket`. These are the packets your Minecraft client sends to the server, so it knows where you are.
|
||||||
|
|
||||||
|
Unfortunately, I don't have my original code anymore, so I can't give any code snippets for this part. I _can_ explain the business logic, though.
|
||||||
|
|
||||||
|
#### Moving like a bot
|
||||||
|
|
||||||
|
You might say this is a straightforward challenge, but you might be surprised. This is because the naive approach of simply multiplying a coordinate by one hundred, rounding it, and then dividing it by one hundred again will only work some of the time. The reason for this is [how floating-point numbers work](https://en.wikipedia.org/wiki/Floating-point_arithmetic). You might have heard about the classic meme that `0.1` + `0.2` equals `0.30000000000000004`. We humans work in base 10, but computers work in base 2, and not all base 10 numbers can efficiently be represented in base 2. Our mod will not work when we're sending a number that's rounded down to, for instance, x.9999999, as casting that to an int would result into a non-rounded number. The easiest way to fix this is by adding the following step:
|
||||||
|
|
||||||
|
```kt
|
||||||
|
fun round(n: Double): Double {
|
||||||
|
val rounded = Math.round(n * 100) / 100;
|
||||||
|
return Math.nextAfter(rounded, rounded + Math.signum(rounded)); // <--
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
This will get the first exact floating-point number after the given number. We can then pass the x and/or z value of the current coordinate to this method, and replace the value with the result.
|
||||||
|
|
||||||
|
### Club Mate challenge
|
||||||
|
|
||||||
|
#### Original version
|
||||||
|
|
||||||
|
Some time after the bot movement challenge, a new challenge was released. This time, we had to open a chest in a protected area. Part of the challenge was actually finding it, I stumbled across it by accident, but a hint was otherwise also given [at the end of the bot movement video](https://www.youtube.com/watch?v=WEMOCFe4EFE).
|
||||||
|
|
||||||
|
Upon entering the area, you're teleported to a floating island and greeted with a message;
|
||||||
|
|
||||||
|
{{< figure src="/img/posts/liveoverflow-minecraft-server/club_mate_original.png" title="Club Mate message" >}}
|
||||||
|
|
||||||
|
This challenge had some unintended solutions. I'll get to the intended one later, but let's first solve it the easy way :smile:.
|
||||||
|
|
||||||
|
When looking at the given pseudocode, we can see we're only teleported back on a `PlayerMoveEvent`. As LiveOverflow [later showed in a video](https://www.youtube.com/watch?v=RDkWagIW6gw), many people found bypasses to it. My solution was to throw an Ender Pearl into the region, and then immediately block all outgoing movement packets. This way the server teleports us into the region, which does not trigger a `PlayerMoveEvent`, after which, we can open a chest. A message is also sent in chat after opening the chest;
|
||||||
|
|
||||||
|
{{< figure src="/img/posts/liveoverflow-minecraft-server/acquired_club_mate.png" title="Club Mate message" >}}
|
||||||
|
|
||||||
|
#### Patched version
|
||||||
|
|
||||||
|
After LiveOverflow noticed the unintended solutions, he used the plugin WorldGuard instead of his own. This made the challenge quite a bit harder, as silly things like throwing an Ender Pearl don't work.
|
||||||
|
|
||||||
|
After reading lots of [Paper source code](https://github.com/PaperMC/Paper), I came across the following code:
|
||||||
|
|
||||||
|
```java
|
||||||
|
// Prevent 40 event-calls for less than a single pixel of movement >.>
|
||||||
|
double delta = Math.pow(this.lastPosX - to.getX(), 2) + Math.pow(this.lastPosY - to.getY(), 2) + Math.pow(this.lastPosZ - to.getZ(), 2);
|
||||||
|
float deltaAngle = Math.abs(this.lastYaw - to.getYaw()) + Math.abs(this.lastPitch - to.getPitch());
|
||||||
|
|
||||||
|
if ((delta > 1f / 256 || deltaAngle > 10f) && !this.player.isImmobile()) {
|
||||||
|
// ...
|
||||||
|
PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
|
||||||
|
// ...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
In short, this code means we can move around a tiny bit before a `PlayerMoveEvent` is sent. This caught my interest, as I thought there might be a way to change the `lastPos`. After reading more code, I found out there was!
|
||||||
|
|
||||||
|
If we send a position that is far away, like x+100, y+100, the player will be teleported back before the `PlayerMoveEvent` gets sent. During this teleport action, `lastPos` get set to the position the player had before the “far away packet” was sent.
|
||||||
|
|
||||||
|
```java
|
||||||
|
public void handleMovePlayer(ServerboundMovePlayerPacket packet) {
|
||||||
|
// ...
|
||||||
|
// d11 and d10 contain a difference in player position
|
||||||
|
if (d11 - d10 > Math.max(f2, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) {
|
||||||
|
// ...
|
||||||
|
this.teleport(this.player.getX(), this.player.getY(), this.player.getZ(), this.player.getYRot(), this.player.getXRot());
|
||||||
|
// ...
|
||||||
|
}
|
||||||
|
// ...
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean teleport(double d0, double d1, double d2, float f, float f1, Set<ClientboundPlayerPositionPacket.RelativeArgument> set, boolean flag, PlayerTeleportEvent.TeleportCause cause) {
|
||||||
|
// ...
|
||||||
|
this.internalTeleport(d0, d1, d2, f, f1, set, flag);
|
||||||
|
// ...
|
||||||
|
}
|
||||||
|
|
||||||
|
public void internalTeleport(double d0, double d1, double d2, float f, float f1, Set<ClientboundPlayerPositionPacket.RelativeArgument> set, boolean flag) {
|
||||||
|
// ...
|
||||||
|
this.awaitingPositionFromClient = new Vec3(d0, d1, d2);
|
||||||
|
// ...
|
||||||
|
|
||||||
|
this.lastPosX = this.awaitingPositionFromClient.x;
|
||||||
|
this.lastPosY = this.awaitingPositionFromClient.y;
|
||||||
|
this.lastPosZ = this.awaitingPositionFromClient.z;
|
||||||
|
this.lastYaw = f;
|
||||||
|
this.lastPitch = f1;
|
||||||
|
|
||||||
|
// ...
|
||||||
|
this.player.moveTo(d0, d1, d2, f, f1);
|
||||||
|
this.player.connection.send(new ClientboundPlayerPositionPacket(d0 - d3, d1 - d4, d2 - d5, f - f2, f1 - f3, set, this.awaitingTeleport, flag));
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
This meant that, as long as we sent a "far away packet" every `(1 / 256)**0.5` (`0.0625`) blocks, we can travel without triggering any events.
|
||||||
|
|
||||||
|
After implementing this, I could enter the region and jump in the fountain, after which, I got the HACKER rank and a bottle of Club Mate.
|
||||||
|
|
||||||
|
> maik_dev drank from the Club Mate fountain and became a real Minecraft HACKER
|
||||||
|
|
||||||
|
{{< figure src="/img/posts/liveoverflow-minecraft-server/club_mate_bottle_patched.png" title="Club Mate bottle" >}}
|
||||||
|
|
||||||
|
##### Speeding things up
|
||||||
|
|
||||||
|
This method was very slow, however. After taking another look at the [WorldGuard source code](https://github.com/EngineHub/WorldGuard), I noticed that it checks whether the player actually moved a block;
|
||||||
|
|
||||||
|
```java
|
||||||
|
public void onPlayerMove(PlayerMoveEvent event) {
|
||||||
|
Location from = event.getFrom();
|
||||||
|
Location to = event.getTo();
|
||||||
|
if (from.getBlockX() == to.getBlockX()
|
||||||
|
&& from.getBlockY() == to.getBlockY()
|
||||||
|
&& from.getBlockZ() == to.getBlockZ()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// ...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
This check means we only have to actually prevent a `PlayerMoveEvent` when we are changing from one block to another. The final code for which can be found in [my GitHub repo](https://github.com/maikka39/MinecraftClient).
|
||||||
|
|
||||||
|
## Conclusion
|
||||||
|
|
||||||
|
As of writing this, these are all the challenges I'm aware of. I'll update this post when more challenges are added.
|
||||||
@@ -1,13 +1,16 @@
|
|||||||
+++
|
+++
|
||||||
author = "Maik de Kruif"
|
author = "Maik de Kruif"
|
||||||
title = "{{ replace .Name "-" " " | title }}"
|
title = "{{ replace .Name "-" " " | title }}"
|
||||||
|
subtitle = ""
|
||||||
|
# showPageViews = false
|
||||||
date = {{ .Date }}
|
date = {{ .Date }}
|
||||||
description = ""
|
description = ""
|
||||||
images = []
|
cover = "img/writeups/google-ctf/2021/beginners-quest/10/cover.png"
|
||||||
tags = [
|
tags = [
|
||||||
"untagged",
|
"untagged",
|
||||||
]
|
]
|
||||||
categories = [
|
categories = [
|
||||||
"uncategorized",
|
"uncategorized",
|
||||||
]
|
]
|
||||||
|
# aliases = []
|
||||||
+++
|
+++
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
+++
|
|
||||||
author = "Maik de Kruif"
|
|
||||||
title = "{{ replace .Name "-" " " | title }}"
|
|
||||||
date = {{ .Date }}
|
|
||||||
description = ""
|
|
||||||
cover = ""
|
|
||||||
tags = [
|
|
||||||
"untagged",
|
|
||||||
]
|
|
||||||
categories = [
|
|
||||||
"uncategorized",
|
|
||||||
]
|
|
||||||
+++
|
|
||||||
@@ -421,3 +421,10 @@ table {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.feather {
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: -0.125em;
|
||||||
|
width: 1em;
|
||||||
|
height: 1em;
|
||||||
|
}
|
||||||
|
|||||||
@@ -13,12 +13,6 @@
|
|||||||
max-width: 600px;
|
max-width: 600px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-start-date {
|
|
||||||
&:after {
|
|
||||||
content: "—";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&-title {
|
&-title {
|
||||||
font-size: 2.625rem;
|
font-size: 2.625rem;
|
||||||
margin: 0 0 20px;
|
margin: 0 0 20px;
|
||||||
@@ -32,6 +26,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&-timespan {
|
||||||
|
margin-top: -20px;
|
||||||
|
font-size: 0.9em;
|
||||||
|
}
|
||||||
|
|
||||||
&-tags {
|
&-tags {
|
||||||
display: block;
|
display: block;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
@@ -47,6 +46,31 @@
|
|||||||
margin-top: 30px;
|
margin-top: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&-links {
|
||||||
|
font-size: 0.8em;
|
||||||
|
margin-top: -8px;
|
||||||
|
opacity: 0.7;
|
||||||
|
|
||||||
|
a {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
> * {
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
// display: flex;
|
||||||
|
// flex-direction: row;
|
||||||
|
// align-items: center;
|
||||||
|
// font-size: 0.9em;
|
||||||
|
// gap: 10px;
|
||||||
|
|
||||||
|
|
||||||
|
// > * {
|
||||||
|
// margin: 0;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
&-cover {
|
&-cover {
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
margin: 40px -50px;
|
margin: 40px -50px;
|
||||||
@@ -89,13 +113,6 @@
|
|||||||
content: "#";
|
content: "#";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.feather {
|
|
||||||
display: inline-block;
|
|
||||||
vertical-align: -0.125em;
|
|
||||||
width: 1em;
|
|
||||||
height: 1em;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.flag {
|
.flag {
|
||||||
|
|||||||
@@ -68,23 +68,20 @@
|
|||||||
|
|
||||||
&-title {
|
&-title {
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
margin: 5px 0 5px 0;
|
margin: 5px 0 2px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-company {
|
&-company {
|
||||||
font-size: 1rem;
|
font-size: 0.9rem;
|
||||||
margin: 5px 0 5px 0;
|
margin: 5px 0 5px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-year {
|
&-meta {
|
||||||
padding-top: 6px;
|
font-size: 0.8em;
|
||||||
margin-right: 1.8em;
|
|
||||||
font-size: 1.6em;
|
|
||||||
@include dimmed;
|
|
||||||
|
|
||||||
@media #{$media-size-tablet} {
|
|
||||||
margin: -6px 0 4px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&-content {
|
||||||
|
margin-top: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-item {
|
&-item {
|
||||||
|
|||||||
@@ -105,13 +105,6 @@
|
|||||||
content: "#";
|
content: "#";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.feather {
|
|
||||||
display: inline-block;
|
|
||||||
vertical-align: -0.125em;
|
|
||||||
width: 1em;
|
|
||||||
height: 1em;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.flag {
|
.flag {
|
||||||
|
|||||||
@@ -34,3 +34,14 @@ other = "Table of Contents"
|
|||||||
[wordCount]
|
[wordCount]
|
||||||
one = "One Word"
|
one = "One Word"
|
||||||
other = "{{ .Count }} Words"
|
other = "{{ .Count }} Words"
|
||||||
|
|
||||||
|
[post]
|
||||||
|
pageViews = "Views"
|
||||||
|
unknownViews = "Unknown"
|
||||||
|
present = "Present"
|
||||||
|
|
||||||
|
[portfolio]
|
||||||
|
skillsDeveloped = "Skills developed"
|
||||||
|
viewSource = "View source"
|
||||||
|
viewSourceKind = "View {{ . }} source"
|
||||||
|
liveDemo = "Live demo"
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
{{- $paginator := .Paginate .RegularPagesRecursive }}
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="{{ .Site.Language }}">
|
<html lang="{{ .Site.Language }}">
|
||||||
|
|
||||||
@@ -20,6 +19,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{ partial "javascript.html" . }}
|
{{ partial "javascript.html" . }}
|
||||||
|
<!-- SEO stuff -->
|
||||||
|
{{ partial "seo.html" . }}
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -7,11 +7,11 @@
|
|||||||
{{- with .Site.LanguageCode }}
|
{{- with .Site.LanguageCode }}
|
||||||
<language>{{.}}</language>
|
<language>{{.}}</language>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with .Site.Author.email }}
|
{{- with .Site.Params.author.email }}
|
||||||
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>
|
<managingEditor>{{.}}{{ with $.Site.Params.author.name }} ({{.}}){{end}}</managingEditor>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with .Site.Author.email }}
|
{{- with .Site.Params.author.email }}
|
||||||
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>
|
<webMaster>{{.}}{{ with $.Site.Params.author.name }} ({{.}}){{end}}</webMaster>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with .Site.Copyright }}
|
{{- with .Site.Copyright }}
|
||||||
<copyright>{{.}}</copyright>
|
<copyright>{{.}}</copyright>
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
{{- with .OutputFormats.Get "RSS" }}
|
{{- with .OutputFormats.Get "RSS" }}
|
||||||
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
|
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{ range .Pages | first 15 }}
|
{{ range .Pages | first .Site.Params.rssLimit }}
|
||||||
<item>
|
<item>
|
||||||
<title>{{ .Title }}{{ with .Params.Subtitle }} // {{ . }}{{ end }}</title>
|
<title>{{ .Title }}{{ with .Params.Subtitle }} // {{ . }}{{ end }}</title>
|
||||||
<link>{{ .Permalink }}</link>
|
<link>{{ .Permalink }}</link>
|
||||||
|
|||||||
@@ -2,17 +2,35 @@
|
|||||||
<main class="post">
|
<main class="post">
|
||||||
|
|
||||||
<div class="post-info">
|
<div class="post-info">
|
||||||
{{ if .IsTranslated }}
|
<p>
|
||||||
{{ i18n "postAvailable" }}
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||||
{{ range .Translations }}
|
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
||||||
|
class="feather feather-clock">
|
||||||
|
<circle cx="12" cy="12" r="10"></circle>
|
||||||
|
<polyline points="12 6 12 12 16 14"></polyline>
|
||||||
|
</svg>
|
||||||
|
{{ i18n "readingTime" .Page.ReadingTime }}
|
||||||
|
|
||||||
|
{{- if .IsTranslated }} | {{ i18n "postAvailable" }}
|
||||||
|
{{- range .Translations }}
|
||||||
<a href="{{ .Permalink }}"><span
|
<a href="{{ .Permalink }}"><span
|
||||||
class="flag flag-icon flag-icon-{{ index $.Site.Data.langFlags (.Lang) }} flag-icon-squared"></span></a>
|
class="flag flag-icon flag-icon-{{ index $.Site.Data.langFlags (.Lang) }} flag-icon-squared"></span></a>
|
||||||
{{ end}}
|
{{- end}}
|
||||||
{{ end }}
|
{{- end }}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<article>
|
<article>
|
||||||
<h2 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h2>
|
<h1 class="post-title">
|
||||||
|
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
|
||||||
|
</h1>
|
||||||
|
{{- with .Params.Subtitle }}
|
||||||
|
<p class="post-subtitle">{{ . | markdownify }}</p>
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- if .Params.Cover }}
|
||||||
|
{{- partial "image.html" (dict "path" .Params.Cover "alt" (.Title | plainify) "class" "post-cover") }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
{{- if .Params.toc }}
|
{{- if .Params.toc }}
|
||||||
<hr />
|
<hr />
|
||||||
@@ -23,10 +41,6 @@
|
|||||||
<hr />
|
<hr />
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- with .Params.Cover }}
|
|
||||||
{{- partial "image.html" (dict "path" . "alt" "" "class" "post-cover") }}
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
<div class="post-content">
|
<div class="post-content">
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
</div>
|
</div>
|
||||||
@@ -43,24 +57,119 @@
|
|||||||
<path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"></path>
|
<path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"></path>
|
||||||
<line x1="7" y1="7" x2="7" y2="7"></line>
|
<line x1="7" y1="7" x2="7" y2="7"></line>
|
||||||
</svg>
|
</svg>
|
||||||
|
|
||||||
{{- range . -}}
|
{{- range . -}}
|
||||||
<span class="tag"><a href="{{ "tags/" | absLangURL }}{{ . | urlize }}">{{.}}</a></span>
|
<span class="tag"><a href="{{ "tags/" | absLangURL }}{{ . | urlize }}/">{{.}}</a></span>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
</p>
|
</p>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||||
|
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
||||||
|
class="feather feather-file-text">
|
||||||
|
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path>
|
||||||
|
<polyline points="14 2 14 8 20 8"></polyline>
|
||||||
|
<line x1="16" y1="13" x2="8" y2="13"></line>
|
||||||
|
<line x1="16" y1="17" x2="8" y2="17"></line>
|
||||||
|
<polyline points="10 9 9 9 8 9"></polyline>
|
||||||
|
</svg>
|
||||||
|
{{ i18n "wordCount" .Page.WordCount }}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
{{- if and (default true .Params.showPageViews) (default true .Site.Params.showPageViews) }}
|
||||||
|
{{- if .Site.Params.goatCounter }}
|
||||||
|
<p>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||||
|
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
||||||
|
class="feather feather-activity">
|
||||||
|
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path>
|
||||||
|
<circle cx="12" cy="12" r="3"></circle>
|
||||||
|
</svg>
|
||||||
|
{{- partial "page_views.html" . -}}
|
||||||
|
</p>
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||||
|
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
||||||
|
class="feather feather-calendar">
|
||||||
|
<rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect>
|
||||||
|
<line x1="16" y1="2" x2="16" y2="6"></line>
|
||||||
|
<line x1="8" y1="2" x2="8" y2="6"></line>
|
||||||
|
<line x1="3" y1="10" x2="21" y2="10"></line>
|
||||||
|
</svg>
|
||||||
|
{{- $dateFormat := default "2006-01-02 15:04 -0700" .Site.Params.dateformNumTime }}
|
||||||
|
{{ dateFormat $dateFormat .Date.Local }}
|
||||||
|
</p>
|
||||||
|
|
||||||
{{- if .GitInfo }}
|
{{- if .GitInfo }}
|
||||||
<p><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
|
<p>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||||
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
||||||
class="feather feather-git-commit">
|
class="feather feather-git-commit">
|
||||||
<circle cx="12" cy="12" r="4"></circle>
|
<circle cx="12" cy="12" r="4"></circle>
|
||||||
<line x1="1.05" y1="12" x2="7" y2="12"></line>
|
<line x1="1.05" y1="12" x2="7" y2="12"></line>
|
||||||
<line x1="17.01" y1="12" x2="22.96" y2="12"></line>
|
<line x1="17.01" y1="12" x2="22.96" y2="12"></line>
|
||||||
</svg><a href="{{ .Site.Params.gitUrl -}}{{ .GitInfo.Hash }}" target="_blank"
|
</svg>
|
||||||
rel="noopener">{{ .GitInfo.AbbreviatedHash }}</a> @
|
|
||||||
{{ if .Site.Params.dateformNum }}{{ dateFormat .Site.Params.dateformNum .GitInfo.AuthorDate.Local }}{{ else }}{{ dateFormat "2006-01-02" .GitInfo.AuthorDate.Local }}{{ end }}
|
<a href="{{ .Site.Params.gitUrl -}}{{ .GitInfo.Hash }}" target="_blank"
|
||||||
|
rel="noopener">{{ .GitInfo.AbbreviatedHash }}</a>
|
||||||
|
{{- " @ " -}}
|
||||||
|
{{- if .Site.Params.dateformNum -}}
|
||||||
|
{{ dateFormat .Site.Params.dateformNum .GitInfo.AuthorDate.Local }}
|
||||||
|
{{- else -}}
|
||||||
|
{{ dateFormat "2006-01-02" .GitInfo.AuthorDate.Local }}
|
||||||
|
{{- end }}
|
||||||
</p>
|
</p>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{- if .Site.Params.EnableSharingButtons }}
|
||||||
|
<hr />
|
||||||
|
<div class="sharing-buttons">
|
||||||
|
{{ partial "sharing-buttons.html" . }}
|
||||||
|
</div>
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- if and (not $.Site.Params.DisableReadOtherPosts) (or .NextInSection .PrevInSection) }}
|
||||||
|
<div class="pagination">
|
||||||
|
<div class="pagination__title">
|
||||||
|
<span class="pagination__title-h">{{ .Site.Params.ReadOtherPosts }}</span>
|
||||||
|
<hr />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="pagination__buttons">
|
||||||
|
{{- if .NextInSection }}
|
||||||
|
<span class="button previous">
|
||||||
|
<a href="{{ .NextInSection.Permalink }}">
|
||||||
|
<span class="button__icon">←</span>
|
||||||
|
<span class="button__text">{{ .NextInSection.Title }}</span>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- if .PrevInSection }}
|
||||||
|
<span class="button next">
|
||||||
|
<a href="{{ .PrevInSection.Permalink }}">
|
||||||
|
<span class="button__text">{{ .PrevInSection.Title }}</span>
|
||||||
|
<span class="button__icon">→</span>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
{{- end }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
|
||||||
|
{{- if .Site.Config.Services.Disqus.Shortname }}
|
||||||
|
{{- if not (eq .Params.Comments "false") }}
|
||||||
|
<div id="comments">
|
||||||
|
{{ template "_internal/disqus.html" . }}
|
||||||
|
</div>
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
@@ -3,19 +3,17 @@
|
|||||||
<div class="footer__content">
|
<div class="footer__content">
|
||||||
<div class="footer__content__section regular">
|
<div class="footer__content__section regular">
|
||||||
<span>© {{ now.Format "2006" }}</span>
|
<span>© {{ now.Format "2006" }}</span>
|
||||||
{{- if .Site.Author.name }}
|
{{- if .Site.Params.author.name }}
|
||||||
<span><a href="{{ .Site.BaseURL }}">{{ .Site.Author.name }}</a></span>
|
<span><a href="{{ .Site.BaseURL }}">{{ .Site.Params.author.name }}</a></span>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Site.Copyright }}
|
{{- if .Site.Copyright }}
|
||||||
<span>All rights reserved.</span>
|
<span>All rights reserved.</span>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
<span><a href="/privacy/">Privacy</a></span>
|
<span><a href="/privacy/">Privacy</a></span>
|
||||||
<span>
|
<span>
|
||||||
{{- with (not (in (.Site.Language.Get "disableKinds") "RSS")) }}
|
|
||||||
<a href="{{ "index.xml" | absLangURL }}" target="_blank" title="rss">
|
<a href="{{ "index.xml" | absLangURL }}" target="_blank" title="rss">
|
||||||
{{ partial "svg.html" (dict "name" "rss") }}
|
{{ partial "svg.html" (dict "name" "rss") }}
|
||||||
</a>
|
</a>
|
||||||
{{- end }}
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer__content__section donations">
|
<div class="footer__content__section donations">
|
||||||
|
|||||||
@@ -10,11 +10,11 @@
|
|||||||
crossorigin="anonymous">
|
crossorigin="anonymous">
|
||||||
|
|
||||||
{{ $options := (dict "targetPath" "main.css" "outputStyle" "compressed" "enableSourceMap" true) }}
|
{{ $options := (dict "targetPath" "main.css" "outputStyle" "compressed" "enableSourceMap" true) }}
|
||||||
{{- $style := resources.Get "scss/main.scss" | resources.ToCSS $options | resources.Fingerprint }}
|
{{- $style := resources.Get "scss/main.scss" | css.Sass $options | resources.Fingerprint }}
|
||||||
<link rel="stylesheet" href="{{ $style.Permalink }}">
|
<link rel="stylesheet" href="{{ $style.Permalink }}">
|
||||||
|
|
||||||
{{ $options := (dict "targetPath" "syntax_highlighting.css" "outputStyle" "compressed" "enableSourceMap" true) }}
|
{{ $options := (dict "targetPath" "syntax_highlighting.css" "outputStyle" "compressed" "enableSourceMap" true) }}
|
||||||
{{- $style := resources.Get "scss/syntax_highlighting.scss" | resources.ToCSS $options | resources.Fingerprint }}
|
{{- $style := resources.Get "scss/syntax_highlighting.scss" | css.Sass $options | resources.Fingerprint }}
|
||||||
<link rel="stylesheet" href="{{ $style.Permalink }}">
|
<link rel="stylesheet" href="{{ $style.Permalink }}">
|
||||||
|
|
||||||
{{- range $val := $.Site.Params.customCSS }}
|
{{- range $val := $.Site.Params.customCSS }}
|
||||||
@@ -28,9 +28,6 @@
|
|||||||
<!-- Meta tags -->
|
<!-- Meta tags -->
|
||||||
{{- partial "meta-tags.html" . -}}
|
{{- partial "meta-tags.html" . -}}
|
||||||
|
|
||||||
<!-- SEO stuff -->
|
|
||||||
{{- partial "seo.html" . -}}
|
|
||||||
|
|
||||||
<!-- RSS -->
|
<!-- RSS -->
|
||||||
<!-- {{- with .OutputFormats.Get "rss" }}
|
<!-- {{- with .OutputFormats.Get "rss" }}
|
||||||
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
|
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
|
||||||
|
|||||||
@@ -5,10 +5,10 @@
|
|||||||
{{- $secureJS := slice $main $menu $theme $nav | resources.Concat "bundle.js" | resources.Minify | resources.Fingerprint "sha512" }}
|
{{- $secureJS := slice $main $menu $theme $nav | resources.Concat "bundle.js" | resources.Minify | resources.Fingerprint "sha512" }}
|
||||||
<script type="text/javascript" src="{{ $secureJS.Permalink }}" integrity="{{ $secureJS.Data.Integrity }}"></script>
|
<script type="text/javascript" src="{{ $secureJS.Permalink }}" integrity="{{ $secureJS.Data.Integrity }}"></script>
|
||||||
|
|
||||||
{{- if .Site.GoogleAnalytics }}
|
{{- if .Site.Config.Services.GoogleAnalytics.ID }}
|
||||||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||||
<script async src="https://www.googletagmanager.com/gtag/js?id={{ .Site.GoogleAnalytics }}"></script>
|
<script async src="https://www.googletagmanager.com/gtag/js?id={{ .Site.Config.Services.GoogleAnalytics.ID }}"></script>
|
||||||
<script>
|
<script async>
|
||||||
window.dataLayer = window.dataLayer || [];
|
window.dataLayer = window.dataLayer || [];
|
||||||
|
|
||||||
function gtag() {
|
function gtag() {
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
}
|
}
|
||||||
gtag('js', new Date());
|
gtag('js', new Date());
|
||||||
|
|
||||||
gtag('config', '{{ .Site.GoogleAnalytics }}');
|
gtag('config', '{{ .Site.Config.Services.GoogleAnalytics.ID }}');
|
||||||
</script>
|
</script>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
@@ -25,3 +25,9 @@
|
|||||||
<script src="{{ $val }}"></script>
|
<script src="{{ $val }}"></script>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
{{- if .Site.Params.goatCounter }}
|
||||||
|
<script data-goatcounter="https://{{ .Site.Params.goatCounter }}/count"
|
||||||
|
data-goatcounter-settings='{"path": "{{ .RelPermalink }}"}'
|
||||||
|
async src="//gc.zgo.at/count.js"></script>
|
||||||
|
{{- end}}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<!-- Default -->
|
<!-- Default -->
|
||||||
<meta name="author"
|
<meta name="author"
|
||||||
content="{{ if .Params.author }}{{ .Params.author }}{{ else }}{{ with .Site.Author.name }}{{ . }}{{ end }}{{ end }}">
|
content="{{ if .Params.author }}{{ .Params.author }}{{ else }}{{ with .Site.Params.author.name }}{{ . }}{{ end }}{{ end }}">
|
||||||
<meta name="description"
|
<meta name="description"
|
||||||
content="{{ if .IsHome }}{{ .Site.Params.homeSubtitle }}{{ else }}{{ .Params.description | plainify }}{{ end }}" />
|
content="{{ if .IsHome }}{{ .Site.Params.homeSubtitle }}{{ else }}{{ .Params.description | plainify }}{{ end }}" />
|
||||||
<meta name="keywords"
|
<meta name="keywords"
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
<!-- Article -->
|
<!-- Article -->
|
||||||
<meta property="article:publisher" content="{{ .Site.BaseURL }}" />
|
<meta property="article:publisher" content="{{ .Site.BaseURL }}" />
|
||||||
<meta name="article:author"
|
<meta name="article:author"
|
||||||
content="{{ if .Params.author }}{{ .Params.author }}{{ else }}{{ with .Site.Author.name }}{{ . }}{{ end }}{{ end }}">
|
content="{{ if .Params.author }}{{ .Params.author }}{{ else }}{{ with .Site.Params.author.name }}{{ . }}{{ end }}{{ end }}">
|
||||||
|
|
||||||
{{- if isset .Params "date" }}
|
{{- if isset .Params "date" }}
|
||||||
<meta property="article:published_time" content="{{ time .Date }}" />
|
<meta property="article:published_time" content="{{ time .Date }}" />
|
||||||
@@ -60,9 +60,9 @@
|
|||||||
<meta name="twitter:description"
|
<meta name="twitter:description"
|
||||||
content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}" />
|
content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}" />
|
||||||
<meta name="twitter:url" content="{{ .Permalink }}" />
|
<meta name="twitter:url" content="{{ .Permalink }}" />
|
||||||
{{- with .Site.Social.twitter }}
|
{{- with .Site.Params.general.twitter }}
|
||||||
<meta name="twitter:site" content="{{ . }}" />
|
<meta name="twitter:site" content="{{ . }}" />
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with .Site.Author.twitter }}
|
{{- with .Site.Params.author.twitter }}
|
||||||
<meta name="twitter:creator" content="{{ . }}" />
|
<meta name="twitter:creator" content="{{ . }}" />
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
{{- if .Site.Params.goatCounter }}
|
||||||
|
<span id="{{ .File.UniqueID }}" title="{{ i18n "post.pageViews" }}">{{ i18n "post.unknownViews" }}</span>
|
||||||
|
<script async>
|
||||||
|
let url =
|
||||||
|
"https://{{ .Site.Params.goatCounter }}/counter/" +
|
||||||
|
encodeURIComponent({{ .RelPermalink }}.replace(/(\/)?$/, "")) +
|
||||||
|
".json";
|
||||||
|
|
||||||
|
fetch(url)
|
||||||
|
.then(res => res.json())
|
||||||
|
.then(data => data.count)
|
||||||
|
.then(count => {
|
||||||
|
document.getElementById("{{ .File.UniqueID }}").innerText = count + " " + {{ i18n "post.pageViews" }};
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
{{- end}}
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
{{- /* <!-- Breadcrumbs --> */}}
|
{{- /* <!-- Breadcrumbs --> */}}
|
||||||
|
{{- $visiblePage := .}}
|
||||||
{{- $breadcrumbs := slice }}
|
{{- $breadcrumbs := slice }}
|
||||||
{{- $path := "" }}
|
{{- $path := "" }}
|
||||||
{{- if or (eq .Kind "taxonomy") (or (eq .Kind "term") (eq .Kind "404")) }}
|
{{- if or (eq .Kind "taxonomy") (or (eq .Kind "term") (or (eq .Kind "404") (.File))) }}
|
||||||
{{- $path = .RelPermalink }}
|
{{- $path = .RelPermalink }}
|
||||||
{{- else if .File }}
|
|
||||||
{{- $path = string .File }}
|
|
||||||
{{- else if .IsHome }}
|
{{- else if .IsHome }}
|
||||||
{{- $path = "" }}
|
{{- $path = "" }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
@@ -22,10 +21,10 @@
|
|||||||
{{- $breadcrumbs = $breadcrumbs | append (dict "name" "Not Found" "url" (printf "%s%s" $.Site.BaseURL (strings.TrimLeft "/" $currentPath))) }}
|
{{- $breadcrumbs = $breadcrumbs | append (dict "name" "Not Found" "url" (printf "%s%s" $.Site.BaseURL (strings.TrimLeft "/" $currentPath))) }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
{{- $title := $page.Title }}
|
{{- $title := $page.Title }}
|
||||||
{{- if eq $page $ }}
|
{{- if eq (trim $currentPath "/") $path }}
|
||||||
{{- $breadcrumbs = $breadcrumbs | append (dict "name" $title "url" $page.Permalink) }}
|
{{- $breadcrumbs = $breadcrumbs | append (dict "name" $visiblePage.Title "url" $visiblePage.Permalink) }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
{{- $breadcrumbs = $breadcrumbs | append (dict "name" $title "url" $page.Permalink)}}
|
{{- $breadcrumbs = $breadcrumbs | append (dict "name" $title "url" $page.Permalink) }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -39,11 +38,11 @@
|
|||||||
{
|
{
|
||||||
"@type": "Person",
|
"@type": "Person",
|
||||||
"@id": "{{ $.Site.BaseURL }}#website_founder",
|
"@id": "{{ $.Site.BaseURL }}#website_founder",
|
||||||
"name": {{ $.Site.Author.name | safeHTML }},
|
"name": {{ $.Site.Params.author.name | safeHTML }},
|
||||||
{{- with $.Site.Author.email }}
|
{{- with $.Site.Params.author.email }}
|
||||||
"email": {{ . | safeHTML }},
|
"email": {{ . | safeHTML }},
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with $.Site.Author.image }}
|
{{- with $.Site.Params.author.image }}
|
||||||
{{- $img := resources.Get . }}
|
{{- $img := resources.Get . }}
|
||||||
{{- $img = $img.Resize (printf "%dx%d png" $img.Width $img.Height) }}
|
{{- $img = $img.Resize (printf "%dx%d png" $img.Width $img.Height) }}
|
||||||
"image": {
|
"image": {
|
||||||
@@ -57,7 +56,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"@type": "Organization",
|
"@type": "Organization",
|
||||||
"name": {{ $.Site.Author.name | safeHTML }},
|
"name": {{ $.Site.Params.author.name | safeHTML }},
|
||||||
"slogan": {{$.Site.Params.HomeSubtitle | safeHTML }},
|
"slogan": {{$.Site.Params.HomeSubtitle | safeHTML }},
|
||||||
{{- with $socials := .Site.Params.social }}
|
{{- with $socials := .Site.Params.social }}
|
||||||
"sameAs": [
|
"sameAs": [
|
||||||
@@ -66,10 +65,10 @@
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
],
|
],
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with $.Site.Author.email }}
|
{{- with $.Site.Params.author.email }}
|
||||||
"email": {{ . | safeHTML }},
|
"email": {{ . | safeHTML }},
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with $.Site.Author.image }}
|
{{- with $.Site.Params.author.image }}
|
||||||
{{- $img := resources.Get . }}
|
{{- $img := resources.Get . }}
|
||||||
{{- $img = $img.Resize (printf "%dx%d png" $img.Width $img.Height) }}
|
{{- $img = $img.Resize (printf "%dx%d png" $img.Width $img.Height) }}
|
||||||
"logo": {
|
"logo": {
|
||||||
@@ -108,15 +107,15 @@
|
|||||||
{{- with .Site.Copyright }}
|
{{- with .Site.Copyright }}
|
||||||
"license": {{ . | safeHTML }},
|
"license": {{ . | safeHTML }},
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Site.Author.name }}
|
{{- if .Site.Params.author.name }}
|
||||||
{{- range slice "publisher" "author" }}
|
{{- range slice "publisher" "author" }}
|
||||||
{{ . }}: {
|
{{ . }}: {
|
||||||
"@type": "Person",
|
"@type": "Person",
|
||||||
"name": {{ $.Site.Author.name | safeHTML }},
|
"name": {{ $.Site.Params.author.name | safeHTML }},
|
||||||
{{- with $.Site.Author.email }}
|
{{- with $.Site.Params.author.email }}
|
||||||
"email": {{ . | safeHTML }},
|
"email": {{ . | safeHTML }},
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with $.Site.Author.image }}
|
{{- with $.Site.Params.author.image }}
|
||||||
{{- $img := resources.Get . }}
|
{{- $img := resources.Get . }}
|
||||||
{{- $img = $img.Resize (printf "%dx%d png" $img.Width $img.Height) }}
|
{{- $img = $img.Resize (printf "%dx%d png" $img.Width $img.Height) }}
|
||||||
"image": {
|
"image": {
|
||||||
@@ -187,15 +186,15 @@
|
|||||||
{{- with .Site.Copyright }}
|
{{- with .Site.Copyright }}
|
||||||
"license": {{ . | safeHTML }},
|
"license": {{ . | safeHTML }},
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Site.Author.name }}
|
{{- if .Site.Params.author.name }}
|
||||||
{{- range slice "publisher" "author" }}
|
{{- range slice "publisher" "author" }}
|
||||||
{{ . }}: {
|
{{ . }}: {
|
||||||
"@type": "Person",
|
"@type": "Person",
|
||||||
"name": {{ $.Site.Author.name | safeHTML }},
|
"name": {{ $.Site.Params.author.name | safeHTML }},
|
||||||
{{- with $.Site.Author.email }}
|
{{- with $.Site.Params.author.email }}
|
||||||
"email": {{ . | safeHTML }},
|
"email": {{ . | safeHTML }},
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with $.Site.Author.image }}
|
{{- with $.Site.Params.author.image }}
|
||||||
{{- $img := resources.Get . }}
|
{{- $img := resources.Get . }}
|
||||||
{{- $img = $img.Resize (printf "%dx%d png" $img.Width $img.Height) }}
|
{{- $img = $img.Resize (printf "%dx%d png" $img.Width $img.Height) }}
|
||||||
"image": {
|
"image": {
|
||||||
@@ -258,15 +257,15 @@
|
|||||||
{{- with .Site.Copyright }}
|
{{- with .Site.Copyright }}
|
||||||
"license": {{ . | safeHTML }},
|
"license": {{ . | safeHTML }},
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Site.Author.name }}
|
{{- if .Site.Params.author.name }}
|
||||||
{{- range slice "publisher" "author" }}
|
{{- range slice "publisher" "author" }}
|
||||||
{{ . }}: {
|
{{ . }}: {
|
||||||
"@type": "Person",
|
"@type": "Person",
|
||||||
"name": {{ $.Site.Author.name | safeHTML }},
|
"name": {{ $.Site.Params.author.name | safeHTML }},
|
||||||
{{- with $.Site.Author.email }}
|
{{- with $.Site.Params.author.email }}
|
||||||
"email": {{ . | safeHTML }},
|
"email": {{ . | safeHTML }},
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with $.Site.Author.image }}
|
{{- with $.Site.Params.author.image }}
|
||||||
{{- $img := resources.Get . }}
|
{{- $img := resources.Get . }}
|
||||||
{{- $img = $img.Resize (printf "%dx%d png" $img.Width $img.Height) }}
|
{{- $img = $img.Resize (printf "%dx%d png" $img.Width $img.Height) }}
|
||||||
"image": {
|
"image": {
|
||||||
|
|||||||
@@ -18,21 +18,15 @@
|
|||||||
<div class="portfolio-meta">
|
<div class="portfolio-meta">
|
||||||
{{- if .Params.start_date }}
|
{{- if .Params.start_date }}
|
||||||
<span class="portfolio-start-date">
|
<span class="portfolio-start-date">
|
||||||
{{- if eq (printf "%T" .Params.start_date) "time.Time"}}
|
{{- $dateFormat := default "Jan, 2006" .Site.Params.dateformMonth }}
|
||||||
{{ .Params.start_date.Format ($.Site.Params.DateFormatList | default "2006-01-02") }}
|
{{ dateFormat $dateFormat .Params.start_date }}
|
||||||
{{- else }}
|
|
||||||
{{ .Params.start_date }}
|
|
||||||
{{- end }}
|
|
||||||
</span>
|
</span>
|
||||||
|
—
|
||||||
<span class="portfolio-end-date">
|
<span class="portfolio-end-date">
|
||||||
{{- if eq (printf "%T" .Params.end_date) "time.Time"}}
|
{{- if and .Params.end_date (lt .Params.end_date now) }}
|
||||||
{{- if lt .Params.end_date now }}
|
{{ dateFormat $dateFormat .Params.end_date }}
|
||||||
{{ .Params.end_date.Format ($.Site.Params.DateFormatList | default "2006-01-02") }}
|
|
||||||
{{- else }}
|
{{- else }}
|
||||||
Present
|
{{ i18n "post.present" }}
|
||||||
{{- end }}
|
|
||||||
{{- else }}
|
|
||||||
{{ .Params.end_date }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
</span>
|
</span>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -60,7 +54,7 @@
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
</div>
|
</div>
|
||||||
{{- with .Params.skills }}
|
{{- with .Params.skills }}
|
||||||
<h3 class="portfolio-skills-title">Skills used:</h3>
|
<h3 class="portfolio-skills-title">{{ i18n "portfolio.skillsDeveloped"}}:</h3>
|
||||||
<ul class="portfolio-skills">
|
<ul class="portfolio-skills">
|
||||||
{{- range . }}
|
{{- range . }}
|
||||||
<li class="portfolio-skill">{{ . }}</li>
|
<li class="portfolio-skill">{{ . }}</li>
|
||||||
|
|||||||
@@ -25,26 +25,81 @@
|
|||||||
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
|
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
{{- if .Params.toc }}
|
<p class="portfolio-timespan">
|
||||||
<hr />
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||||
<aside id="toc">
|
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
||||||
<div class="toc-title">{{ i18n "tableOfContents" }}</div>
|
class="feather feather-calendar">
|
||||||
{{ .TableOfContents }}
|
<rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect>
|
||||||
</aside>
|
<line x1="16" y1="2" x2="16" y2="6"></line>
|
||||||
<hr />
|
<line x1="8" y1="2" x2="8" y2="6"></line>
|
||||||
|
<line x1="3" y1="10" x2="21" y2="10"></line>
|
||||||
|
</svg>
|
||||||
|
{{- if .Params.start_date }}
|
||||||
|
{{- $dateFormat := default "Jan, 2006" .Site.Params.dateformMonth }}
|
||||||
|
{{ dateFormat $dateFormat .Params.start_date }} — {{ if and .Params.end_date (lt .Params.end_date now) }}{{ dateFormat $dateFormat .Params.end_date }}{{ else }}{{ i18n "post.present" }}{{ end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="portfolio-links">
|
||||||
|
{{- if .Params.source_code }}
|
||||||
|
{{- if hasPrefix (printf "%T" .Params.source_code) "map" }}
|
||||||
|
{{- range $name, $url := .Params.source_code }}
|
||||||
|
<span>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||||
|
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
||||||
|
class="feather feather-code">
|
||||||
|
<polyline points="16 18 22 12 16 6"></polyline>
|
||||||
|
<polyline points="8 6 2 12 8 18"></polyline>
|
||||||
|
</svg>
|
||||||
|
<a href="{{ $url }}">{{ i18n "portfolio.viewSourceKind" $name}}</a>
|
||||||
|
</span>
|
||||||
|
{{- end }}
|
||||||
|
{{- else }}
|
||||||
|
<span>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||||
|
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
||||||
|
class="feather feather-code">
|
||||||
|
<polyline points="16 18 22 12 16 6"></polyline>
|
||||||
|
<polyline points="8 6 2 12 8 18"></polyline>
|
||||||
|
</svg>
|
||||||
|
<a href="{{ .Params.source_code }}">{{ i18n "portfolio.viewSource"}}</a>
|
||||||
|
</span>
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Params.live_demo }}
|
||||||
|
<span>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||||
|
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
||||||
|
class="feather feather-monitor">
|
||||||
|
<rect x="2" y="3" width="20" height="14" rx="2" ry="2"></rect>
|
||||||
|
<line x1="8" y1="21" x2="16" y2="21"></line>
|
||||||
|
<line x1="12" y1="17" x2="12" y2="21"></line>
|
||||||
|
</svg>
|
||||||
|
<a href="{{ .Params.live_demo }}">{{ i18n "portfolio.liveDemo"}}</a>
|
||||||
|
</span>
|
||||||
|
{{- end }}
|
||||||
|
</div>
|
||||||
|
|
||||||
{{- if .Params.Cover }}
|
{{- if .Params.Cover }}
|
||||||
{{- partial "image.html" (dict "path" .Params.Cover "alt" (.Title | plainify) "class" "portfolio-cover") }}
|
{{- partial "image.html" (dict "path" .Params.Cover "alt" (.Title | plainify) "class" "portfolio-cover") }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
{{- if .Params.toc }}
|
||||||
|
<hr />
|
||||||
|
<aside id="toc">
|
||||||
|
<h2>{{ i18n "tableOfContents" }}</h2>
|
||||||
|
{{ .TableOfContents }}
|
||||||
|
</aside>
|
||||||
|
<hr />
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
<div class="portfolio-content">
|
<div class="portfolio-content">
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
{{- with .Params.skills }}
|
{{- with .Params.skills }}
|
||||||
<h2 class="portfolio-skills-title">Skills used:</h2>
|
<h2 class="portfolio-skills-title">{{ i18n "portfolio.skillsDeveloped"}}:</h2>
|
||||||
<ul class="portfolio-skills">
|
<ul class="portfolio-skills">
|
||||||
{{- range . }}
|
{{- range . }}
|
||||||
<li class="portfolio-skill">{{ . }}</li>
|
<li class="portfolio-skill">{{ . }}</li>
|
||||||
@@ -85,6 +140,20 @@
|
|||||||
{{ i18n "wordCount" .Page.WordCount }}
|
{{ i18n "wordCount" .Page.WordCount }}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
{{- if and (default true .Params.showPageViews) (default true .Site.Params.showPageViews) }}
|
||||||
|
{{- if .Site.Params.goatCounter }}
|
||||||
|
<p>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||||
|
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
||||||
|
class="feather feather-activity">
|
||||||
|
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path>
|
||||||
|
<circle cx="12" cy="12" r="3"></circle>
|
||||||
|
</svg>
|
||||||
|
{{- partial "page_views.html" . -}}
|
||||||
|
</p>
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
{{- if .GitInfo }}
|
{{- if .GitInfo }}
|
||||||
<p>
|
<p>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||||
@@ -144,7 +213,7 @@
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
|
||||||
{{- if .Site.DisqusShortname }}
|
{{- if .Site.Config.Services.Disqus.Shortname }}
|
||||||
{{- if not (eq .Params.Comments "false") }}
|
{{- if not (eq .Params.Comments "false") }}
|
||||||
<div id="comments">
|
<div id="comments">
|
||||||
{{ template "_internal/disqus.html" . }}
|
{{ template "_internal/disqus.html" . }}
|
||||||
|
|||||||
@@ -1,164 +0,0 @@
|
|||||||
{{ define "main" }}
|
|
||||||
<main class="post">
|
|
||||||
|
|
||||||
<div class="post-info">
|
|
||||||
<p>
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
|
|
||||||
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
|
||||||
class="feather feather-clock">
|
|
||||||
<circle cx="12" cy="12" r="10"></circle>
|
|
||||||
<polyline points="12 6 12 12 16 14"></polyline>
|
|
||||||
</svg>
|
|
||||||
{{ i18n "readingTime" .Page.ReadingTime }}
|
|
||||||
|
|
||||||
{{- if .IsTranslated }} | {{ i18n "postAvailable" }}
|
|
||||||
{{- range .Translations }}
|
|
||||||
<a href="{{ .Permalink }}"><span
|
|
||||||
class="flag flag-icon flag-icon-{{ index $.Site.Data.langFlags (.Lang) }} flag-icon-squared"></span></a>
|
|
||||||
{{- end}}
|
|
||||||
{{- end }}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<article>
|
|
||||||
<h1 class="post-title">
|
|
||||||
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
|
|
||||||
</h1>
|
|
||||||
{{- with .Params.Subtitle }}
|
|
||||||
<p class="post-subtitle">{{ . | markdownify }}</p>
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
{{- if .Params.toc }}
|
|
||||||
<hr />
|
|
||||||
<aside id="toc">
|
|
||||||
<div class="toc-title">{{ i18n "tableOfContents" }}</div>
|
|
||||||
{{ .TableOfContents }}
|
|
||||||
</aside>
|
|
||||||
<hr />
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
{{- if .Params.Cover }}
|
|
||||||
{{- partial "image.html" (dict "path" .Params.Cover "alt" (.Title | plainify) "class" "post-cover") }}
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
<div class="post-content">
|
|
||||||
{{ .Content }}
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
|
|
||||||
<hr />
|
|
||||||
|
|
||||||
<div class="post-info">
|
|
||||||
{{- with .Params.tags }}
|
|
||||||
<p>
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
|
|
||||||
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
|
||||||
class="feather feather-tag meta-icon">
|
|
||||||
<path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"></path>
|
|
||||||
<line x1="7" y1="7" x2="7" y2="7"></line>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
{{- range . -}}
|
|
||||||
<span class="tag"><a href="{{ "tags/" | absLangURL }}{{ . | urlize }}/">{{.}}</a></span>
|
|
||||||
{{- end }}
|
|
||||||
</p>
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
|
|
||||||
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
|
||||||
class="feather feather-file-text">
|
|
||||||
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path>
|
|
||||||
<polyline points="14 2 14 8 20 8"></polyline>
|
|
||||||
<line x1="16" y1="13" x2="8" y2="13"></line>
|
|
||||||
<line x1="16" y1="17" x2="8" y2="17"></line>
|
|
||||||
<polyline points="10 9 9 9 8 9"></polyline>
|
|
||||||
</svg>
|
|
||||||
{{ i18n "wordCount" .Page.WordCount }}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
|
|
||||||
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
|
||||||
class="feather feather-calendar">
|
|
||||||
<rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect>
|
|
||||||
<line x1="16" y1="2" x2="16" y2="6"></line>
|
|
||||||
<line x1="8" y1="2" x2="8" y2="6"></line>
|
|
||||||
<line x1="3" y1="10" x2="21" y2="10"></line>
|
|
||||||
</svg>
|
|
||||||
{{- if .Site.Params.dateformNumTime }}
|
|
||||||
{{ dateFormat .Site.Params.dateformNumTime .Date.Local }}
|
|
||||||
{{- else }}
|
|
||||||
{{ dateFormat "2006-01-02 15:04 -0700" .Date.Local }}
|
|
||||||
{{- end }}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
{{- if .GitInfo }}
|
|
||||||
<p>
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
|
|
||||||
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
|
||||||
class="feather feather-git-commit">
|
|
||||||
<circle cx="12" cy="12" r="4"></circle>
|
|
||||||
<line x1="1.05" y1="12" x2="7" y2="12"></line>
|
|
||||||
<line x1="17.01" y1="12" x2="22.96" y2="12"></line>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<a href="{{ .Site.Params.gitUrl -}}{{ .GitInfo.Hash }}" target="_blank"
|
|
||||||
rel="noopener">{{ .GitInfo.AbbreviatedHash }}</a>
|
|
||||||
{{- " @ " -}}
|
|
||||||
{{- if .Site.Params.dateformNum -}}
|
|
||||||
{{ dateFormat .Site.Params.dateformNum .GitInfo.AuthorDate.Local }}
|
|
||||||
{{- else -}}
|
|
||||||
{{ dateFormat "2006-01-02" .GitInfo.AuthorDate.Local }}
|
|
||||||
{{- end }}
|
|
||||||
</p>
|
|
||||||
{{- end }}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{{- if .Site.Params.EnableSharingButtons }}
|
|
||||||
<hr />
|
|
||||||
<div class="sharing-buttons">
|
|
||||||
{{ partial "sharing-buttons.html" . }}
|
|
||||||
</div>
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
{{- if and (not $.Site.Params.DisableReadOtherPosts) (or .NextInSection .PrevInSection) }}
|
|
||||||
<div class="pagination">
|
|
||||||
<div class="pagination__title">
|
|
||||||
<span class="pagination__title-h">{{ .Site.Params.ReadOtherPosts }}</span>
|
|
||||||
<hr />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="pagination__buttons">
|
|
||||||
{{- if .NextInSection }}
|
|
||||||
<span class="button previous">
|
|
||||||
<a href="{{ .NextInSection.Permalink }}">
|
|
||||||
<span class="button__icon">←</span>
|
|
||||||
<span class="button__text">{{ .NextInSection.Title }}</span>
|
|
||||||
</a>
|
|
||||||
</span>
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
{{- if .PrevInSection }}
|
|
||||||
<span class="button next">
|
|
||||||
<a href="{{ .PrevInSection.Permalink }}">
|
|
||||||
<span class="button__text">{{ .PrevInSection.Title }}</span>
|
|
||||||
<span class="button__icon">→</span>
|
|
||||||
</a>
|
|
||||||
</span>
|
|
||||||
{{- end }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
|
|
||||||
{{- if .Site.DisqusShortname }}
|
|
||||||
{{- if not (eq .Params.Comments "false") }}
|
|
||||||
<div id="comments">
|
|
||||||
{{ template "_internal/disqus.html" . }}
|
|
||||||
</div>
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
</main>
|
|
||||||
{{ end }}
|
|
||||||
@@ -7,11 +7,11 @@
|
|||||||
{{- with .Site.LanguageCode }}
|
{{- with .Site.LanguageCode }}
|
||||||
<language>{{.}}</language>
|
<language>{{.}}</language>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with .Site.Author.email }}
|
{{- with .Site.Params.author.email }}
|
||||||
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>
|
<managingEditor>{{.}}{{ with $.Site.Params.author.name }} ({{.}}){{end}}</managingEditor>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with .Site.Author.email }}
|
{{- with .Site.Params.author.email }}
|
||||||
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>
|
<webMaster>{{.}}{{ with $.Site.Params.author.name }} ({{.}}){{end}}</webMaster>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with .Site.Copyright }}
|
{{- with .Site.Copyright }}
|
||||||
<copyright>{{.}}</copyright>
|
<copyright>{{.}}</copyright>
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
{{- $allContent = union $allContent .RegularPagesRecursive }}
|
{{- $allContent = union $allContent .RegularPagesRecursive }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- $allContent = sort $allContent "Date" "desc" }}
|
{{- $allContent = sort $allContent "Date" "desc" }}
|
||||||
{{- $allContent = $allContent | first 15 }}
|
{{- $allContent = $allContent | first .Site.Params.rssLimit }}
|
||||||
{{- range $allContent }}
|
{{- range $allContent }}
|
||||||
<item>
|
<item>
|
||||||
<title>{{ .Title }}{{ with .Params.Subtitle }} // {{ . }}{{ end }}</title>
|
<title>{{ .Title }}{{ with .Params.Subtitle }} // {{ . }}{{ end }}</title>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
|
{{ $paginator := (.Paginate .RegularPagesRecursive) }}
|
||||||
|
|
||||||
<main class="posts">
|
<main class="posts">
|
||||||
<h1>{{ .Title }}</h1>
|
<h1>{{ .Title }}</h1>
|
||||||
@@ -12,7 +13,7 @@
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
<div class="posts-list masonry">
|
<div class="posts-list masonry">
|
||||||
{{ range .Paginator.Pages }}
|
{{ range $paginator.Pages }}
|
||||||
<div class="post masonry-item">
|
<div class="post masonry-item">
|
||||||
<div class="masonry-item-content">
|
<div class="masonry-item-content">
|
||||||
<h2 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h2>
|
<h2 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h2>
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
|
||||||
|
<channel>
|
||||||
|
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
|
||||||
|
<icon>{{"favicon-32x32.png" | absURL}}</icon>
|
||||||
|
<link>{{ .Permalink }}</link>
|
||||||
|
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
|
||||||
|
{{- with .Site.LanguageCode }}
|
||||||
|
<language>{{.}}</language>
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Site.Params.author.email }}
|
||||||
|
<managingEditor>{{.}}{{ with $.Site.Params.author.name }} ({{.}}){{end}}</managingEditor>
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Site.Params.author.email }}
|
||||||
|
<webMaster>{{.}}{{ with $.Site.Params.author.name }} ({{.}}){{end}}</webMaster>
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Site.Copyright }}
|
||||||
|
<copyright>{{.}}</copyright>
|
||||||
|
{{- end }}
|
||||||
|
{{- if not .Date.IsZero }}
|
||||||
|
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>
|
||||||
|
{{- end }}
|
||||||
|
{{- with .OutputFormats.Get "RSS" }}
|
||||||
|
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
|
||||||
|
{{- end }}
|
||||||
|
{{ range .RegularPagesRecursive | first .Site.Params.rssLimit }}
|
||||||
|
<item>
|
||||||
|
<title>{{ .Title }}{{ with .Params.Subtitle }} // {{ . }}{{ end }}</title>
|
||||||
|
<link>{{ .Permalink }}</link>
|
||||||
|
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
||||||
|
<published>{{ .Date.Format "2006-01-02T15:04:05Z0700" | safeHTML }}</published>
|
||||||
|
{{- if .GitInfo }}
|
||||||
|
<updated>{{ dateFormat "2006-01-02T15:04:05Z0700" .GitInfo.AuthorDate.Local | safeHTML }}</updated>
|
||||||
|
{{- end }}
|
||||||
|
<author>{{ .Params.author }}</author>
|
||||||
|
<guid isPermaLink="true">{{ .Permalink }}</guid>
|
||||||
|
<description>{{ printf `<![CDATA[%s]]>` .Params.description | safeHTML }}</description>
|
||||||
|
{{ $content := .Content}}
|
||||||
|
{{- if .Params.Cover }}
|
||||||
|
{{- $content = (printf `%s%s` (partial "image.html" (dict "path" .Params.Cover "alt" (.Title | plainify) "class" "post-cover")) $content) }}
|
||||||
|
{{- end }}
|
||||||
|
<content:encoded type="html">{{ printf `<![CDATA[%s]]>` $content | safeHTML }}</content:encoded>
|
||||||
|
</item>
|
||||||
|
{{ end }}
|
||||||
|
</channel>
|
||||||
|
</rss>
|
||||||
@@ -1,164 +0,0 @@
|
|||||||
{{ define "main" }}
|
|
||||||
<main class="post">
|
|
||||||
|
|
||||||
<div class="post-info">
|
|
||||||
<p>
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
|
|
||||||
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
|
||||||
class="feather feather-clock">
|
|
||||||
<circle cx="12" cy="12" r="10"></circle>
|
|
||||||
<polyline points="12 6 12 12 16 14"></polyline>
|
|
||||||
</svg>
|
|
||||||
{{ i18n "readingTime" .Page.ReadingTime }}
|
|
||||||
|
|
||||||
{{- if .IsTranslated }} | {{ i18n "postAvailable" }}
|
|
||||||
{{- range .Translations }}
|
|
||||||
<a href="{{ .Permalink }}"><span
|
|
||||||
class="flag flag-icon flag-icon-{{ index $.Site.Data.langFlags (.Lang) }} flag-icon-squared"></span></a>
|
|
||||||
{{- end}}
|
|
||||||
{{- end }}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<article>
|
|
||||||
<h1 class="post-title">
|
|
||||||
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
|
|
||||||
</h1>
|
|
||||||
{{- with .Params.Subtitle }}
|
|
||||||
<p class="post-subtitle">{{ . | markdownify }}</p>
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
{{- if .Params.toc }}
|
|
||||||
<hr />
|
|
||||||
<aside id="toc">
|
|
||||||
<div class="toc-title">{{ i18n "tableOfContents" }}</div>
|
|
||||||
{{ .TableOfContents }}
|
|
||||||
</aside>
|
|
||||||
<hr />
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
{{- if .Params.Cover }}
|
|
||||||
{{- partial "image.html" (dict "path" .Params.Cover "alt" (.Title | plainify) "class" "post-cover") }}
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
<div class="post-content">
|
|
||||||
{{ .Content }}
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
|
|
||||||
<hr />
|
|
||||||
|
|
||||||
<div class="post-info">
|
|
||||||
{{- with .Params.tags }}
|
|
||||||
<p>
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
|
|
||||||
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
|
||||||
class="feather feather-tag meta-icon">
|
|
||||||
<path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"></path>
|
|
||||||
<line x1="7" y1="7" x2="7" y2="7"></line>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
{{- range . -}}
|
|
||||||
<span class="tag"><a href="{{ "tags/" | absLangURL }}{{ . | urlize }}/">{{.}}</a></span>
|
|
||||||
{{- end }}
|
|
||||||
</p>
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
|
|
||||||
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
|
||||||
class="feather feather-file-text">
|
|
||||||
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path>
|
|
||||||
<polyline points="14 2 14 8 20 8"></polyline>
|
|
||||||
<line x1="16" y1="13" x2="8" y2="13"></line>
|
|
||||||
<line x1="16" y1="17" x2="8" y2="17"></line>
|
|
||||||
<polyline points="10 9 9 9 8 9"></polyline>
|
|
||||||
</svg>
|
|
||||||
{{ i18n "wordCount" .Page.WordCount }}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
|
|
||||||
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
|
||||||
class="feather feather-calendar">
|
|
||||||
<rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect>
|
|
||||||
<line x1="16" y1="2" x2="16" y2="6"></line>
|
|
||||||
<line x1="8" y1="2" x2="8" y2="6"></line>
|
|
||||||
<line x1="3" y1="10" x2="21" y2="10"></line>
|
|
||||||
</svg>
|
|
||||||
{{- if .Site.Params.dateformNumTime }}
|
|
||||||
{{ dateFormat .Site.Params.dateformNumTime .Date.Local }}
|
|
||||||
{{- else }}
|
|
||||||
{{ dateFormat "2006-01-02 15:04 -0700" .Date.Local }}
|
|
||||||
{{- end }}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
{{- if .GitInfo }}
|
|
||||||
<p>
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
|
|
||||||
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
|
||||||
class="feather feather-git-commit">
|
|
||||||
<circle cx="12" cy="12" r="4"></circle>
|
|
||||||
<line x1="1.05" y1="12" x2="7" y2="12"></line>
|
|
||||||
<line x1="17.01" y1="12" x2="22.96" y2="12"></line>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<a href="{{ .Site.Params.gitUrl -}}{{ .GitInfo.Hash }}" target="_blank"
|
|
||||||
rel="noopener">{{ .GitInfo.AbbreviatedHash }}</a>
|
|
||||||
{{- " @ " -}}
|
|
||||||
{{- if .Site.Params.dateformNum -}}
|
|
||||||
{{ dateFormat .Site.Params.dateformNum .GitInfo.AuthorDate.Local }}
|
|
||||||
{{- else -}}
|
|
||||||
{{ dateFormat "2006-01-02" .GitInfo.AuthorDate.Local }}
|
|
||||||
{{- end }}
|
|
||||||
</p>
|
|
||||||
{{- end }}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{{- if .Site.Params.EnableSharingButtons }}
|
|
||||||
<hr />
|
|
||||||
<div class="sharing-buttons">
|
|
||||||
{{ partial "sharing-buttons.html" . }}
|
|
||||||
</div>
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
{{- if and (not $.Site.Params.DisableReadOtherPosts) (or .NextInSection .PrevInSection) }}
|
|
||||||
<div class="pagination">
|
|
||||||
<div class="pagination__title">
|
|
||||||
<span class="pagination__title-h">{{ .Site.Params.ReadOtherPosts }}</span>
|
|
||||||
<hr />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="pagination__buttons">
|
|
||||||
{{- if .NextInSection }}
|
|
||||||
<span class="button previous">
|
|
||||||
<a href="{{ .NextInSection.Permalink }}">
|
|
||||||
<span class="button__icon">←</span>
|
|
||||||
<span class="button__text">{{ .NextInSection.Title }}</span>
|
|
||||||
</a>
|
|
||||||
</span>
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
{{- if .PrevInSection }}
|
|
||||||
<span class="button next">
|
|
||||||
<a href="{{ .PrevInSection.Permalink }}">
|
|
||||||
<span class="button__text">{{ .PrevInSection.Title }}</span>
|
|
||||||
<span class="button__icon">→</span>
|
|
||||||
</a>
|
|
||||||
</span>
|
|
||||||
{{- end }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
|
|
||||||
{{- if .Site.DisqusShortname }}
|
|
||||||
{{- if not (eq .Params.Comments "false") }}
|
|
||||||
<div id="comments">
|
|
||||||
{{ template "_internal/disqus.html" . }}
|
|
||||||
</div>
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
</main>
|
|
||||||
{{ end }}
|
|
||||||