mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2025-12-18 05:41:31 +00:00
Improve the copyrights of the assets
This commit is contained in:
@@ -1,53 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Bump latest version to file `_data/meta.yml`
|
||||
#
|
||||
# v2.5.1
|
||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
# © 2020 Cotes Chung
|
||||
# Published under MIT License
|
||||
|
||||
set -eu
|
||||
|
||||
META_FILE="_data/meta.yml"
|
||||
|
||||
bump() {
|
||||
_version_field="version: $1"
|
||||
|
||||
if [[ ! -f $META_FILE ]]; then
|
||||
echo "name: Chirpy" > $META_FILE
|
||||
echo "$_version_field" >> $META_FILE
|
||||
echo "homepage: https://github.com/cotes2020/jekyll-theme-chirpy/" >> $META_FILE
|
||||
else
|
||||
sed -i "s/^version:.*/$_version_field/g" $META_FILE
|
||||
fi
|
||||
|
||||
if [[ -n $(git status $META_FILE -s) ]]; then
|
||||
git add $META_FILE
|
||||
git commit -m "Bump version to $1"
|
||||
fi
|
||||
}
|
||||
|
||||
_latest_tag="$(git describe --tags --abbrev=0)"
|
||||
|
||||
echo "Input a version number (hint: latest version is ${_latest_tag:1})"
|
||||
|
||||
read version
|
||||
|
||||
if [[ $version =~ ^[[:digit:]]+\.[[:digit:]]+(\.[[:digit:]]+)?$ ]]; then
|
||||
|
||||
if git tag --list | egrep -q "^v$version$"; then
|
||||
echo "Error: version '$version' already exists"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
echo "Bump version to $version"
|
||||
bump "$version"
|
||||
|
||||
echo "Create tag v$version"
|
||||
git tag "v$version"
|
||||
|
||||
else
|
||||
|
||||
echo "Error: Illegal version number: '$version'"
|
||||
fi
|
||||
75
tools/bump.sh
Executable file
75
tools/bump.sh
Executable file
@@ -0,0 +1,75 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Bump latest version to
|
||||
# - _sass/jekyll-theme-chirpy.scss
|
||||
# - assets/js/_commons/_copyright.js
|
||||
# - assets/js/dist/*.js
|
||||
# - jekyll-theme-chirpy.gemspec
|
||||
#
|
||||
# Required: gulp
|
||||
|
||||
set -eu
|
||||
|
||||
ASSETS=(
|
||||
"_sass/jekyll-theme-chirpy.scss"
|
||||
"assets/js/.copyright"
|
||||
)
|
||||
|
||||
GEM_SPEC="jekyll-theme-chirpy.gemspec"
|
||||
|
||||
bump_assets() {
|
||||
_version="$1"
|
||||
for i in ${!ASSETS[@]}; do
|
||||
sed -i "s/v[[:digit:]]\.[[:digit:]]\.[[:digit:]]/v$_version/" ${ASSETS[$i]}
|
||||
done
|
||||
|
||||
gulp
|
||||
}
|
||||
|
||||
bump_gemspec() {
|
||||
_version="$1"
|
||||
sed -i "s/[[:digit:]]\.[[:digit:]]\.[[:digit:]]/$_version/" $GEM_SPEC
|
||||
}
|
||||
|
||||
bump() {
|
||||
bump_assets $1
|
||||
bump_gemspec $1
|
||||
|
||||
if [[ -n $(git status . -s) ]]; then
|
||||
git add .
|
||||
git commit -m "Bump version to $1"
|
||||
fi
|
||||
}
|
||||
|
||||
main() {
|
||||
if [[ -n $(git status . -s) ]]; then
|
||||
echo "Warning: commit unstaged files first, and then run this tool againt."
|
||||
exit -1
|
||||
fi
|
||||
|
||||
_latest_tag="$(git describe --tags --abbrev=0)"
|
||||
|
||||
echo "Input a version number (hint: latest version is ${_latest_tag:1})"
|
||||
|
||||
read _version
|
||||
|
||||
if [[ $_version =~ ^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]$ ]]; then
|
||||
|
||||
if git tag --list | egrep -q "^v$_version$"; then
|
||||
echo "Error: version '$_version' already exists"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
echo "Bump version to $_version"
|
||||
bump "$_version"
|
||||
|
||||
echo "Create tag v$_version"
|
||||
git tag "v$_version"
|
||||
|
||||
else
|
||||
|
||||
echo "Error: Illegal version number: '$_version'"
|
||||
fi
|
||||
}
|
||||
|
||||
main
|
||||
@@ -1,11 +1,6 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Deploy the content of _site to 'origin/<pages_branch>'
|
||||
#
|
||||
# v2.5
|
||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
# © 2020 Cotes Chung
|
||||
# Published under MIT License
|
||||
|
||||
set -eu
|
||||
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Init the evrionment for new user.
|
||||
#
|
||||
# v2.5
|
||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
# © 2020 Cotes Chung
|
||||
# Published under MIT License
|
||||
|
||||
set -eu
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Fetch Google Analytics Pageviews reporting cache
|
||||
# and save as 'assets/data/pagevies.json'
|
||||
@@ -6,12 +6,6 @@
|
||||
# Requirement:
|
||||
# - jq
|
||||
# - wget
|
||||
#
|
||||
# v2.0
|
||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
# © 2019 Cotes Chung
|
||||
# MIT Licensed
|
||||
|
||||
|
||||
set -eu
|
||||
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Run jekyll serve and then launch the site
|
||||
#
|
||||
# v2.6.1
|
||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
# © 2020 Cotes Chung
|
||||
# MIT Licensed
|
||||
|
||||
bundle exec jekyll s -H 0.0.0.0 -l
|
||||
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Using HTML-proofer to test site.
|
||||
#
|
||||
# Requirement: https://github.com/gjtorikian/html-proofer
|
||||
#
|
||||
# Usage: bash /path/to/test.sh [indicated path]
|
||||
#
|
||||
# v2.0
|
||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
# © 2020 Cotes Chung
|
||||
# MIT Licensed
|
||||
|
||||
DEST=_site
|
||||
URL_IGNORE=cdn.jsdelivr.net
|
||||
|
||||
Reference in New Issue
Block a user