東川印記

一本東川,笑看爭龍斗虎;寰茫兦者,度橫佰昧人生。

使用Jekyll搭建github pages

2022年4月12日星期二



之前用的yaml Travis 生成github pages,但是Travis竟然有免费次数。。。。

但之前的项目也不能改,github pages每个账号只能建一个 test.github.io这种格式的站,新起项目就只能是 test.github.io/project格式了。。。。

这样的话路线图就需要进行调整

zhongliangweiquan

     -> zhonliangweiquan主站

    -> zhongliangweiquan/zhongliang 项目介绍主站,挂zhongliang根域名

    -> zhongliangweiquan/xxx 其他从站

zhongliang   二级前缀必须跟用户名相同

    -> zhongliang主站,映射到 zhongliangweiquan/zhongliang项目

    ->zhongliang/weiquan 映射zhongliangweiquan主站,挂weiquan根域名

    ->zhongliang/xxx 其他挂接

也就是说,还是以 zhongliangweiquan账号为主,再搞一个 zhongliang跟他打配合。。。。

然后再分别对其项目目录挂接域名,应该就差不多了。。。。


根项目映射路径fork到不为空的path路径后,资源会失效,因为资源是从/绝对路径开始算的,这时候,给这个fork项目挂根域名,即可解决。

但挂了域名后,https就没了。。。。

这个问题在blogger的挂接上也遇到了。。。。

奇怪,过了俩小时,竟然自动开始颁发Let's Encrypt的SSL证书,https竟然好使了。。。。


以上部署方案就通了。。。。

环境搭建

原来默认环境有有一大批

SENRSL:zhongliang senrsl$ ruby -v
ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.x86_64-darwin21]
SENRSL:zhongliang senrsl$ gem -v
3.0.3.1
SENRSL:zhongliang senrsl$ gcc -v
2022-04-12 15:56:09.260 xcodebuild[47829:1317393] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2022-04-12 15:56:09.260 xcodebuild[47829:1317393] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
Apple clang version 13.1.6 (clang-1316.0.21.2)
Target: x86_64-apple-darwin21.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
SENRSL:zhongliang senrsl$ gem install jekyll

SENRSL:zhongliang senrsl$ sudo gem install jekyll


SENRSL:zhongliang senrsl$ jekyll -v
jekyll 4.2.2
SENRSL:zhongliang senrsl$ jekyll new aaa
Running bundle install in /Users/senrsl/temp/zhongliang/aaa...


Your user account isn't allowed to install to the system RubyGems.
  You can cancel this installation and run:

      bundle install --path vendor/bundle

  to install the gems into ./vendor/bundle/, or you can enter your password
  and install the bundled gems to RubyGems using sudo.

  Password:


