Skip to content

Instantly share code, notes, and snippets.

@skoji
Created March 4, 2026 06:52
Show Gist options
  • Select an option

  • Save skoji/cb719b785c4e526515319ca639b7052c to your computer and use it in GitHub Desktop.

Select an option

Save skoji/cb719b785c4e526515319ca639b7052c to your computer and use it in GitHub Desktop.

オレオレstatic site generator初期版計画

Ruby実装。

最初の要素。

  • template (erb)
  • markdownからの変換(エンジンはkramdown)
  • 最初からtiltを使う

index.md

---
layout: default
title: トップページ
---
トップページです。

_layouts/page.html

---
layout: none
---
<html lang="site.lang">
<head>
<meta charset="utf-8">
<title><%= page.title %></title>
</head>
<h1><%= page.title %></h1>
<body>
<%= page.content %>
</body>
</html>

これを処理すると、site/index.htmlが生成される。

ルール:

  • md/htmlなどは基本処理される。
  • frontmatterはまずはかならずつける。つけないとエラーになるかも。
  • _includeもすぐに欲しくなる、かもしれない
  • blog系機能は後回し
  • 各ファイルで、htmlではないものはerbしてからhtml変換にかけられる。
  • siteの設定は_config.yamlにある。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment