feat(web): add jekyll website

This commit is contained in:
514fpv 2024-01-15 15:39:28 +08:00
parent 6ea35ac738
commit 1b4ed807b7
Signed by: koishi
SSH key fingerprint: SHA256:axz0uIzzY+5W19i7QOUuiw5LSqhKfCBKPf3L4xFRxLw
24 changed files with 517 additions and 0 deletions

23
spec/web/site/Gemfile Normal file
View file

@ -0,0 +1,23 @@
# frozen_string_literal: true
source "https://rubygems.org"
gem "jekyll-theme-chirpy", "~> 6.4", ">= 6.4.2"
group :test do
gem "html-proofer", "~> 4.4"
end
# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library.
platforms :mingw, :x64_mingw, :mswin, :jruby do
gem "tzinfo", ">= 1", "< 3"
gem "tzinfo-data"
end
# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]
# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem
# do not have a Java counterpart.
gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]

114
spec/web/site/Gemfile.lock Normal file
View file

@ -0,0 +1,114 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
colorator (1.1.0)
concurrent-ruby (1.2.2)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
ethon (0.16.0)
ffi (>= 1.15.0)
eventmachine (1.2.7)
ffi (1.16.3)
forwardable-extended (2.6.0)
google-protobuf (3.25.2-x86_64-linux)
html-proofer (4.4.3)
addressable (~> 2.3)
mercenary (~> 0.3)
nokogiri (~> 1.13)
parallel (~> 1.10)
rainbow (~> 3.0)
typhoeus (~> 1.3)
yell (~> 2.0)
zeitwerk (~> 2.5)
http_parser.rb (0.6.0)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
jekyll (4.3.3)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 1.0)
jekyll-sass-converter (>= 2.0, < 4.0)
jekyll-watch (~> 2.0)
kramdown (~> 2.3, >= 2.3.1)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (>= 0.3.6, < 0.5)
pathutil (~> 0.9)
rouge (>= 3.0, < 5.0)
safe_yaml (~> 1.0)
terminal-table (>= 1.8, < 4.0)
webrick (~> 1.7)
jekyll-archives (2.2.1)
jekyll (>= 3.6, < 5.0)
jekyll-include-cache (0.2.1)
jekyll (>= 3.7, < 5.0)
jekyll-paginate (1.1.0)
jekyll-redirect-from (0.16.0)
jekyll (>= 3.3, < 5.0)
jekyll-sass-converter (3.0.0)
sass-embedded (~> 1.54)
jekyll-seo-tag (2.8.0)
jekyll (>= 3.8, < 5.0)
jekyll-sitemap (1.4.0)
jekyll (>= 3.7, < 5.0)
jekyll-theme-chirpy (6.4.2)
jekyll (~> 4.3)
jekyll-archives (~> 2.2)
jekyll-include-cache (~> 0.2)
jekyll-paginate (~> 1.1)
jekyll-redirect-from (~> 0.16)
jekyll-seo-tag (~> 2.8)
jekyll-sitemap (~> 1.4)
jekyll-watch (2.2.1)
listen (~> 3.0)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.4)
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
nokogiri (1.16.0-x86_64-linux)
racc (~> 1.4)
parallel (1.24.0)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (5.0.4)
racc (1.7.3)
rainbow (3.1.1)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.6)
rouge (4.2.0)
safe_yaml (1.0.5)
sass-embedded (1.69.7-x86_64-linux-gnu)
google-protobuf (~> 3.25)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
typhoeus (1.4.1)
ethon (>= 0.9.0)
unicode-display_width (2.5.0)
webrick (1.8.1)
yell (2.2.2)
zeitwerk (2.6.12)
PLATFORMS
x86_64-linux
DEPENDENCIES
html-proofer (~> 4.4)
http_parser.rb (~> 0.6.0)
jekyll-theme-chirpy (~> 6.4, >= 6.4.2)
tzinfo (>= 1, < 3)
tzinfo-data
wdm (~> 0.1.1)
BUNDLED WITH
2.4.22

136
spec/web/site/_config.yml Normal file
View file

