Skip to content

Commit

Permalink
merge: update chirpy
Browse files Browse the repository at this point in the history
  • Loading branch information
MVladislav committed Sep 6, 2024
2 parents 3df2011 + 6ae7825 commit e8220d1
Show file tree
Hide file tree
Showing 14 changed files with 312 additions and 36 deletions.
29 changes: 29 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "Jekyll",
"image": "mcr.microsoft.com/devcontainers/jekyll:2-bullseye",
"onCreateCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
"postCreateCommand": "bash .devcontainer/post-create.sh",
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.defaultProfile.linux": "zsh"
},
"extensions": [
// Liquid tags auto-complete
"killalau.vscode-liquid-snippets",
// Liquid syntax highlighting and formatting
"Shopify.theme-check-vscode",
// Shell
"timonwong.shellcheck",
"mkhl.shfmt",
// Common formatter
"EditorConfig.EditorConfig",
"esbenp.prettier-vscode",
"stylelint.vscode-stylelint",
"yzhang.markdown-all-in-one",
// Git
"mhutchie.git-graph"
]
}
}
}
18 changes: 18 additions & 0 deletions .devcontainer/post-create.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

if [ -f package.json ]; then
bash -i -c "nvm install --lts && nvm install-latest-npm"
npm i
npm run build
fi

# Install dependencies for shfmt extension
curl -sS https://webi.sh/shfmt | sh &>/dev/null

# Add OMZ plugins
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
sed -i -E "s/^(plugins=\()(git)(\))/\1\2 zsh-syntax-highlighting zsh-autosuggestions\3/" ~/.zshrc

# Avoid git log use less
echo -e "\nunset LESS" >>~/.zshrc
10 changes: 5 additions & 5 deletions .github/workflows/pages-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ jobs:
# https://github.com/actions/configure-pages
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
uses: actions/configure-pages@v4

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
ruby-version: 3.3
bundler-cache: true

- name: Build site
Expand All @@ -55,12 +55,12 @@ jobs:
- name: Test site
run: |
bundle exec htmlproofer _site \
\-\-disable-external=true \
\-\-disable-external \
\-\-ignore-urls "/^http:\/\/127.0.0.1/,/^http:\/\/0.0.0.0/,/^http:\/\/localhost/"
# https://github.com/actions/upload-pages-artifact
- name: Upload site artifact
uses: actions/upload-pages-artifact@v2
uses: actions/upload-pages-artifact@v3
with:
path: "_site${{ steps.pages.outputs.base_path }}"

Expand All @@ -76,4 +76,4 @@ jobs:
# https://github.com/actions/deploy-pages
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v4
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Gemfile.lock

# Jekyll cache
.jekyll-cache
.jekyll-metadata
_site

# RubyGems
Expand All @@ -16,9 +17,13 @@ package-lock.json

