diff --git a/spec/web/site/Gemfile b/spec/web/site/Gemfile new file mode 100644 index 00000000..d464b577 --- /dev/null +++ b/spec/web/site/Gemfile @@ -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] diff --git a/spec/web/site/Gemfile.lock b/spec/web/site/Gemfile.lock new file mode 100644 index 00000000..e7e99549 --- /dev/null +++ b/spec/web/site/Gemfile.lock @@ -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 diff --git a/spec/web/site/_config.yml b/spec/web/site/_config.yml new file mode 100644 index 00000000..555fc780 --- /dev/null +++ b/spec/web/site/_config.yml @@ -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: # / + issue_term: # < url | pathname | title | ...> + # Giscus options › https://giscus.app + giscus: + 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/ diff --git a/spec/web/site/_data/contact.yml b/spec/web/site/_data/contact.yml new file mode 100644 index 00000000..b3a8c96c --- /dev/null +++ b/spec/web/site/_data/contact.yml @@ -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 + + diff --git a/spec/web/site/_data/locales/en.yml b/spec/web/site/_data/locales/en.yml new file mode 100644 index 00000000..8322299e --- /dev/null +++ b/spec/web/site/_data/locales/en.yml @@ -0,0 +1 @@ +meta: 'Source code' diff --git a/spec/web/site/_data/share.yml b/spec/web/site/_data/share.yml new file mode 100644 index 00000000..14375ee8 --- /dev/null +++ b/spec/web/site/_data/share.yml @@ -0,0 +1,23 @@ +# Sharing options at the bottom of the post. +# Icons from + +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" diff --git a/spec/web/site/_plugins/posts-lastmod-hook.rb b/spec/web/site/_plugins/posts-lastmod-hook.rb new file mode 100644 index 00000000..1fd6ecf9 --- /dev/null +++ b/spec/web/site/_plugins/posts-lastmod-hook.rb @@ -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 diff --git a/spec/web/site/_tabs/about.md b/spec/web/site/_tabs/about.md new file mode 100644 index 00000000..73e1cd5c --- /dev/null +++ b/spec/web/site/_tabs/about.md @@ -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 } diff --git a/spec/web/site/_tabs/archives.md b/spec/web/site/_tabs/archives.md new file mode 100644 index 00000000..c3abc594 --- /dev/null +++ b/spec/web/site/_tabs/archives.md @@ -0,0 +1,5 @@ +--- +layout: archives +icon: fas fa-archive +order: 3 +--- diff --git a/spec/web/site/_tabs/categories.md b/spec/web/site/_tabs/categories.md new file mode 100644 index 00000000..2d241be9 --- /dev/null +++ b/spec/web/site/_tabs/categories.md @@ -0,0 +1,5 @@ +--- +layout: categories +icon: fas fa-stream +order: 1 +--- diff --git a/spec/web/site/_tabs/tags.md b/spec/web/site/_tabs/tags.md new file mode 100644 index 00000000..ded3adc1 --- /dev/null +++ b/spec/web/site/_tabs/tags.md @@ -0,0 +1,5 @@ +--- +layout: tags +icon: fas fa-tags +order: 2 +--- diff --git a/spec/web/site/assets/img/favicons/android-chrome-192x192.png b/spec/web/site/assets/img/favicons/android-chrome-192x192.png new file mode 100644 index 00000000..23e9954e Binary files /dev/null and b/spec/web/site/assets/img/favicons/android-chrome-192x192.png differ diff --git a/spec/web/site/assets/img/favicons/android-chrome-512x512.png b/spec/web/site/assets/img/favicons/android-chrome-512x512.png new file mode 100644 index 00000000..776e38e3 Binary files /dev/null and b/spec/web/site/assets/img/favicons/android-chrome-512x512.png differ diff --git a/spec/web/site/assets/img/favicons/apple-touch-icon.png b/spec/web/site/assets/img/favicons/apple-touch-icon.png new file mode 100644 index 00000000..13d2b96d Binary files /dev/null and b/spec/web/site/assets/img/favicons/apple-touch-icon.png differ diff --git a/spec/web/site/assets/img/favicons/favicon-16x16.png b/spec/web/site/assets/img/favicons/favicon-16x16.png new file mode 100644 index 00000000..13944716 Binary files /dev/null and b/spec/web/site/assets/img/favicons/favicon-16x16.png differ diff --git a/spec/web/site/assets/img/favicons/favicon-32x32.png b/spec/web/site/assets/img/favicons/favicon-32x32.png new file mode 100644 index 00000000..56251a47 Binary files /dev/null and b/spec/web/site/assets/img/favicons/favicon-32x32.png differ diff --git a/spec/web/site/assets/img/favicons/favicon.ico b/spec/web/site/assets/img/favicons/favicon.ico new file mode 100644 index 00000000..00bdd1dd Binary files /dev/null and b/spec/web/site/assets/img/favicons/favicon.ico differ diff --git a/spec/web/site/assets/img/favicons/mstile-150x150.png b/spec/web/site/assets/img/favicons/mstile-150x150.png new file mode 100644 index 00000000..4a21e29c Binary files /dev/null and b/spec/web/site/assets/img/favicons/mstile-150x150.png differ diff --git a/spec/web/site/assets/img/favicons/safari-pinned-tab.svg b/spec/web/site/assets/img/favicons/safari-pinned-tab.svg new file mode 100644 index 00000000..0390ba7b --- /dev/null +++ b/spec/web/site/assets/img/favicons/safari-pinned-tab.svg @@ -0,0 +1,69 @@ + + + + +Created by potrace 1.14, written by Peter Selinger 2001-2017 + + + + + diff --git a/spec/web/site/assets/img/koishi-margin-noalpha.png b/spec/web/site/assets/img/koishi-margin-noalpha.png new file mode 100644 index 00000000..aa7846ec Binary files /dev/null and b/spec/web/site/assets/img/koishi-margin-noalpha.png differ diff --git a/spec/web/site/assets/img/koishi0.png b/spec/web/site/assets/img/koishi0.png new file mode 100644 index 00000000..3a61f2e6 Binary files /dev/null and b/spec/web/site/assets/img/koishi0.png differ diff --git a/spec/web/site/assets/lib/.placeholder b/spec/web/site/assets/lib/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/spec/web/site/default.nix b/spec/web/site/default.nix new file mode 100644 index 00000000..fce8bcfb --- /dev/null +++ b/spec/web/site/default.nix @@ -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" + ''; +} diff --git a/spec/web/site/index.html b/spec/web/site/index.html new file mode 100644 index 00000000..e4d427d2 --- /dev/null +++ b/spec/web/site/index.html @@ -0,0 +1,3 @@ +--- +layout: home +---