@ -0,0 +1,136 @@
theme: "jekyll-theme-chirpy"
lang: "en"
timezone: "Asia/Hong_Kong"
title: "514fpv"
tagline: "Unconscious requiem in the sky"
description: >-
Unconscious requiem in the sky
url: "https://514fpv.one"
avatar: "/assets/img/koishi-margin-noalpha.png"
social_preview_image: "/assets/img/koishi0.png"
toc: true
theme_mode:
github:
username: "514fpv"
twitter:
username: "514fpv"
social:
name: "514fpv"
email: "koishi@514fpv.one"
links:
- "https://src.514fpv.io:2096/koishi"
- "https://youtube.com/@514fpv"
assets:
self_host:
enabled: true
env: production
pwa:
enabled: true
paginate: 8
baseurl: ""
comments:
active: # The global switch for posts comments, e.g., 'disqus'. Keep it empty means disable
# The active options are as follows:
disqus:
shortname: # fill with the Disqus shortname. https://help.disqus.com/en/articles/1717111-what-s-a-shortname
# utterances settings https://utteranc.es/
utterances:
repo: # <gh-username>/<repo>
issue_term: # < url | pathname | title | ...>
# Giscus options https://giscus.app
giscus:
repo: # <gh-username>/<repo>
repo_id:
category:
category_id:
mapping: # optional, default to 'pathname'
input_position: # optional, default to 'bottom'
lang: # optional, default to the value of `site.lang`
reactions_enabled: # optional, default to the value of `1`
# ------------ The following options are not recommended to be modified ------------------
kramdown:
syntax_highlighter: rouge
syntax_highlighter_opts: # Rouge Options https://github.com/jneen/rouge#full-options
css_class: highlight
# default_lang: console
span:
line_numbers: false
block:
line_numbers: true
start_line: 1
collections:
tabs:
output: true
sort_by: order
defaults:
- scope:
path: "" # An empty string here means all files in the project
type: posts
values:
layout: post
comments: true # Enable comments in posts.
toc: true # Display TOC column in posts.
permalink: /posts/:title/
- scope:
path: _drafts
values:
comments: false
- scope:
path: ""
type: tabs # see `site.collections`
values:
layout: page
permalink: /:title/
- scope:
path: assets/img/favicons
values:
swcache: true
- scope:
path: assets/js/dist
values:
swcache: true
sass:
style: compressed
compress_html:
clippings: all
comments: all
endings: all
profile: false
blanklines: false
ignore:
envs: [development]
exclude:
- "*.gem"
- "*.gemspec"
- docs
- tools
- README.md
- LICENSE
- rollup.config.js
- package*.json
- result # nix result symlink
jekyll-archives:
enabled: [categories, tags]
layouts:
category: category
tag: tag
permalinks:
tag: /tags/:name/
category: /categories/:name/

View file

@ -0,0 +1,25 @@
# The contact options.
- type: git
icon: "fab fa-git-alt"
url: "https://src.514fpv.io:2096/koishi"
- type: mastodon
icon: "fab fa-mastodon"
url: ""
#- type: github
# icon: "fab fa-github"
#
#- type: twitter
# icon: "fa-brands fa-x-twitter"
- type: email
icon: "fas fa-envelope"
noblank: true
- type: rss
icon: "fas fa-rss"
noblank: true

View file

@ -0,0 +1 @@
meta: '<a href="https://src.514fpv.io:2096/koishi/nixos/src/branch/master/spec/web/site" target="_blank">Source code</a>'

View file

@ -0,0 +1,23 @@
# Sharing options at the bottom of the post.
# Icons from <https://fontawesome.com/>
platforms:
- type: Twitter
icon: "fa-brands fa-square-x-twitter"
link: "https://twitter.com/intent/tweet?text=TITLE&url=URL"
- type: Facebook
icon: "fab fa-facebook-square"
link: "https://www.facebook.com/sharer/sharer.php?title=TITLE&u=URL"
- type: Telegram
icon: "fab fa-telegram"
link: "https://t.me/share/url?url=URL&text=TITLE"
- type: Linkedin
icon: "fab fa-linkedin"
link: "https://www.linkedin.com/sharing/share-offsite/?url=URL"
- type: Weibo
icon: "fab fa-weibo"
link: "http://service.weibo.com/share/share.php?title=TITLE&url=URL"

