LoginSignup
7
3

Elixirのhtml.eexをHTMLに変更してGitHub Pagesにコンバートする

Last updated at Posted at 2023-05-28

概要

やっている事は、Elixirの
xxx.html.eexファイルをHTML化して、GitHubPagesに合わせている。

手順

GitHubPagesのリポジトリを作成する。

//make new repository
<username>.github.io

・GitHub用のフォルダを作成
・narkkilさんのgblexをGitでクローン
・gblexのディレクトリに移動

mkdir GitHub
cd GitHub

git clone https://github.com/narck/gblex
cd gblex

config/config.exs を修正
Github ユーザー名とブログのタイトルを設定します。

config/config.exs
# Uncomment and configure these before starting with your blog!
- #config :gblex, github_username: "foo"
- #config :gblex, blog_title: "Foo's blog"

+ config :gblex, github_username: "frick-eldy" # 小文字
+ config :gblex, blog_title: "FRICK's blog"

・依存関係を取得

mix deps.get

・gblex初期化

mix gblex.init

・新規記事を作成
gblex/entriesに"#{date}-#{name}.md"ファイルが作成される。

mix gblex.new "name"

・パブリッシュ
username.github.io フォルダが生成され、
lib/templates/template.html.eexがHTML化する。

mix gblex.publish

username.github.io フォルダをGitにPushする。

username.github.ioディレクトリに移動
Gitは設定されてあるので、masterにpush

cd <username>.github.io
git push -u origin master

公開される
https://frick-eldy.github.io/

7
3
6

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
3