Noriyo Akita's Today I Learned

# 2024-09-18

Table of Contents

2024-09-18

やっぱり docs 内の記事をルートに持ってこようかなあ

気になる

_config.yml とか生成される _site はルートにある。ローカル用の Gemfile もルートにある

なのにカスタム assets や index になっている README.md などは docs にある

Terminal window
ls
2024-09 ProTypeScript_MySampleCode _config.yml get_file_info.sh template.sh
CopilotSample README.md _site get_git_file_info.sh tmp
CopilotSample.zip Rails arrow_functions.js js-closure.js
Gemfile Ruby change-method-to-field.js monthly-posts.sh
Gemfile.lock TypeScript docs prepend-front-matter.sh
ls docs
2024-05 2024-09-15.md convert_to_tasklist.rb
2024-06 2024-09-16.md layered-design-for-ruby-on-rails-application.md
2024-07 README.md params.txt
2024-08 _config.yml upcase_converter.upcase
2024-09-01.md _plugins
2024-09-12-findy-stuff-engineer-path.md assets
  • config から source docs や destination _site などを辞める
    • コマンドラインでも指定しない
  • docs から少しだけマークダウンファイルを移してみる
    • それらだけがサイトに表示されていればよさそう?
  • html に変換したくないものはディレクトリに移して exclude option に指定しておけばいいかな
    • code_samples などを作る
    • projects に移した

ファイルを移したり余計なファイルを消したりまではよかったが。。。アセットパスが正しいほうを向かなかったりした
試行錯誤の末、以下に落ち着いた。疲れた…

baseurl を /til にするとか。ブランチというかリポジトリをデプロイしているので noriyotcp.github.io/til になるので

あとは _layouts/default.html を作ったがその中でのリンクの分岐とか…本番用とローカル用
本番ではよしなに /til/ をつけてくれるのだがローカルではそうでないので /til/assets/css/style.css というふうにしなきゃいけなかった
baseurl を /til にしたにもかかわらず、それを考慮せずに / からパスを見ようとする

https://github.com/noriyotcp/til/compare/ba6c2008d6c0c8fed2c5b1225223f0693de9253b…HEAD

My avatar

Thanks for reading my blog post! Feel free to check out my other posts or contact me via the social links in the footer.


More Posts