single almost over

This commit is contained in:
wangbudui 2020-01-06 21:22:31 +08:00
parent eee76ebb5f
commit b6bd7ece4d
5 changed files with 57 additions and 24 deletions

View File

@ -3,9 +3,9 @@ languageCode = "en-us"
title = "My New Hugo Site" title = "My New Hugo Site"
theme = "hugo-w2ng" theme = "hugo-w2ng"
pygmentsStyle="github" pygmentsStyle="github"
[params] [params]
Footer = "© 2019 王不对 - **[CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/)** - **[RSS](/index.xml)**" Footer = "© 2019 王不对 - **[CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/)** - **[RSS](/index.xml)**"
AuthorName = "王不对"
[[menu.main]] [[menu.main]]
name = "博客" name = "博客"

View File

@ -23,7 +23,7 @@
.markdown h2, .markdown h2,
.markdown h3, .markdown h3,
.markdown h4 { .markdown h4 {
@apply font-bold leading-loose; @apply leading-loose;
} }
.markdown blockquote { .markdown blockquote {
@apply bg-gray-100 p-3 mx-3 my-2 border-l-4 border-gray-400; @apply bg-gray-100 p-3 mx-3 my-2 border-l-4 border-gray-400;
@ -50,7 +50,7 @@
@apply bg-gray-200; @apply bg-gray-200;
} }
.markdown pre code { .markdown pre code {
@apply bg-transparent; @apply bg-transparent font-mono;
} }
.markdown ul { .markdown ul {
@apply text-base pl-8 list-disc; @apply text-base pl-8 list-disc;

View File

@ -3,7 +3,7 @@
{{- partial "head.html" . -}} {{- partial "head.html" . -}}
<body class=""> <body class="">
<div class="flex flex-wrap flex-col md:flex-row md:w-4/5 mx-auto py-5 min-h-screen"> <div class="flex flex-col md:flex-row md:w-4/5 mx-auto py-5 min-h-screen">
{{- partial "header.html" . -}} {{- partial "header.html" . -}}
<main class="flex-1 p-4 md:border-l-2 md:border-black"> <main class="flex-1 p-4 md:border-l-2 md:border-black">
{{- block "main" . }}{{- end }} {{- block "main" . }}{{- end }}

View File

@ -1,6 +1,45 @@
{{ define "main" }} {{ define "main" }}
<article class="flex-shrink max-w-3xl mx-auto leading-relaxed markdown"> <article itemscope itemtype="http://schema.org/Article" class="max-w-3xl mx-auto leading-relaxed">
<h1 class="text-center">{{ .Title }}</h1> {{ if .IsPage }}
{{ .Content }} <section class="flex flex-col meta">
<h1 class="text-center text-4xl my-8 md:my-12">{{ .Title }}</h1>
{{ if not .Params.disableMeta }}
<h3 class="text-center text-2xl">
{{ with $.Site.Params.AuthorName }}
<span itemprop="author" itemscope itemtype="http://schema.org/Person">
<span itemprop="name">{{ . }}</span>
{{ end }}
{{ if .Params.date }}
{{ if $.Site.Params.AuthorName }} / {{ end }}
<span itemprop="datePublished"
content="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "2006-01-02" }}</span>
{{ end }}
</h3>
<h3 class="md:order-first text-xl text-right mt-4 md:mt-0">
{{ with .Params.categories }}
<span itemprop="articleSection" class="category">
{{ range . }}
<a href="{{ . | printf "categories/%s" | relURL }}" rel="category">{{ . }}</a>
{{ end }}
</span>
{{ end }}
{{ if .Params.categories }} / {{ end }}
{{ with .Params.tags }}
<span itemprop="keywords" class="tags text-base font-mono">
{{ range . }}
<a href="{{ . | printf "tags/%s" | relURL }}" class="m-1" rel="tag">#{{ . }}</a>
{{ end }}
</span>
{{ end }}
</h3>
{{ end }}
</section>
{{ end }}
{{ if not .IsHome }}
<hr class="block my-10 mx-auto max-w-xs h-px border-t border-black">
{{ end }}
<section itemprop="articleBody" class="content markdown">
{{ .Content }}
</section>
</article> </article>
{{ end }} {{ end }}

View File

@ -1,28 +1,22 @@
<header class="flex flex-col w-full md:w-1/5 md:text-right md:pr-8 bg-white text-center"> <header class="flex flex-col relative border-black border-b-4 md:border-none pb-6 mx-4 md:mx-0 md:w-1/5 md:text-right md:pr-8 bg-white md:text-center">
<h1 class="text-4xl my-6 md:my-12 font-medium mt-4 md:mb-12"><a href="#">Wrong.Wang</a></h1> <div class="">
<p class="font-thin italic">前进</p> <h1 class="text-4xl md:my-12 mt-4 md:mb-12"><a href="#">Wrong.Wang</a></h1>
<!-- <input type="checkbox" class="hidden" id="expand-toggle" /> <p class="font-thin italic">前进</p>
<div class="block absolute right-0 md:hidden"> </div>
<label for="expand-toggle" id="expand-btn" class="flex items-center px-3 py-2 border rounded"> <input id="menu-check" type="checkbox" class="hidden" />
<svg class="h-3 w-3" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> <label id="menu-label" for="menu-check"
<title>Menu</title> class="absolute right-0 text-right md:hidden inline-block py-4 h-12 cursor-pointer mt-10 text-xl text-gray-900">
<path d="M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z" />
</svg>
</label>
</div> -->
<input id="menu-check" type="checkbox" class="hidden"/>
<label id="menu-label" for="menu-check" class="unselectable md:hidden inline-block py-4 h-12 cursor-pointer mt-3 text-xl text-gray-900">
<span class="icon close-icon"></span> <span class="icon close-icon"></span>
<span class="icon open-icon"></span> <span class="icon open-icon"></span>
<span class="text">MENU</span> <span class="text">MENU</span>
</label> </label>
<nav id="menu" class="my-2 md:flex-row-reverse hidden md:block"> <nav id="menu" class="my-2 w-full md:flex-row-reverse hidden md:block">
<ul class="list-none pl-0 mx-auto justify-center max-w-xs"> <ul class="list-none pl-0 mx-auto justify-center max-w-xs">
{{ range .Site.Menus.main }} {{ range .Site.Menus.main }}
<li class="my-4 border-black border-b-2 md:border-none pb-1"> <li class="my-4 border-black text-center md:text-right border-b-2 md:border-none pb-1">
<a class="py-4 md:border-black md:border-b-2 md:pb-1" href="{{ .URL }}">{{ .Name }}</a> <a class="py-4 md:border-black md:border-b-2 md:pb-1" href="{{ .URL }}">{{ .Name }}</a>
</li> </li>
{{ end }} {{ end }}
</ul> </ul>
</nav> </nav>
</header> </header>