Skip to content

Commit

Permalink
docs update
Browse files Browse the repository at this point in the history
  • Loading branch information
shlu committed Dec 15, 2024
1 parent ab8096f commit 99d480b
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 208 deletions.
110 changes: 65 additions & 45 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -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"
# 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"
157 changes: 0 additions & 157 deletions Gemfile.lock

This file was deleted.

2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions _plugins/markdown_link_replacer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)' },
Expand Down
21 changes: 18 additions & 3 deletions github/将github仓库无侵入转换为github-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
```
直接通过python脚本替换,然后再交给jekyll处理
直接交由jekyll处理

0 comments on commit 99d480b

Please sign in to comment.