# IDE configurations
.idea
.vscode
.vscode/*
!.vscode/settings.json
!.vscode/extensions.json
!.vscode/tasks.json

# Misc
_sass/dist
assets/js/dist

assets/img/favicons/t1
Expand Down
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["ms-vscode-remote.remote-containers"]
}
30 changes: 30 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
// Prettier
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
// Shopify Liquid
"files.associations": {
"*.html": "liquid"
},
"[markdown]": {
"editor.defaultFormatter": "yzhang.markdown-all-in-one"
},
// Formatter
"[html][liquid]": {
"editor.defaultFormatter": "Shopify.theme-check-vscode"
},
"[shellscript]": {
"editor.defaultFormatter": "mkhl.shfmt"
},
// Disable vscode built-in stylelint
"css.validate": false,
"scss.validate": false,
"less.validate": false,
// Stylint extension settings
"stylelint.snippet": ["css", "scss"],
"stylelint.validate": ["css", "scss"],
// Run tasks in macOS
"terminal.integrated.profiles.osx": {
"zsh": { "path": "/bin/zsh", "args": ["-l", "-i"] }
}
}
26 changes: 26 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Run Jekyll Server",
"type": "shell",
"command": "./tools/run.sh",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [],
"detail": "Runs the Jekyll server with live reload."
},
{
"label": "Build Jekyll Site",
"type": "shell",
"command": "./tools/test.sh",
"group": {
"kind": "build"
},
"problemMatcher": [],
"detail": "Build the Jekyll site for production."
}
]
}
13 changes: 2 additions & 11 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,13 @@

source "https://rubygems.org"

gem "jekyll-theme-chirpy", "~> 6.4", ">= 6.4.2"
gem "jekyll-theme-chirpy", "~> 7.1"

group :test do
gem "html-proofer", "~> 4.4"
end
gem "html-proofer", "~> 5.0", group: :test

# 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]
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ $ bundle

Please see the [theme's docs](https://github.com/cotes2020/jekyll-theme-chirpy#documentation).

## Contributing

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.

## License

This work is published under [MIT][mit] License.
Expand Down
39 changes: 21 additions & 18 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ social:
#
# Available options:
#
# light - Use the light color scheme
# dark - Use the dark color scheme
# light Use the light color scheme
# dark Use the dark color scheme
#
theme_mode: dark # [light|dark]

# The CDN endpoint for images.
# The CDN endpoint for media resources.
# Notice that once it is assigned, the CDN url
# will be added to all image (site avatar & posts' images) paths starting with '/'
# will be added to all media resources (site avatar, posts' images, audio and video files) paths starting with '/'
#
# e.g. 'https://cdn.com'
img_cdn:
cdn:

# the avatar on sidebar, support local or CORS resources
avatar: /assets/img/avatar.png
Expand All @@ -67,8 +67,9 @@ social_preview_image: /assets/img/avatar.png
toc: true

comments:
active: giscus # The global switch for posts comments, e.g., 'disqus'. Keep it empty means disable
# The active options are as follows:
# Global switch for the post-comment system. Keeping it empty means disabled.
provider: giscus # [disqus | utterances | giscus]
# The provider 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/
Expand All @@ -82,7 +83,9 @@ comments:
category: Q&A
category_id: DIC_kwDOJipZz84CWd0H
mapping: pathname # optional, default to 'pathname'
strict: # optional, default to '0'
input_position: bottom # optional, default to 'bottom'

lang: # optional, default to the value of `site.lang`
reactions_enabled: 1 # optional, default to the value of `1`

Expand All @@ -92,10 +95,17 @@ assets:
enabled: # boolean, keep empty means false
# specify the Jekyll environment, empty means both
# only works if `assets.self_host.enabled` is 'true'
env: # [development|production]
env: # [development | production]

pwa:
enabled: true # the option for PWA feature
enabled: true # The option for PWA feature (installable)
cache:
enabled: true # The option for PWA offline cache
# Paths defined here will be excluded from the PWA cache.
# Usually its value is the `baseurl` of another website that
# shares the same domain name as the current website.
deny_paths:
# - "/example" # URLs match `<SITE_URL>/example/*` will not be cached by the PWA

paginate: 10

Expand All @@ -105,6 +115,7 @@ baseurl: ""
# ------------ The following options are not recommended to be modified ------------------

kramdown:
footnote_backlink: "&#8617;&#xfe0e;"
syntax_highlighter: rouge
syntax_highlighter_opts: # Rouge Options › https://github.com/jneen/rouge#full-options
css_class: highlight
Expand Down Expand Up @@ -141,14 +152,6 @@ defaults:
values:
layout: page
permalink: /:title/
- scope:
path: assets/img/favicons
values:
swcache: true
- scope:
path: assets/js/dist
values:
swcache: true

sass:
style: compressed
Expand All @@ -169,7 +172,7 @@ exclude:
- tools
- README.md
- LICENSE
- rollup.config.js
- "*.config.js"
- package*.json

jekyll-archives:
Expand Down
12 changes: 12 additions & 0 deletions _data/contact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,15 @@
# - type: stack-overflow
# icon: 'fab fa-stack-overflow'
# url: '' # Fill with your stackoverflow homepage
#
# - type: bluesky
# icon: 'fa-brands fa-bluesky'
# url: '' # Fill with your Bluesky profile link
#
# - type: reddit
# icon: 'fa-brands fa-reddit'
# url: '' # Fill with your Reddit profile link
#
# - type: threads
# icon: 'fa-brands fa-threads'
# url: '' # Fill with your Threads profile link
14 changes: 13 additions & 1 deletion _data/share.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ platforms:
#
# - type: Weibo
# icon: "fab fa-weibo"
# link: "http://service.weibo.com/share/share.php?title=TITLE&url=URL"
# link: "https://service.weibo.com/share/share.php?title=TITLE&url=URL"
#
# - type: Mastodon
# icon: "fa-brands fa-mastodon"
Expand All @@ -36,3 +36,15 @@ platforms:
# link: "https://fosstodon.org/"
# - label: photog.social
# link: "https://photog.social/"
#
# - type: Bluesky
# icon: "fa-brands fa-bluesky"
# link: "https://bsky.app/intent/compose?text=TITLE%20URL"
#
# - type: Reddit
# icon: "fa-brands fa-square-reddit"
# link: "https://www.reddit.com/submit?url=URL&title=TITLE"
#
# - type: Threads
# icon: "fa-brands fa-square-threads"
# link: "https://www.threads.net/intent/post?text=TITLE%20URL"
54 changes: 54 additions & 0 deletions tools/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/usr/bin/env bash
#
# Run jekyll serve and then launch the site

prod=false
command="bundle exec jekyll s -l"
host="127.0.0.1"

help() {
echo "Usage:"
echo
echo " bash /path/to/run [options]"
echo
echo "Options:"
echo " -H, --host [HOST] Host to bind to."
echo " -p, --production Run Jekyll in 'production' mode."
echo " -h, --help Print this help information."
}

while (($#)); do
opt="$1"
case $opt in
-H | --host)
host="$2"
shift 2
;;
-p | --production)
prod=true
shift
;;
-h | --help)
help
exit 0
;;
*)
echo -e "> Unknown option: '$opt'\n"
help
exit 1
;;
esac
done

command="$command -H $host"

if $prod; then
command="JEKYLL_ENV=production $command"
fi

if [ -e /proc/1/cgroup ] && grep -q docker /proc/1/cgroup; then
command="$command --force_polling"
fi

echo -e "\n> $command\n"
eval "$command"
Loading

0 comments on commit e8220d1

Please sign in to comment.