Skip to content

Commit

Permalink
test(jekyll): 001
Browse files Browse the repository at this point in the history
  • Loading branch information
shlu committed Dec 15, 2024
1 parent 2a41298 commit a70d0b0
Show file tree
Hide file tree
Showing 7 changed files with 258 additions and 8 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
.DS_Store
**/.DS_Store
**/.DS_Store
_site/
.idea/
jekyll_tmp/
.jekyll-cache/
52 changes: 52 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
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]

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"
157 changes: 157 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
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
23 changes: 18 additions & 5 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,30 @@ plugins:
- jekyll-seo-tag
- jekyll-feed
- jekyll-readme-index
- jekyll-github-metadata
- jekyll-coffeescript
- jekyll-commonmark-ghpages
- jekyll-gist
- jekyll-paginate
- jekyll-optional-front-matter
- jekyll-default-layout
- jekyll-titles-from-headings
# - markdown_link_replacer
exclude:
- jekyll_tmp
relative_links:
enabled: true
collections: true
#markdown: CommonMarkGhPages # GFM
#markdown: kramdown
markdown: CommonMarkGhPages # GFM
#highlighter: rouge
#markdown: redcarpet #rdiscount, kramdown, redcarpet, CommonMarkGhPages, CommonMark
#kramdown:
# input: GFM # 启用 GitHub Flavored Markdown
# syntax_highlighter: rouge # 使用 Rouge 作为代码高亮器
# # 其他配置选项,根据需要调整
markdown: redcarpet
redcarpet:
extensions: ["autolink", "no_intra_emphasis", "tables", "strikethrough"]
#markdown: redcarpet
#redcarpet:
# extensions: ["autolink", "no_intra_emphasis", "tables", "strikethrough"]

readme_index:
enabled: true
Expand All @@ -45,3 +56,5 @@ show_downloads: false
# google_analytics: [Your Google Analytics tracking ID]

url: "https://jitcor.github.io/tool/"

show_warnings: true
9 changes: 7 additions & 2 deletions _plugins/markdown_link_replacer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ class ReplaceStringConverter < Converter

# 指定该转换器处理的文件扩展名
def matches(ext)
ext.downcase == '.md' || ext.downcase == '.markdown'
if ext != nil
ext.downcase == '.md' || ext.downcase == '.markdown'
end
false
end

# 保持文件扩展名不变
Expand All @@ -17,9 +20,11 @@ def output_ext(ext)

# 执行字符串替换并调用默认的 Markdown 转换器
def convert(content)

# 定义需要替换的字符串对,支持字符串和正则表达式
replacements = [
{ pattern: /\[([^\]]+)\]\(([^)]+)\.md\)/, replacement: '[\1](\2)' },
# { pattern: /\[([^\]]+)\]\(([^)]+)\.md\)/, replacement: '[\1](\2)' },
# { pattern: /\[([^\]]+)\]\(([^)]+)\.md\)/, replacement: '[\1](\2)' },
# { pattern: /旧字符串\d+/, replacement: '通用新字符串' }, # 使用正则表达式匹配“旧字符串”后跟一个或多个数字
# 继续添加更多的替换规则
]
Expand Down
17 changes: 17 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Welcome to MkDocs

For full documentation visit [mkdocs.org](https://www.mkdocs.org).

## Commands

* `mkdocs new [dir-name]` - Create a new project.
* `mkdocs serve` - Start the live-reloading docs server.
* `mkdocs build` - Build the documentation site.
* `mkdocs -h` - Print help message and exit.

## Project layout

mkdocs.yml # The configuration file.
docs/
index.md # The documentation homepage.
... # Other markdown pages, images and other files.
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
site_name: shlu's tool

0 comments on commit a70d0b0

Please sign in to comment.