View file

@ -0,0 +1,14 @@
#!/usr/bin/env ruby
#
# Check for changed posts
Jekyll::Hooks.register :posts, :post_init do |post|
commit_num = `git rev-list --count HEAD "#{ post.path }"`
if commit_num.to_i > 1
lastmod_date = `git log -1 --pretty="%ad" --date=iso "#{ post.path }"`
post.data['last_modified_at'] = lastmod_date
end
end

View file

@ -0,0 +1,14 @@
---
icon: fas fa-info-circle
order: 4
---
I fly multirotor aircraft, with a focus on cinematic and long range FPV cruising.
I also write software, and I self host [almost everything](https://src.514fpv.io:2096/koishi/nixos/src/branch/master/spec/library) I use online, including the [website](https://src.514fpv.io:2096/koishi/nixos/src/branch/master/spec/web/site) you're currently visiting.
If you find what I do interesting, feel free to drop by and say hi, I would really appreciate that.
> I can read and write Simplified Chinese. If you prefer conversing with me in Chinese, feel free to do so without the overhead of a translation software.
>
> 我会读写简体中文。如果您喜欢用中文与我交谈,请随意,无需翻译软件。
{: .prompt-tip }

View file

@ -0,0 +1,5 @@
---
layout: archives
icon: fas fa-archive
order: 3
---

View file

@ -0,0 +1,5 @@
---
layout: categories
icon: fas fa-stream
order: 1
---

View file

@ -0,0 +1,5 @@
---
layout: tags
icon: fas fa-tags
order: 2
---

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

View file

@ -0,0 +1,69 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="1024.000000pt" height="1024.000000pt" viewBox="0 0 1024.000000 1024.000000"
preserveAspectRatio="xMidYMid meet">
<metadata>
Created by potrace 1.14, written by Peter Selinger 2001-2017
</metadata>
<g transform="translate(0.000000,1024.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<path d="M5338 7205 c-3 -3 -52 -6 -109 -7 -57 0 -109 -4 -115 -9 -6 -5 -25
-10 -43 -11 -18 -1 -35 -6 -37 -10 -3 -4 -11 -5 -19 -1 -8 3 -15 0 -15 -5 0
-6 -8 -10 -19 -9 -10 0 -43 -6 -72 -16 -30 -9 -133 -39 -229 -67 -214 -63
-237 -72 -648 -262 -23 -11 -39 -24 -36 -30 4 -6 -1 -8 -14 -4 -15 5 -27 0
-43 -18 -12 -14 -26 -23 -31 -20 -5 3 -12 -4 -15 -15 -4 -16 -9 -19 -18 -11
-17 14 -49 -16 -40 -38 4 -12 3 -13 -9 -2 -13 10 -19 9 -31 -4 -9 -9 -21 -16
-26 -16 -6 0 -8 -4 -5 -8 3 -4 -11 -16 -30 -27 -19 -10 -34 -21 -34 -24 0 -4
-16 -15 -35 -25 -19 -11 -35 -23 -35 -28 0 -5 5 -6 10 -3 6 3 10 2 10 -2 0 -5
-9 -14 -21 -21 -12 -8 -18 -9 -14 -3 9 15 -8 14 -23 -1 -9 -9 -18 -7 -41 10
-22 16 -37 20 -65 15 -20 -3 -36 -10 -36 -16 0 -8 -4 -7 -11 0 -8 8 -20 7 -43
-6 -107 -61 -189 -138 -263 -246 -22 -33 -53 -71 -67 -84 -14 -14 -26 -30 -26
-38 0 -7 -4 -13 -9 -13 -5 0 -15 -16 -21 -35 -6 -19 -17 -34 -23 -32 -6 1 -11
-9 -12 -23 -1 -15 -6 -24 -14 -22 -7 1 -10 -2 -7 -7 11 -16 -34 -79 -72 -103
-20 -12 -40 -26 -44 -32 -3 -5 -13 -2 -23 7 -9 10 -24 17 -33 18 -11 0 -12 2
-4 6 16 6 16 43 -1 43 -8 0 -22 9 -32 20 -10 11 -25 19 -34 18 -9 -2 -15 2
-14 9 2 7 -3 10 -11 7 -8 -3 -18 6 -25 23 -6 16 -27 37 -46 47 -19 11 -54 38
-78 62 -27 26 -58 46 -83 52 -71 17 -194 33 -204 27 -5 -3 -10 -1 -10 5 0 8
-7 9 -17 5 -10 -4 -25 -8 -33 -9 -8 -1 -24 -6 -35 -12 -11 -6 -35 -11 -54 -13
-39 -2 -54 -9 -46 -21 3 -5 0 -12 -6 -16 -8 -4 -9 -3 -5 4 4 7 2 12 -3 12 -6
0 -11 -4 -11 -10 0 -5 -7 -10 -15 -10 -17 0 -60 -45 -61 -63 0 -7 -8 -28 -18
-47 -11 -19 -25 -62 -33 -95 -23 -96 -17 -393 13 -640 3 -27 15 -86 26 -130
11 -44 24 -100 30 -125 11 -54 28 -91 38 -85 17 10 18 -27 2 -45 -32 -35 -39
-45 -35 -55 1 -6 -2 -17 -7 -25 -8 -12 -12 -13 -19 -2 -7 11 -9 10 -14 -3 -4
-9 -1 -18 8 -21 20 -8 9 -24 -16 -24 -10 0 -19 -5 -19 -11 0 -5 4 -8 9 -5 5 4
7 -3 4 -14 -3 -11 -10 -20 -17 -20 -6 -1 -23 -20 -39 -45 -26 -41 -27 -48 -22
-122 7 -95 23 -153 40 -146 8 2 12 -3 12 -13 -3 -22 17 -26 160 -25 118 0 122
-1 110 -20 -6 -10 -18 -19 -25 -19 -7 0 -11 -4 -8 -8 3 -4 -18 -37 -46 -73
-171 -220 -295 -459 -333 -643 -31 -152 -13 -337 43 -458 12 -26 22 -50 22
-54 0 -17 88 -115 118 -129 17 -9 32 -20 32 -25 0 -12 56 -41 64 -33 3 4 6 2
6 -4 0 -5 6 -10 13 -10 24 0 87 -32 87 -44 0 -7 9 -9 22 -6 13 4 29 0 38 -8 8
-8 34 -15 58 -16 23 -2 42 -6 42 -10 0 -4 12 -9 27 -12 16 -3 46 -10 68 -16
22 -7 54 -13 70 -15 96 -12 134 -20 170 -31 22 -8 95 -16 162 -20 118 -6 145
-9 181 -19 9 -2 44 -7 77 -11 33 -3 92 -11 130 -16 129 -19 640 -7 725 16 8 2
40 7 70 10 84 9 100 12 173 29 37 9 79 18 95 21 15 3 38 7 52 10 14 3 35 8 48
11 12 2 102 25 200 50 189 49 184 48 252 59 24 4 58 18 75 30 18 14 69 31 130
44 55 12 154 38 220 57 66 20 174 52 240 71 141 41 410 150 579 236 192 97
570 343 853 555 145 108 263 202 263 209 0 6 16 26 36 45 20 18 59 56 88 83
48 47 109 93 162 123 12 7 57 54 99 105 42 50 118 135 169 187 50 52 123 133
161 180 38 47 72 87 75 90 3 3 43 54 89 113 72 93 209 240 307 328 16 15 51
71 78 125 27 55 62 118 78 142 16 23 26 42 22 42 -4 0 0 6 9 13 9 6 17 26 19
42 2 17 10 37 19 45 9 8 26 35 38 59 19 35 20 43 7 38 -20 -8 -21 1 -2 22 23
26 31 88 29 211 -3 146 -18 234 -55 335 -16 44 -31 85 -32 92 -1 7 -10 20 -19
31 -9 10 -17 26 -17 35 0 12 -9 17 -27 17 -26 1 -27 2 -10 14 15 12 16 14 2
20 -8 3 -15 12 -15 21 0 8 -7 15 -15 15 -9 0 -18 7 -21 15 -4 8 -29 26 -57 40
-28 14 -55 32 -61 40 -6 8 -35 23 -65 35 -30 11 -63 27 -75 35 -11 8 -34 15
-51 15 -16 0 -39 7 -49 15 -10 8 -23 12 -27 9 -5 -3 -17 -1 -27 5 -10 6 -24 6
-34 0 -11 -6 -18 -4 -21 6 -4 9 -16 13 -37 10 -18 -2 -44 1 -58 6 -35 14 -101
18 -108 8 -2 -4 -10 -6 -17 -4 -23 9 -93 15 -257 25 -91 5 -190 14 -220 20
-62 12 -175 6 -300 -15 -47 -8 -98 -17 -115 -19 -16 -3 -52 -10 -80 -16 -27
-6 -60 -12 -72 -14 -12 -2 -26 -7 -32 -10 -5 -3 -31 -8 -57 -11 -26 -2 -60
-13 -75 -24 l-27 -20 -48 26 c-27 14 -67 38 -89 52 -22 14 -43 24 -47 23 -3
-1 -12 5 -18 13 -7 8 -21 15 -31 15 -11 0 -19 7 -19 15 0 13 -18 20 -42 16 -5
0 -8 3 -8 8 0 8 -37 24 -52 22 -5 -1 -8 3 -8 9 0 5 -26 17 -57 26 -32 9 -71
25 -86 36 -15 11 -37 18 -47 15 -11 -3 -20 -1 -20 5 0 6 -7 8 -15 4 -8 -3 -21
1 -29 9 -7 8 -24 12 -35 10 -12 -2 -38 5 -58 16 -20 11 -57 23 -82 26 -25 2
-73 9 -106 14 -33 5 -98 11 -145 13 -47 3 -94 7 -105 11 -11 3 -23 3 -27 0z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 KiB

View file

80
spec/web/site/default.nix Normal file
View file

@ -0,0 +1,80 @@
{ lib
, stdenvNoCC
, ruby
, bundler
, libffi
, gcc
, writeShellScriptBin
, fetchFromGitHub }: let
name = "website";
version = "20240114";
assets = fetchFromGitHub {
name = "${name}-assets";
owner = "cotes2020";
repo = "chirpy-static-assets";
rev = "c577249";
hash = "sha256-Uxe7PMNwzKUN2b77QbjWLxEtOOLodPOyeMuUM1eKdlc=";
};
vendor = stdenvNoCC.mkDerivation {
pname = "${name}-vendor";
inherit version;
src = ./.;
nativeBuildInputs = [ bundler ];
buildPhase = ''
export HOME="$(mktemp -d)"
bundle config set --local path "$out"
bundler package --no-install
'';
installPhase = ''
cp Gemfile* $out
'';
outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash = "sha256-ql0Rf1annFrlhaPF/s96xPTNsSjQbM44SCBmE53DaEY=";
};
deps = stdenvNoCC.mkDerivation {
pname = "${name}-deps";
inherit version;
src = vendor;
buildInputs = [ ruby libffi gcc ];
nativeBuildInputs = [ bundler ];
buildPhase = ''
export HOME="$(mktemp -d)"
bundle config set --local path "$out"
mkdir -p "vendor"
mv ruby/*/cache "vendor/"
bundle install --local
'';
};
in stdenvNoCC.mkDerivation {
pname = name;
inherit version;
src = ./.;
buildInputs = [ ruby libffi gcc ];
nativeBuildInputs = [ (writeShellScriptBin "git" "true") bundler ];
configurePhase = ''
export HOME="$(mktemp -d)"
bundle config set --local path "${deps}"
cp -r ${assets}/. assets/lib/
'';
buildPhase = "JEKYLL_ENV=production bundle exec jekyll build";
installPhase = ''
cp -r _site "$out"
'';
}

3
spec/web/site/index.html Normal file
View file

@ -0,0 +1,3 @@
---
layout: home
---