resources/views/layout.html

このサイトを動かすコードです。どのファイルから読めばよいかは第14章の読み順で確認できます。

<!doctype html>
<html lang="ja">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{{if .Title}}{{.Title}} | {{end}}LaravelGO解体新書</title>
    <meta name="description" content="GoとLaravelが初めての人向けの日本語解説書。HTTPの基本から、Laravel Go v0.2.0で動くこのサイトの実装まで。">
    <link rel="stylesheet" href="/book.css">
</head>
<body>
    <a class="skip" href="#main">本文へ</a>
    <header class="site-header">
        <div class="wrap header-inner">
            <a class="brand" href="/"{{if eq .Current "home"}} aria-current="page"{{end}}>
                <span class="brand-mark" aria-hidden="true">Lg</span>
                LaravelGO解体新書
            </a>
            <nav class="main-nav" aria-label="サイト内">
                <a href="/chapters"{{if eq .Current "index"}} aria-current="page"{{end}}>全章の目次</a>
                <a href="/glossary"{{if eq .Current "glossary"}} aria-current="page"{{end}}>用語集</a>
                <a href="/lab"{{if eq .Current "lab"}} aria-current="page"{{end}}>演習</a>
            </nav>
            <nav class="session-nav" aria-label="アカウント">
                {{with user}}
                <a href="/account/password">パスワード</a>
                {{if not .MustChangePassword}}
                <a href="/progress"{{if eq $.Current "progress"}} aria-current="page"{{end}}>学習進捗</a>
                {{if eq .Role "admin"}}<a href="/admin/accounts">管理</a>{{end}}
                {{end}}
                <form method="post" action="/logout">{{csrfField}}<button type="submit">ログアウト</button></form>
                {{else}}
                <a href="/login">ログイン</a>
                {{end}}
            </nav>
        </div>
    </header>
    <main id="main">
        {{block "content" .}}{{end}}
    </main>
    <footer class="site-footer">
        <div class="wrap footer-inner">
            <p>LaravelGO解体新書 · Laravel Go v0.2.0 対応の独立した学習サイト</p>
            <p><a href="https://laravel.com/go/docs/installation">公式ガイド</a> · <a href="https://github.com/laravel/go-framework/tree/v0.2.0">フレームワークのソース</a></p>
        </div>
    </footer>
</body>
</html>