Your user account isn't allowed to install to the system RubyGems.
  You can cancel this installation and run:

      bundle install --path vendor/bundle

  to install the gems into ./vendor/bundle/, or you can enter your password
  and install the bundled gems to RubyGems using sudo.

  Password:

  Bundler: The dependency tzinfo (~> 1.2) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x64-mingw32, x86-mswin32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x64-mingw32 x86-mswin32 java`.
  Bundler: The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x64-mingw32, x86-mswin32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x64-mingw32 x86-mswin32 java`.
  Bundler: The dependency wdm (~> 0.1.1) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x64-mingw32, x86-mswin32. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x64-mingw32 x86-mswin32`.
  Bundler: The dependency http_parser.rb (~> 0.6.0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for java. To add those platforms to the bundle, run `bundle lock --add-platform java`.
  Bundler: Fetching gem metadata from https://rubygems.org/.................
  Bundler: Fetching gem metadata from https://rubygems.org/..
  Bundler: Resolving dependencies...
  Bundler: Following files may not be writable, so sudo is needed:
  Bundler: /Library/Ruby/Gems/2.6.0
  Bundler: /Library/Ruby/Gems/2.6.0/build_info
  Bundler: /Library/Ruby/Gems/2.6.0/cache
  Bundler: /Library/Ruby/Gems/2.6.0/doc
  Bundler: /Library/Ruby/Gems/2.6.0/extensions
  Bundler: /Library/Ruby/Gems/2.6.0/gems
  Bundler: /Library/Ruby/Gems/2.6.0/specifications
  Bundler: Fetching public_suffix 4.0.7
  Bundler: Installing public_suffix 4.0.7
  Bundler: Using addressable 2.8.0
  Bundler: Using bundler 1.17.2
  Bundler: Using colorator 1.1.0
  Bundler: Fetching concurrent-ruby 1.1.10
  Bundler: Installing concurrent-ruby 1.1.10
  Bundler: Using eventmachine 1.2.7
  Bundler: Using http_parser.rb 0.8.0
  Bundler: Using em-websocket 0.5.3
  Bundler: Fetching ffi 1.15.5
  Bundler: Installing ffi 1.15.5 with native extensions
  Bundler: Using forwardable-extended 2.6.0
  Bundler: Fetching i18n 1.10.0
  Bundler: Installing i18n 1.10.0
  Bundler: Using sassc 2.4.0
  Bundler: Using jekyll-sass-converter 2.2.0
  Bundler: Using rb-fsevent 0.11.1
  Bundler: Using rb-inotify 0.10.1
  Bundler: Using listen 3.7.1
  Bundler: Using jekyll-watch 2.2.1
  Bundler: Using rexml 3.2.5
  Bundler: Using kramdown 2.3.2
  Bundler: Using kramdown-parser-gfm 1.1.0
  Bundler: Using liquid 4.0.3
  Bundler: Using mercenary 0.4.0
  Bundler: Using pathutil 0.16.2
  Bundler: Using rouge 3.28.0
  Bundler: Using safe_yaml 1.0.5
  Bundler: Using unicode-display_width 1.8.0
  Bundler: Using terminal-table 2.0.0
  Bundler: Using jekyll 4.2.2
  Bundler: Fetching jekyll-feed 0.16.0
  Bundler: Installing jekyll-feed 0.16.0
  Bundler: Fetching jekyll-seo-tag 2.8.0
  Bundler: Installing jekyll-seo-tag 2.8.0
  Bundler: Fetching minima 2.5.1
  Bundler: Installing minima 2.5.1
  Bundler: Bundle complete! 7 Gemfile dependencies, 31 gems now installed.
  Bundler: Use `bundle info [gemname]` to see where a bundled gem is installed.
New jekyll site installed in /Users/senrsl/temp/zhongliang/aaa.
SENRSL:zhongliang senrsl$
SENRSL:zhongliang senrsl$ cd aaa/
SENRSL:aaa senrsl$ jekyll server
Configuration file: /Users/senrsl/temp/zhongliang/aaa/_config.yml
            Source: /Users/senrsl/temp/zhongliang/aaa
       Destination: /Users/senrsl/temp/zhongliang/aaa/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
       Jekyll Feed: Generating feed for posts
                    done in 0.299 seconds.
 Auto-regeneration: enabled for '/Users/senrsl/temp/zhongliang/aaa'
    Server address: http://127.0.0.1:4000/
  Server running... press ctrl-c to stop.
SENRSL:aaa senrsl$

目录结构跟hexo大体相同,但是为啥markdown跟html是混着的。。。。

有些模板,需要安bundler来更新

SENRSL:LatexJekyll senrsl$ sudo gem install jekyll bundler

SENRSL:LatexJekyll senrsl$ bundle update

SENRSL:LatexJekyll senrsl$ jekyll server

如果要安装插件,需要修改 Gemfile文件和_config.yml文件,里面都要加新安的插件。。。。

比之前的 hexo Travis组合难用啊。。。。


--
senRsl
2022年04月12日14:15:54

没有评论 :

发表评论