├── .devcontainer ├── devcontainer.json └── post-create.sh ├── .editorconfig ├── .gitattributes ├── .github └── workflows │ └── pages-deploy.yml ├── .gitignore ├── .gitmodules ├── .nojekyll ├── .vscode ├── extensions.json ├── settings.json └── tasks.json ├── Gemfile ├── LICENSE ├── README.md ├── _config.yml ├── _data ├── contact.yml └── share.yml ├── _plugins └── posts-lastmod-hook.rb ├── _posts └── .placeholder ├── _tabs ├── about.md ├── archives.md ├── categories.md └── tags.md ├── index.html └── tools ├── run.sh └── test.sh /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Jekyll", 3 | "image": "mcr.microsoft.com/devcontainers/jekyll:2-bullseye", 4 | "onCreateCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}", 5 | "postCreateCommand": "bash .devcontainer/post-create.sh", 6 | "customizations": { 7 | "vscode": { 8 | "settings": { 9 | "terminal.integrated.defaultProfile.linux": "zsh" 10 | }, 11 | "extensions": [ 12 | // Liquid tags auto-complete 13 | "killalau.vscode-liquid-snippets", 14 | // Liquid syntax highlighting and formatting 15 | "Shopify.theme-check-vscode", 16 | // Shell 17 | "timonwong.shellcheck", 18 | "mkhl.shfmt", 19 | // Common formatter 20 | "EditorConfig.EditorConfig", 21 | "esbenp.prettier-vscode", 22 | "stylelint.vscode-stylelint", 23 | "yzhang.markdown-all-in-one", 24 | // Git 25 | "mhutchie.git-graph" 26 | ] 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /.devcontainer/post-create.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ -f package.json ]; then 4 | bash -i -c "nvm install --lts && nvm install-latest-npm" 5 | npm i 6 | npm run build 7 | fi 8 | 9 | # Install dependencies for shfmt extension 10 | curl -sS https://webi.sh/shfmt | sh &>/dev/null 11 | 12 | # Add OMZ plugins 13 | git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting 14 | git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions 15 | sed -i -E "s/^(plugins=\()(git)(\))/\1\2 zsh-syntax-highlighting zsh-autosuggestions\3/" ~/.zshrc 16 | 17 | # Avoid git log use less 18 | echo -e "\nunset LESS" >>~/.zshrc 19 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | trim_trailing_whitespace = true 8 | # Unix-style newlines with a newline ending every file 9 | end_of_line = lf 10 | insert_final_newline = true 11 | 12 | [*.{js,css,scss}] 13 | quote_type = single 14 | 15 | [*.{yml,yaml}] 16 | quote_type = double 17 | 18 | [*.md] 19 | trim_trailing_whitespace = false 20 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set default behavior to automatically normalize line endings. 2 | * text=auto 3 | 4 | # Force bash scripts to always use LF line endings so that if a repo is accessed 5 | # in Unix via a file share from Windows, the scripts will work. 6 | *.sh text eol=lf 7 | 8 | # Force batch scripts to always use CRLF line endings so that if a repo is accessed 9 | # in Windows via a file share from Linux, the scripts will work. 10 | *.{cmd,[cC][mM][dD]} text eol=crlf 11 | *.{bat,[bB][aA][tT]} text eol=crlf 12 | 13 | # Denote all files that are truly binary and should not be modified. 14 | *.png binary 15 | *.jpg binary 16 | *.ico binary 17 | -------------------------------------------------------------------------------- /.github/workflows/pages-deploy.yml: -------------------------------------------------------------------------------- 1 | name: "Build and Deploy" 2 | on: 3 | push: 4 | branches: 5 | - main 6 | - master 7 | paths-ignore: 8 | - .gitignore 9 | - README.md 10 | - LICENSE 11 | 12 | # Allows you to run this workflow manually from the Actions tab 13 | workflow_dispatch: 14 | 15 | permissions: 16 | contents: read 17 | pages: write 18 | id-token: write 19 | 20 | # Allow one concurrent deployment 21 | concurrency: 22 | group: "pages" 23 | cancel-in-progress: true 24 | 25 | jobs: 26 | build: 27 | runs-on: ubuntu-latest 28 | 29 | steps: 30 | - name: Checkout 31 | uses: actions/checkout@v4 32 | with: 33 | fetch-depth: 0 34 | # submodules: true 35 | # If using the 'assets' git submodule from Chirpy Starter, uncomment above 36 | # (See: https://github.com/cotes2020/chirpy-starter/tree/main/assets) 37 | 38 | - name: Setup Pages 39 | id: pages 40 | uses: actions/configure-pages@v4 41 | 42 | - name: Setup Ruby 43 | uses: ruby/setup-ruby@v1 44 | with: 45 | ruby-version: 3.3 46 | bundler-cache: true 47 | 48 | - name: Build site 49 | run: bundle exec jekyll b -d "_site${{ steps.pages.outputs.base_path }}" 50 | env: 51 | JEKYLL_ENV: "production" 52 | 53 | - name: Test site 54 | run: | 55 | bundle exec htmlproofer _site \ 56 | \-\-disable-external \ 57 | \-\-ignore-urls "/^http:\/\/127.0.0.1/,/^http:\/\/0.0.0.0/,/^http:\/\/localhost/" 58 | 59 | - name: Upload site artifact 60 | uses: actions/upload-pages-artifact@v3 61 | with: 62 | path: "_site${{ steps.pages.outputs.base_path }}" 63 | 64 | deploy: 65 | environment: 66 | name: github-pages 67 | url: ${{ steps.deployment.outputs.page_url }} 68 | runs-on: ubuntu-latest 69 | needs: build 70 | steps: 71 | - name: Deploy to GitHub Pages 72 | id: deployment 73 | uses: actions/deploy-pages@v4 74 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Bundler cache 2 | .bundle 3 | vendor 4 | Gemfile.lock 5 | 6 | # Jekyll cache 7 | .jekyll-cache 8 | .jekyll-metadata 9 | _site 10 | 11 | # RubyGems 12 | *.gem 13 | 14 | # NPM dependencies 15 | node_modules 16 | package-lock.json 17 | 18 | # IDE configurations 19 | .idea 20 | .vscode/* 21 | !.vscode/settings.json 22 | !.vscode/extensions.json 23 | !.vscode/tasks.json 24 | 25 | # Misc 26 | _sass/vendors 27 | assets/js/dist 28 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "assets/lib"] 2 | path = assets/lib 3 | url = https://github.com/cotes2020/chirpy-static-assets.git 4 | -------------------------------------------------------------------------------- /.nojekyll: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["ms-vscode-remote.remote-containers"] 3 | } 4 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | // Prettier 3 | "editor.defaultFormatter": "esbenp.prettier-vscode", 4 | "editor.formatOnSave": true, 5 | // Shopify Liquid 6 | "files.associations": { 7 | "*.html": "liquid" 8 | }, 9 | "[markdown]": { 10 | "editor.defaultFormatter": "yzhang.markdown-all-in-one" 11 | }, 12 | // Formatter 13 | "[html][liquid]": { 14 | "editor.defaultFormatter": "Shopify.theme-check-vscode" 15 | }, 16 | "[shellscript]": { 17 | "editor.defaultFormatter": "mkhl.shfmt" 18 | }, 19 | // Disable vscode built-in stylelint 20 | "css.validate": false, 21 | "scss.validate": false, 22 | "less.validate": false, 23 | // Stylint extension settings 24 | "stylelint.snippet": ["css", "scss"], 25 | "stylelint.validate": ["css", "scss"], 26 | // Run tasks in macOS 27 | "terminal.integrated.profiles.osx": { 28 | "zsh": { "path": "/bin/zsh", "args": ["-l", "-i"] } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "Run Jekyll Server", 6 | "type": "shell", 7 | "command": "./tools/run.sh", 8 | "group": { 9 | "kind": "build", 10 | "isDefault": true 11 | }, 12 | "problemMatcher": [], 13 | "detail": "Runs the Jekyll server with live reload." 14 | }, 15 | { 16 | "label": "Build Jekyll Site", 17 | "type": "shell", 18 | "command": "./tools/test.sh", 19 | "group": { 20 | "kind": "build" 21 | }, 22 | "problemMatcher": [], 23 | "detail": "Build the Jekyll site for production." 24 | } 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | source "https://rubygems.org" 4 | 5 | gem "jekyll-theme-chirpy", "~> 7.3" 6 | 7 | gem "html-proofer", "~> 5.0", group: :test 8 | 9 | platforms :mingw, :x64_mingw, :mswin, :jruby do 10 | gem "tzinfo", ">= 1", "< 3" 11 | gem "tzinfo-data" 12 | end 13 | 14 | gem "wdm", "~> 0.2.0", :platforms => [:mingw, :x64_mingw, :mswin] 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Cotes Chung 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Chirpy Starter 2 | 3 | [![Gem Version](https://img.shields.io/gem/v/jekyll-theme-chirpy)][gem]  4 | [![GitHub license](https://img.shields.io/github/license/cotes2020/chirpy-starter.svg?color=blue)][mit] 5 | 6 | When installing the [**Chirpy**][chirpy] theme through [RubyGems.org][gem], Jekyll can only read files in the folders 7 | `_data`, `_layouts`, `_includes`, `_sass` and `assets`, as well as a small part of options of the `_config.yml` file 8 | from the theme's gem. If you have ever installed this theme gem, you can use the command 9 | `bundle info --path jekyll-theme-chirpy` to locate these files. 10 | 11 | The Jekyll team claims that this is to leave the ball in the user’s court, but this also results in users not being 12 | able to enjoy the out-of-the-box experience when using feature-rich themes. 13 | 14 | To fully use all the features of **Chirpy**, you need to copy the other critical files from the theme's gem to your 15 | Jekyll site. The following is a list of targets: 16 | 17 | ```shell 18 | . 19 | ├── _config.yml 20 | ├── _plugins 21 | ├── _tabs 22 | └── index.html 23 | ``` 24 | 25 | To save you time, and also in case you lose some files while copying, we extract those files/configurations of the 26 | latest version of the **Chirpy** theme and the [CD][CD] workflow to here, so that you can start writing in minutes. 27 | 28 | ## Usage 29 | 30 | Check out the [theme's docs](https://github.com/cotes2020/jekyll-theme-chirpy/wiki). 31 | 32 | ## Contributing 33 | 34 | This repository is automatically updated with new releases from the theme repository. If you encounter any issues or want to contribute to its improvement, please visit the [theme repository][chirpy] to provide feedback. 35 | 36 | ## License 37 | 38 | This work is published under [MIT][mit] License. 39 | 40 | [gem]: https://rubygems.org/gems/jekyll-theme-chirpy 41 | [chirpy]: https://github.com/cotes2020/jekyll-theme-chirpy/ 42 | [CD]: https://en.wikipedia.org/wiki/Continuous_deployment 43 | [mit]: https://github.com/cotes2020/chirpy-starter/blob/master/LICENSE 44 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | # The Site Configuration 2 | 3 | # Import the theme 4 | theme: jekyll-theme-chirpy 5 | 6 | # The language of the webpage › http://www.lingoes.net/en/translator/langcode.htm 7 | # If it has the same name as one of the files in folder `_data/locales`, the layout language will also be changed, 8 | # otherwise, the layout language will use the default value of 'en'. 9 | lang: en 10 | 11 | # Change to your timezone › https://kevinnovak.github.io/Time-Zone-Picker 12 | timezone: 13 | 14 | # jekyll-seo-tag settings › https://github.com/jekyll/jekyll-seo-tag/blob/master/docs/usage.md 15 | # ↓ -------------------------- 16 | 17 | title: Chirpy # the main title 18 | 19 | tagline: A text-focused Jekyll theme # it will display as the subtitle 20 | 21 | description: >- # used by seo meta and the atom feed 22 | A minimal, responsive and feature-rich Jekyll theme for technical writing. 23 | 24 | # Fill in the protocol & hostname for your site. 25 | # E.g. 'https://username.github.io', note that it does not end with a '/'. 26 | url: "" 27 | 28 | github: 29 | username: github_username # change to your GitHub username 30 | 31 | twitter: 32 | username: twitter_username # change to your Twitter username 33 | 34 | social: 35 | # Change to your full name. 36 | # It will be displayed as the default author of the posts and the copyright owner in the Footer 37 | name: your_full_name 38 | email: example@domain.com # change to your email address 39 | links: 40 | # The first element serves as the copyright owner's link 41 | - https://twitter.com/username # change to your Twitter homepage 42 | - https://github.com/username # change to your GitHub homepage 43 | # Uncomment below to add more social links 44 | # - https://www.facebook.com/username 45 | # - https://www.linkedin.com/in/username 46 | 47 | # Site Verification Settings 48 | webmaster_verifications: 49 | google: # fill in your Google verification code 50 | bing: # fill in your Bing verification code 51 | alexa: # fill in your Alexa verification code 52 | yandex: # fill in your Yandex verification code 53 | baidu: # fill in your Baidu verification code 54 | facebook: # fill in your Facebook verification code 55 | 56 | # ↑ -------------------------- 57 | # The end of `jekyll-seo-tag` settings 58 | 59 | # Web Analytics Settings 60 | analytics: 61 | google: 62 | id: # fill in your Google Analytics ID 63 | goatcounter: 64 | id: # fill in your GoatCounter ID 65 | umami: 66 | id: # fill in your Umami ID 67 | domain: # fill in your Umami domain 68 | matomo: 69 | id: # fill in your Matomo ID 70 | domain: # fill in your Matomo domain 71 | cloudflare: 72 | id: # fill in your Cloudflare Web Analytics token 73 | fathom: 74 | id: # fill in your Fathom Site ID 75 | 76 | # Page views settings 77 | pageviews: 78 | provider: # now only supports 'goatcounter' 79 | 80 | # Prefer color scheme setting. 81 | # 82 | # Note: Keep empty will follow the system prefer color by default, 83 | # and there will be a toggle to switch the theme between dark and light 84 | # on the bottom left of the sidebar. 85 | # 86 | # Available options: 87 | # 88 | # light — Use the light color scheme 89 | # dark — Use the dark color scheme 90 | # 91 | theme_mode: # [light | dark] 92 | 93 | # The CDN endpoint for media resources. 94 | # Notice that once it is assigned, the CDN url 95 | # will be added to all media resources (site avatar, posts' images, audio and video files) paths starting with '/' 96 | # 97 | # e.g. 'https://cdn.com' 98 | cdn: 99 | 100 | # the avatar on sidebar, support local or CORS resources 101 | avatar: 102 | 103 | # The URL of the site-wide social preview image used in SEO `og:image` meta tag. 104 | # It can be overridden by a customized `page.image` in front matter. 105 | social_preview_image: # string, local or CORS resources 106 | 107 | # boolean type, the global switch for TOC in posts. 108 | toc: true 109 | 110 | comments: 111 | # Global switch for the post-comment system. Keeping it empty means disabled. 112 | provider: # [disqus | utterances | giscus] 113 | # The provider options are as follows: 114 | disqus: 115 | shortname: # fill with the Disqus shortname. › https://help.disqus.com/en/articles/1717111-what-s-a-shortname 116 | # utterances settings › https://utteranc.es/ 117 | utterances: 118 | repo: # / 119 | issue_term: # < url | pathname | title | ...> 120 | # Giscus options › https://giscus.app 121 | giscus: 122 | repo: # / 123 | repo_id: 124 | category: 125 | category_id: 126 | mapping: # optional, default to 'pathname' 127 | strict: # optional, default to '0' 128 | input_position: # optional, default to 'bottom' 129 | lang: # optional, default to the value of `site.lang` 130 | reactions_enabled: # optional, default to the value of `1` 131 | 132 | # Self-hosted static assets, optional › https://github.com/cotes2020/chirpy-static-assets 133 | assets: 134 | self_host: 135 | enabled: # boolean, keep empty means false 136 | # specify the Jekyll environment, empty means both 137 | # only works if `assets.self_host.enabled` is 'true' 138 | env: # [development | production] 139 | 140 | pwa: 141 | enabled: true # The option for PWA feature (installable) 142 | cache: 143 | enabled: true # The option for PWA offline cache 144 | # Paths defined here will be excluded from the PWA cache. 145 | # Usually its value is the `baseurl` of another website that 146 | # shares the same domain name as the current website. 147 | deny_paths: 148 | # - "/example" # URLs match `/example/*` will not be cached by the PWA 149 | 150 | paginate: 10 151 | 152 | # The base URL of your site 153 | baseurl: "" 154 | 155 | # ------------ The following options are not recommended to be modified ------------------ 156 | 157 | kramdown: 158 | footnote_backlink: "↩︎" 159 | syntax_highlighter: rouge 160 | syntax_highlighter_opts: # Rouge Options › https://github.com/jneen/rouge#full-options 161 | css_class: highlight 162 | # default_lang: console 163 | span: 164 | line_numbers: false 165 | block: 166 | line_numbers: true 167 | start_line: 1 168 | 169 | collections: 170 | tabs: 171 | output: true 172 | sort_by: order 173 | 174 | defaults: 175 | - scope: 176 | path: "" # An empty string here means all files in the project 177 | type: posts 178 | values: 179 | layout: post 180 | comments: true # Enable comments in posts. 181 | toc: true # Display TOC column in posts. 182 | # DO NOT modify the following parameter unless you are confident enough 183 | # to update the code of all other post links in this project. 184 | permalink: /posts/:title/ 185 | - scope: 186 | path: _drafts 187 | values: 188 | comments: false 189 | - scope: 190 | path: "" 191 | type: tabs # see `site.collections` 192 | values: 193 | layout: page 194 | permalink: /:title/ 195 | 196 | sass: 197 | style: compressed 198 | 199 | compress_html: 200 | clippings: all 201 | comments: all 202 | endings: all 203 | profile: false 204 | blanklines: false 205 | ignore: 206 | envs: [development] 207 | 208 | exclude: 209 | - "*.gem" 210 | - "*.gemspec" 211 | - docs 212 | - tools 213 | - README.md 214 | - LICENSE 215 | - purgecss.js 216 | - "*.config.js" 217 | - "package*.json" 218 | 219 | jekyll-archives: 220 | enabled: [categories, tags] 221 | layouts: 222 | category: category 223 | tag: tag 224 | permalinks: 225 | tag: /tags/:name/ 226 | category: /categories/:name/ 227 | -------------------------------------------------------------------------------- /_data/contact.yml: -------------------------------------------------------------------------------- 1 | # The contact options. 2 | 3 | - type: github 4 | icon: "fab fa-github" 5 | 6 | - type: twitter 7 | icon: "fa-brands fa-x-twitter" 8 | 9 | - type: email 10 | icon: "fas fa-envelope" 11 | noblank: true # open link in current tab 12 | 13 | - type: rss 14 | icon: "fas fa-rss" 15 | noblank: true 16 | # Uncomment and complete the url below to enable more contact options 17 | # 18 | # - type: mastodon 19 | # icon: 'fab fa-mastodon' # icons powered by 20 | # url: '' # Fill with your Mastodon account page, rel="me" will be applied for verification 21 | # 22 | # - type: linkedin 23 | # icon: 'fab fa-linkedin' # icons powered by 24 | # url: '' # Fill with your Linkedin homepage 25 | # 26 | # - type: stack-overflow 27 | # icon: 'fab fa-stack-overflow' 28 | # url: '' # Fill with your stackoverflow homepage 29 | # 30 | # - type: bluesky 31 | # icon: 'fa-brands fa-bluesky' 32 | # url: '' # Fill with your Bluesky profile link 33 | # 34 | # - type: reddit 35 | # icon: 'fa-brands fa-reddit' 36 | # url: '' # Fill with your Reddit profile link 37 | # 38 | # - type: threads 39 | # icon: 'fa-brands fa-threads' 40 | # url: '' # Fill with your Threads profile link 41 | -------------------------------------------------------------------------------- /_data/share.yml: -------------------------------------------------------------------------------- 1 | # Sharing options at the bottom of the post. 2 | # Icons from 3 | 4 | platforms: 5 | - type: Twitter 6 | icon: "fa-brands fa-square-x-twitter" 7 | link: "https://twitter.com/intent/tweet?text=TITLE&url=URL" 8 | 9 | - type: Facebook 10 | icon: "fab fa-facebook-square" 11 | link: "https://www.facebook.com/sharer/sharer.php?title=TITLE&u=URL" 12 | 13 | - type: Telegram 14 | icon: "fab fa-telegram" 15 | link: "https://t.me/share/url?url=URL&text=TITLE" 16 | 17 | # Uncomment below if you need to. 18 | # 19 | # - type: Linkedin 20 | # icon: "fab fa-linkedin" 21 | # link: "https://www.linkedin.com/feed/?shareActive=true&shareUrl=URL" 22 | # 23 | # - type: Weibo 24 | # icon: "fab fa-weibo" 25 | # link: "https://service.weibo.com/share/share.php?title=TITLE&url=URL" 26 | # 27 | # - type: Mastodon 28 | # icon: "fa-brands fa-mastodon" 29 | # # See: https://github.com/justinribeiro/share-to-mastodon#properties 30 | # instances: 31 | # - label: mastodon.social 32 | # link: "https://mastodon.social/" 33 | # - label: mastodon.online 34 | # link: "https://mastodon.online/" 35 | # - label: fosstodon.org 36 | # link: "https://fosstodon.org/" 37 | # - label: photog.social 38 | # link: "https://photog.social/" 39 | # 40 | # - type: Bluesky 41 | # icon: "fa-brands fa-bluesky" 42 | # link: "https://bsky.app/intent/compose?text=TITLE%20URL" 43 | # 44 | # - type: Reddit 45 | # icon: "fa-brands fa-square-reddit" 46 | # link: "https://www.reddit.com/submit?url=URL&title=TITLE" 47 | # 48 | # - type: Threads 49 | # icon: "fa-brands fa-square-threads" 50 | # link: "https://www.threads.net/intent/post?text=TITLE%20URL" 51 | -------------------------------------------------------------------------------- /_plugins/posts-lastmod-hook.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # 3 | # Check for changed posts 4 | 5 | Jekyll::Hooks.register :posts, :post_init do |post| 6 | 7 | commit_num = `git rev-list --count HEAD "#{ post.path }"` 8 | 9 | if commit_num.to_i > 1 10 | lastmod_date = `git log -1 --pretty="%ad" --date=iso "#{ post.path }"` 11 | post.data['last_modified_at'] = lastmod_date 12 | end 13 | 14 | end 15 | -------------------------------------------------------------------------------- /_posts/.placeholder: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /_tabs/about.md: -------------------------------------------------------------------------------- 1 | --- 2 | # the default layout is 'page' 3 | icon: fas fa-info-circle 4 | order: 4 5 | --- 6 | 7 | > Add Markdown syntax content to file `_tabs/about.md`{: .filepath } and it will show up on this page. 8 | {: .prompt-tip } 9 | -------------------------------------------------------------------------------- /_tabs/archives.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: archives 3 | icon: fas fa-archive 4 | order: 3 5 | --- 6 | -------------------------------------------------------------------------------- /_tabs/categories.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: categories 3 | icon: fas fa-stream 4 | order: 1 5 | --- 6 | -------------------------------------------------------------------------------- /_tabs/tags.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: tags 3 | icon: fas fa-tags 4 | order: 2 5 | --- 6 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: home 3 | # Index page 4 | --- 5 | -------------------------------------------------------------------------------- /tools/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Run jekyll serve and then launch the site 4 | 5 | prod=false 6 | command="bundle exec jekyll s -l" 7 | host="127.0.0.1" 8 | 9 | help() { 10 | echo "Usage:" 11 | echo 12 | echo " bash /path/to/run [options]" 13 | echo 14 | echo "Options:" 15 | echo " -H, --host [HOST] Host to bind to." 16 | echo " -p, --production Run Jekyll in 'production' mode." 17 | echo " -h, --help Print this help information." 18 | } 19 | 20 | while (($#)); do 21 | opt="$1" 22 | case $opt in 23 | -H | --host) 24 | host="$2" 25 | shift 2 26 | ;; 27 | -p | --production) 28 | prod=true 29 | shift 30 | ;; 31 | -h | --help) 32 | help 33 | exit 0 34 | ;; 35 | *) 36 | echo -e "> Unknown option: '$opt'\n" 37 | help 38 | exit 1 39 | ;; 40 | esac 41 | done 42 | 43 | command="$command -H $host" 44 | 45 | if $prod; then 46 | command="JEKYLL_ENV=production $command" 47 | fi 48 | 49 | if [ -e /proc/1/cgroup ] && grep -q docker /proc/1/cgroup; then 50 | command="$command --force_polling" 51 | fi 52 | 53 | echo -e "\n> $command\n" 54 | eval "$command" 55 | -------------------------------------------------------------------------------- /tools/test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Build and test the site content 4 | # 5 | # Requirement: html-proofer, jekyll 6 | # 7 | # Usage: See help information 8 | 9 | set -eu 10 | 11 | SITE_DIR="_site" 12 | 13 | _config="_config.yml" 14 | 15 | _baseurl="" 16 | 17 | help() { 18 | echo "Build and test the site content" 19 | echo 20 | echo "Usage:" 21 | echo 22 | echo " bash $0 [options]" 23 | echo 24 | echo "Options:" 25 | echo ' -c, --config "" Specify config file(s)' 26 | echo " -h, --help Print this information." 27 | } 28 | 29 | read_baseurl() { 30 | if [[ $_config == *","* ]]; then 31 | # multiple config 32 | IFS="," 33 | read -ra config_array <<<"$_config" 34 | 35 | # reverse loop the config files 36 | for ((i = ${#config_array[@]} - 1; i >= 0; i--)); do 37 | _tmp_baseurl="$(grep '^baseurl:' "${config_array[i]}" | sed "s/.*: *//;s/['\"]//g;s/#.*//")" 38 | 39 | if [[ -n $_tmp_baseurl ]]; then 40 | _baseurl="$_tmp_baseurl" 41 | break 42 | fi 43 | done 44 | 45 | else 46 | # single config 47 | _baseurl="$(grep '^baseurl:' "$_config" | sed "s/.*: *//;s/['\"]//g;s/#.*//")" 48 | fi 49 | } 50 | 51 | main() { 52 | # clean up 53 | if [[ -d $SITE_DIR ]]; then 54 | rm -rf "$SITE_DIR" 55 | fi 56 | 57 | read_baseurl 58 | 59 | # build 60 | JEKYLL_ENV=production bundle exec jekyll b \ 61 | -d "$SITE_DIR$_baseurl" -c "$_config" 62 | 63 | # test 64 | bundle exec htmlproofer "$SITE_DIR" \ 65 | --disable-external \ 66 | --ignore-urls "/^http:\/\/127.0.0.1/,/^http:\/\/0.0.0.0/,/^http:\/\/localhost/" 67 | } 68 | 69 | while (($#)); do 70 | opt="$1" 71 | case $opt in 72 | -c | --config) 73 | _config="$2" 74 | shift 75 | shift 76 | ;; 77 | -h | --help) 78 | help 79 | exit 0 80 | ;; 81 | *) 82 | # unknown option 83 | help 84 | exit 1 85 | ;; 86 | esac 87 | done 88 | 89 | main 90 | --------------------------------------------------------------------------------