diff --git a/Gemfile b/Gemfile index 17d88e1f..7835f00a 100644 --- a/Gemfile +++ b/Gemfile @@ -1,52 +1,72 @@ -source "https://rubygems.org" -# Hello! This is where you manage which Jekyll version is used to run. -# When you want to use a different version, change it below, save the -# file and run `bundle install`. Run Jekyll with `bundle exec`, like so: +# source "https://rubygems.org" +# # Hello! This is where you manage which Jekyll version is used to run. +# # When you want to use a different version, change it below, save the +# # file and run `bundle install`. Run Jekyll with `bundle exec`, like so: +# # +# # bundle exec jekyll serve +# gem "bundler", "~> 2.5.23" +# # This will help ensure the proper Jekyll version is running. +# # Happy Jekylling! +# # gem "jekyll", "~> 4.3.4" +# gem "jekyll", "~> 3.10.0" # for jekyll-commonmark-ghpages 0.5.1 +# # This is the default theme for new Jekyll sites. You may change this to anything you like. +# gem "minima", "~> 2.5" +# # If you want to use GitHub Pages, remove the "gem "jekyll"" above and +# # uncomment the line below. To upgrade, run `bundle update github-pages`. +# # gem "github-pages", group: :jekyll_plugins +# # If you have any plugins, put them here! +# group :jekyll_plugins do +# gem "jekyll-feed", "~> 0.12" +# 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", :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] # -# bundle exec jekyll serve -gem "bundler", "~> 2.5.23" -# This will help ensure the proper Jekyll version is running. -# Happy Jekylling! -# gem "jekyll", "~> 4.3.4" -gem "jekyll", "~> 3.10.0" # for jekyll-commonmark-ghpages 0.5.1 -# This is the default theme for new Jekyll sites. You may change this to anything you like. -gem "minima", "~> 2.5" -# If you want to use GitHub Pages, remove the "gem "jekyll"" above and -# uncomment the line below. To upgrade, run `bundle update github-pages`. -# gem "github-pages", group: :jekyll_plugins -# If you have any plugins, put them here! -group :jekyll_plugins do - gem "jekyll-feed", "~> 0.12" -end +# gem "jekyll-relative-links" +# +# gem "jekyll-sitemap" +# gem "jekyll-readme-index" +# +# gem "jekyll-seo-tag" +# gem "jekyll-github-metadata" +# gem "jekyll-coffeescript" +# gem 'jekyll-commonmark-ghpages', '~> 0.5.1' +# gem "jekyll-gist" +# gem "jekyll-paginate" +# gem "jekyll-optional-front-matter" +# gem "jekyll-default-layout" +# gem "jekyll-titles-from-headings" +# gem 'kramdown-parser-gfm' +# gem 'rdiscount' +# gem "redcarpet" -# 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", :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] +# github poges +# frozen_string_literal: true -gem "jekyll-relative-links" +source "https://rubygems.org" +gem 'github-pages', group: :jekyll_plugins +# git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } -gem "jekyll-sitemap" -gem "jekyll-readme-index" +# Manage our dependency on the version of the github-pages gem here. +# gem "github-pages", "= 232" -gem "jekyll-seo-tag" -gem "jekyll-github-metadata" -gem "jekyll-coffeescript" -gem 'jekyll-commonmark-ghpages', '~> 0.5.1' -gem "jekyll-gist" -gem "jekyll-paginate" -gem "jekyll-optional-front-matter" -gem "jekyll-default-layout" -gem "jekyll-titles-from-headings" -gem 'kramdown-parser-gfm' -gem 'rdiscount' -gem "redcarpet" \ No newline at end of file +# Explicitly include this gem here. +# It is not directly included in the github-pages gem list of dependencies, +# even though it is included in the original GitHub Pages build infrastructure. +# gem "jekyll-include-cache", "= 0.2.1" +# gem "jekyll-octicons", "~> 14.2" +# gem "public_suffix", "~> 5.1.1" +# gem "jekyll-sass-converter", "~> 1.5.2" \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index c1741dff..00000000 --- a/Gemfile.lock +++ /dev/null @@ -1,157 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - addressable (2.8.7) - public_suffix (>= 2.0.2, < 7.0) - coffee-script (2.4.1) - coffee-script-source - execjs - coffee-script-source (1.12.2) - colorator (1.1.0) - commonmarker (0.23.11) - concurrent-ruby (1.3.4) - csv (3.3.1) - em-websocket (0.5.3) - eventmachine (>= 0.12.9) - http_parser.rb (~> 0) - eventmachine (1.2.7) - execjs (2.10.0) - faraday (2.12.2) - faraday-net_http (>= 2.0, < 3.5) - json - logger - faraday-net_http (3.4.0) - net-http (>= 0.5.0) - ffi (1.17.0-x64-mingw-ucrt) - forwardable-extended (2.6.0) - http_parser.rb (0.8.0) - i18n (1.14.6) - concurrent-ruby (~> 1.0) - jekyll (3.10.0) - addressable (~> 2.4) - colorator (~> 1.0) - csv (~> 3.0) - em-websocket (~> 0.5) - i18n (>= 0.7, < 2) - jekyll-sass-converter (~> 1.0) - jekyll-watch (~> 2.0) - kramdown (>= 1.17, < 3) - liquid (~> 4.0) - mercenary (~> 0.3.3) - pathutil (~> 0.9) - rouge (>= 1.7, < 4) - safe_yaml (~> 1.0) - webrick (>= 1.0) - jekyll-coffeescript (2.0.0) - coffee-script (~> 2.2) - coffee-script-source (~> 1.12) - jekyll-commonmark (1.4.0) - commonmarker (~> 0.22) - jekyll-commonmark-ghpages (0.5.1) - commonmarker (>= 0.23.7, < 1.1.0) - jekyll (>= 3.9, < 4.0) - jekyll-commonmark (~> 1.4.0) - rouge (>= 2.0, < 5.0) - jekyll-default-layout (0.1.5) - jekyll (>= 3.0, < 5.0) - jekyll-feed (0.17.0) - jekyll (>= 3.7, < 5.0) - jekyll-gist (1.5.0) - octokit (~> 4.2) - jekyll-github-metadata (2.16.1) - jekyll (>= 3.4, < 5.0) - octokit (>= 4, < 7, != 4.4.0) - jekyll-optional-front-matter (0.3.2) - jekyll (>= 3.0, < 5.0) - jekyll-paginate (1.1.0) - jekyll-readme-index (0.3.0) - jekyll (>= 3.0, < 5.0) - jekyll-relative-links (0.7.0) - jekyll (>= 3.3, < 5.0) - jekyll-sass-converter (1.5.2) - sass (~> 3.4) - jekyll-seo-tag (2.8.0) - jekyll (>= 3.8, < 5.0) - jekyll-sitemap (1.4.0) - jekyll (>= 3.7, < 5.0) - jekyll-titles-from-headings (0.5.3) - jekyll (>= 3.3, < 5.0) - jekyll-watch (2.2.1) - listen (~> 3.0) - json (2.9.0) - kramdown (2.5.1) - rexml (>= 3.3.9) - kramdown-parser-gfm (1.1.0) - kramdown (~> 2.0) - liquid (4.0.4) - listen (3.9.0) - rb-fsevent (~> 0.10, >= 0.10.3) - rb-inotify (~> 0.9, >= 0.9.10) - logger (1.6.3) - mercenary (0.3.6) - minima (2.5.2) - jekyll (>= 3.5, < 5.0) - jekyll-feed (~> 0.9) - jekyll-seo-tag (~> 2.1) - net-http (0.6.0) - uri - octokit (4.25.1) - faraday (>= 1, < 3) - sawyer (~> 0.9) - pathutil (0.16.2) - forwardable-extended (~> 2.6) - public_suffix (6.0.1) - rb-fsevent (0.11.2) - rb-inotify (0.11.1) - ffi (~> 1.0) - rdiscount (2.2.7.3) - redcarpet (3.6.0) - rexml (3.4.0) - rouge (3.30.0) - safe_yaml (1.0.5) - sass (3.7.4) - sass-listen (~> 4.0.0) - sass-listen (4.0.0) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - sawyer (0.9.2) - addressable (>= 2.3.5) - faraday (>= 0.17.3, < 3) - tzinfo (2.0.6) - concurrent-ruby (~> 1.0) - tzinfo-data (1.2024.2) - tzinfo (>= 1.0.0) - uri (1.0.2) - wdm (0.2.0) - webrick (1.9.1) - -PLATFORMS - x64-mingw-ucrt - -DEPENDENCIES - bundler (~> 2.5.23) - http_parser.rb (~> 0.6.0) - jekyll (~> 3.10.0) - jekyll-coffeescript - jekyll-commonmark-ghpages (~> 0.5.1) - jekyll-default-layout - jekyll-feed (~> 0.12) - jekyll-gist - jekyll-github-metadata - jekyll-optional-front-matter - jekyll-paginate - jekyll-readme-index - jekyll-relative-links - jekyll-seo-tag - jekyll-sitemap - jekyll-titles-from-headings - kramdown-parser-gfm - minima (~> 2.5) - rdiscount - redcarpet - tzinfo (>= 1, < 3) - tzinfo-data - wdm (~> 0.1) - -BUNDLED WITH - 2.5.23 diff --git a/_config.yml b/_config.yml index 130a4b32..3cec7dc3 100644 --- a/_config.yml +++ b/_config.yml @@ -37,7 +37,7 @@ commonmark: permalink: pretty readme_index: enabled: true - remove_originals: false + remove_originals: true with_frontmatter: false title: shlu's tool logo: favicon.ico diff --git a/_plugins/markdown_link_replacer.rb b/_plugins/markdown_link_replacer.rb index be98a188..4a3ec31e 100644 --- a/_plugins/markdown_link_replacer.rb +++ b/_plugins/markdown_link_replacer.rb @@ -3,10 +3,11 @@ module Jekyll class ReplaceStringConverter < Converter # 设置转换器优先级,确保在 Markdown 转换之前执行替换 - priority :low + # priority :low # 指定该转换器处理的文件扩展名 def matches(ext) + Jekyll.logger.debug "matches(ext): #{ext}" if ext != nil ext.downcase == '.md' || ext.downcase == '.markdown' end @@ -15,12 +16,14 @@ def matches(ext) # 保持文件扩展名不变 def output_ext(ext) + Jekyll.logger.debug "output_ext(ext): #{ext}" ext end # 执行字符串替换并调用默认的 Markdown 转换器 def convert(content) - + raise ThreadError + Jekyll.logger.debug "Converting:", "111111111111" # 定义需要替换的字符串对,支持字符串和正则表达式 replacements = [ # { pattern: /\[([^\]]+)\]\(([^)]+)\.md\)/, replacement: '[\1](\2)' }, diff --git "a/github/\345\260\206github\344\273\223\345\272\223\346\227\240\344\276\265\345\205\245\350\275\254\346\215\242\344\270\272github-pages.md" "b/github/\345\260\206github\344\273\223\345\272\223\346\227\240\344\276\265\345\205\245\350\275\254\346\215\242\344\270\272github-pages.md" index d553a0ae..d87c7f9a 100644 --- "a/github/\345\260\206github\344\273\223\345\272\223\346\227\240\344\276\265\345\205\245\350\275\254\346\215\242\344\270\272github-pages.md" +++ "b/github/\345\260\206github\344\273\223\345\272\223\346\227\240\344\276\265\345\205\245\350\275\254\346\215\242\344\270\272github-pages.md" @@ -154,8 +154,23 @@ jobs: 但现在有一个问题:readme.md里的.md后缀,不会替换成.html或空 -现在有两个方案: +问题探究: + +相关issue: [reason for blacklisting plugins?](https://github.com/github/pages-gem/issues/926) + +​ ^ TODO: 该issue下给出了一个绕过白名单限制的解决方案,后面有时间可以研究下 + +相关issue: [Links with titles not handled properly](https://github.com/github/pages-gem/issues/876) + +​ ^ 据该issue提示:问题出在jekyll-relative-links这个插件上,版本为0.6.1,但其已在[0.7.0](https://github.com/benbalter/jekyll-relative-links/releases/tag/v0.7.0)版本已修复,但官方一直不处理 + +经过分析提交记录,发现Pages-gem v229~v230已经更新到了0.7.0,但在v231又降回去了,commit: [pages-gem/commit/c29f89c3c](https://github.com/github/13c55cfc4aec49d58089a58c123e980) + +​ ^ 因此现在只要在action里指定该[Pages-gem v230](https://github.com/github/pages-gem/releases/tag/v230),也就是[Jekyll-build-pages v1.0.11](https://github.com/actions/jekyll-build-pages/releases/tag/v1.0.11)版本: + +```yaml +uses: actions/jekyll-build-pages@v1.0.11 +``` + -直接通过python脚本替换,然后再交给jekyll处理 -直接交由jekyll处理 \ No newline at end of file