breaking change in configuration

This commit is contained in:
Mivinci 2022-11-08 23:10:57 +08:00
parent f1b32bd47e
commit 0ca65fbca5
20 changed files with 373 additions and 361 deletions

View file

@ -9,6 +9,10 @@ $heading: (h1, 2.25, 800), (h2, 2, 700), (h3, 1.75, 600), (h4, 1.5, 600),
} }
} }
.md p {
margin: .75rem 0;
}
.md pre { .md pre {
font-size: 13px; font-size: 13px;
line-height: 1.3; line-height: 1.3;

View file

@ -1,57 +0,0 @@
const dom = document.getElementById('friends')
const topk = '{{.Site.Params.friends.topk}}'
const raw = '{{.Site.Params.friends.feeds}}'
const feeds = raw.replace(/^\[|\]$/g, '').split(' ')
feeds.forEach(v => fetch(v).then(r => r.text()).then(r => rss(r)))
/**
* @param {string} xml
*/
function rss(xml) {
xml = xml.trim().replace(/\n/g, '')
const g = xml.matchAll(/<(item|entry)>.*?<\/(item|entry)>/g)
let n = +topk || 2;
while (n) {
const next = g.next()
if (next.done) {
break
}
// title
const title = next.value[0].match(/(?<=<title>).*(?=<\/title>)/)[0]
// link
const link = next.value[0].match(/(?<=<(link|id)>).*(?=<\/(link|id)>)/)[0]
// date
const date = next.value[0].match(/(?<=<(pubDate|updated)>).*(?=<\/(pubDate|updated)>)/)[0]
// innsert dom
const div = document.createElement('div')
div.className = 'flex justify-between'
div.innerHTML = template(link, title, date)
dom.appendChild(div)
n--;
}
}
/**
* @param {string} date
*/
function format(date) {
const d = new Date(date)
return d.toDateString()
}
function template() {
const a = arguments
return `
<a href=${a[0]}>${a[1]}</a>
<div>${format(a[2])}</div>
`.trim()
}

View file

@ -1,4 +1,3 @@
import "./theme"; import "./theme";
import "./style"; import "./style";
import "./selectable"; import "./selectable";
import "./friends";

View file

@ -1,9 +1,11 @@
// fix style of checkboxes in posts. // fix style of checked/unchecked list items
document.querySelectorAll('.md ul').forEach(v => { document.querySelectorAll('.md ul').forEach(v => {
if (/<li><input .+>.+<\/li>/.test(v.innerHTML)) { if (/<li><input .+>.+<\/li>/.test(v.innerHTML)) {
console.log(v);
v.classList.add('ul-checkbox'); v.classList.add('ul-checkbox');
} }
}); });
// // use custom font family // // use custom font family
// document.querySelector('body').style.setProperty('--global-font-family', '{{ .Site.Params.globalFontFamily }}'); // document.querySelector('body').style.setProperty('--global-font-family', '{{ .Site.Params.globalFontFamily }}');

View file

@ -1,157 +0,0 @@
baseURL = "https://mivinci.github.io/hugo-theme-minima"
languageCode = "en-us"
title = "Hi Folks"
copyright = "© 2022 Mivinci"
googleAnalytics = ""
# paginate decides the number of the newest posts
# that'll be shown on the home page.
paginate = 12
# theme is the name of the hugo theme you're gonna use,
# `hugo-theme-minima` is put here only for debuging,
# just name it what's under your theme directory.
theme = "hugo-theme-minima"
# Author has some of your information to be shown on the home page.
[author]
name = "Mivinci"
slogon = "Living on Earth 🌍"
description = "This is Minima, a clean and minimal Hugo theme porting from [Hexo Minima](https://github.com/adisaktijrs/hexo-theme-minima). It has supported multiple color themes, math formulas, flowcharts, syntax highlighting, and of course taxonomies like categories, tags, and series."
[params]
# iam is the beginning words of your self-introduction.
iam = "I am"
# The subtitle will be shown after the title of your blog site.
# e.g. "title - subtitle".
subtitle = ""
# Comment decides the comment plugin to be used on your blog site,
# e.g. disqus, utterances, ovo.
comment = "utterances"
# Timeformat, no matter what format to use, make it the second day of Jan. 2006
timeformat = "Jan 02, 2006"
# switch for turning on/off lights.
switch = ["🌚", "🌝"]
# default theme. e.g. light, dark, system
defaultTheme = "system"
# If set true, date of posts will be shown in the homepage.
displayDate = true
#
displayDescription = true
# If set true, users can select text from your post.
selectable = true
# If set true, all your posts will use the chosen comment plugin
# except those with a `comment: false` specified in their front-matter
commentOnAllPosts = true
recent = "Recent Posts"
older = "Older Posts"
# Disqus configuration
[params.disqus]
shortname = "hugo-minima"
# Utterances configuration
# Full doc's at https://utteranc.es
# **notice**: if you're going to use utterances, you must change the
# `repo` to your own repo address that stores comments on your site
[params.utterances]
repo = "mivinci/hugo-theme-minima"
issueTerm = "pathname"
label = "comment"
# **deprecated**
# OvO is a comment plugin written by the author of Minima.
# It is enabled when params.comment is set "ovo". You can
# have a live view on https://ovo.js.org. If you are using
# disqus or utterance, just ignore this.
[params.ovo]
server = ""
placeholder = ""
# Params.social is an array containing your social network accounts,
# Each has a lowercase name, a svg formatted icon and a url to the
# webpage of your account. They will be shown at the bottom of every
# page of your blog.
# Be sure the svgs you use must have both its width and its height
# set 18. If you don't wanna put the svg code in this config file,
# since they are too long, you can instead save them to the
# `data/svg.toml` file under the root directory of your blog.
# in that file, each line must be formatted as `name = '<svg>'`
# where `<svg>` is the svg code.
[[params.social]]
name = "twitter"
url = "https://twitter.com/realmivinci"
svg = ""
[[params.social]]
name = "email"
url = "mailto:mivinci@qq.com"
svg = ""
[[params.social]]
name = "github"
url = "https://github.com/mivinci/hugo-theme-minima"
svg = ""
[[params.social]]
name = "rss"
url = "/index.xml"
svg = ""
# If set, titles and links of the topk newest posts extracted from
# the feeds will be displayed in the home page. Note that the feeds
# providers have to make their 'Access-Control-Allow-Origin' contain
# your domain, otherwise the feeds cannot be fetched.
[params.friends]
feeds = []
topk = 3
title = "Friends' Posts"
proxy = "" # reserved
# Menu.main is an array that's used to decide what entries can be shown
# on the navigator of yur blog. You can use a weight to make them ordered.
[[menu.main]]
name = "Home"
url = "/"
weight = 1
[[menu.main]]
name = "Tags"
url = "/tags"
weight = 2
[[menu.main]]
name = "Series"
url = "/series"
weight = 3
[[menu.main]]
name = "About"
url = "/about"
weight = 4
# You can classify your posts by setting taxanomies in the front matter
# e.g.
# categories = ["dev"]
# series = ["Building an RPC server"]
# tags = ["hugo", "golang"]
# A little suggestion: one post belongs to one series or one category or multiple tags.
[taxonomies]
category = "categories"
tag = "tags"
series = "series"
# Fields below make sure all the codes in a post are
# highlighted correctly, so better not edit them.
[markup.highlight]
lineNos = true
noClasses = false
defaultContentLanguage = "en"
[languages.en]
languageName = "EN"
weight = 1
[languages.zh]
languageName = "ZH"
weight = 2

125
exampleSite/config.yaml Normal file
View file

@ -0,0 +1,125 @@
baseURL: https://mivinci.github.io/hugo-theme-minima
languageCode: en-us
title: Hugo on Minima
copyright: © 2022 Mivinci
googleAnalytics:
# paginate specifies the maximum number of posts displayed on the home page.
paginate: 12
# theme specifies the name of the theme to be used.
theme: hugo-theme-minima
# defaultContentLanguage specifies the default language to use.
defaultContentLanguage: en
# language.x setup
languages:
en:
languageName: EN
weight: 1
zh-cn:
languageName: ZH
weight: 2
author:
status: 目前住在地球 🌍
description: |
这是 Minima, 一个简洁的 Hugo 主题,移植自 [Hexo Minima](https://github.com/adisaktijrs/hexo-theme-minima)。
支持深色模式、多语言、数学公式、流程图、代码语法高亮,当然还有分类、标签、系列等等。
params:
greet: 你好 :)
# author specifies your name, a slogon and your brief self-introduction.
author:
name: Mivinci
status: Am currently living on Earth 🌍
description: |
This is Minima, a clean and minimal Hugo theme porting from
[Hexo Minima](https://github.com/adisaktijrs/hexo-theme-minima). It has supports
for dark mode, multilingual mode, math formulas, flowcharts, syntax highlighting,
and of course taxonomies like categories, tags, and series.
params:
# greet specifies greeting words.
greet: Hello :)
# subtitle speficies a subtitle displayed right after the site title.
subtitle:
# comment specifies which comment plugin to be used.
# currently available ones: disqus, utterances, giscus.
comment: utterances
# switch specifies two emojis to be used as the button toggling color themes.
switch: ["🌚", "🌝"]
# defaultTheme specifies a default theme to be used.
# currently available options: light, dark, system.
defaultTheme: system
# displayDate speficies whether or not to display post date on the home page.
displayDate: true
# displayDescription specifies whether or not to display post description on
# the hoem page.
displayDescription: true
# selectable specifies if your post content can be selected.
selectable: true
# commentOnAllPosts specifies if the chosen comment plugin to be enabled on all
# post pages. If enabled, those you don't want a comment plugin to work on just
# set `comment` to false in their front matters.
commentOnAllPosts: true
# disqus specifies the configuration for Disqus.
disqus:
shortname: hugo-minima
# utterances specifies the configuration for Utterances.
# What is Utterances? Check this out: https://utteranc.es
utterances:
repo: "mivinci/hugo-theme-minima"
issueTerm: "pathname"
label: "comment"
# **DEPRECATED**
# ovo(https://ovo.js.org) is a comment plugin written by the author of Minima but
# is now deprecated out of security issues.
ovo:
server: ""
placeholder: ""
# social is an array containing as many as social accounts to be displayed
# in the buttom of every page.
social:
- name: "twitter"
url: "https://twitter.com/realmivinci"
- name: "email"
url: "mailto:mivinci@qq.com"
- name: "github"
url: "https://github.com/mivinci/hugo-theme-minima"
- name: "rss"
url: "/index.xml"
# menu.main is an array containing what is used as the navigator.
menu:
main:
- identifier: home
name: "Home"
url: "/"
weight: 1
- identifier: tags
name: "Tags"
url: "/tags"
weight: 2
- identifier: series
name: "Series"
url: "/series"
weight: 3
- identifier: about
name: "About"
url: "/about"
weight: 4
# taxonomies defines ways to classify yout posts. Below are some presets that
# most bloggers use, so you can replace them with whatever you like.
taxonomies:
category: categories
tag: tags
series: series
# markup.highlight has two keys set to make sure that the syntax highlighting
# in your posts are rendered correctly, so do not edit them.
markup:
highlight:
lineNos: true
noClasses: false

View file

@ -1,70 +0,0 @@
---
author: Mivinci
title: Instruction
date: 2021-07-19T10:52:59+08:00
description: A Clean and minimal Hugo theme porting from the [Hexo Minima](https://github.com/adisaktijrs/hexo-theme-minima). [Click me](https://h.xjj.pub/) to take a look.
tags:
- Hugo
- Minima
math: true
comment: true
---
> The main branch is in development stage, UI or configurations may vary. You can use the latest stable version [here](https://github.com/Mivinci/hugo-theme-minima/releases/tag/v1.1.0).
## Features
- [x] Clean
- [x] Light/dark mode
- [x] VSCode-style code hightlighting (the most alike among all Hugo themes)
- [x] KaTeX
- [x] Mermaid diagrams
- [x] Google analytics
- [x] Disqus/Utterances
- [x] Optional ToC
## Usage
Before using Minima, make sure you've got Hugo (extended version) installed on your device.
### Installation
Suppose `blog` is where you place your sources.
```bash
cd blog
git init
git submodule add --depth 1 https://github.com/mivinci/hugo-theme-minima.git themes/minima
```
Or `clone` directly if you don't wanna use the Git submodule.
```bash
git clone https://github.com/mivinci/hugo-theme-minima.git themes/minima
```
Anyways, you just need to put Minima under the `blog/themes` directory.
### Configuration
Follow [exampleSite/config.toml](https://github.com/Mivinci/hugo-theme-minima/blob/main/exampleSite/config.toml) and edit your own `blog/config.toml` file.
### Supported Front Matters
| Field | Type | Explanation |
|:----------- |:------ |:------------------------------------------------------ |
| title | string | Title of the post |
| description | string | Description of the post |
| date | string | Datetime when the post is written |
| categories | array | Array of categories the posts belongs to |
| series | array | Array of series the post belongs to |
| tags | array | Array of tags the posts is related to |
| math | bool | True if the post needs to render math formulas |
| mermaid | bool | True if the post needs to render mermaid diagrams |
| comment | bool | True if the post allows people to make comments |
| draft | bool | True if the post isn't already for publishing |
| toc | bool | True if the post needs a ToC |
### Feedback
Feedbacks are welcome [here](https://github.com/Mivinci/hugo-theme-minima/issues).

View file

@ -1,10 +0,0 @@
---
author: Hugo Authors
title: 使用说明
date: 2021-07-19T10:52:59+08:00
description:
math: true
comment: true
---
你好

View file

@ -1,7 +1,7 @@
--- ---
author: XJJ author: Mivinci
title: External Link Post title: An External Link
date: 2021-07-17T10:52:59+08:00 date: 2021-07-17T10:52:59+08:00
description: description: This is a link to an external resource.
link: https://gohugo.io link: https://gohugo.io
--- ---

View file

@ -3,7 +3,8 @@ author: "Hugo Authors"
title: "Markdown Syntax Guide" title: "Markdown Syntax Guide"
date: "2021-07-18T10:52:59+08:00" date: "2021-07-18T10:52:59+08:00"
description: "Sample article showcasing basic Markdown syntax and formatting for HTML elements." description: "Sample article showcasing basic Markdown syntax and formatting for HTML elements."
categories: ["Markdown"] categories: ["markdown"]
tags: ["markdown"]
--- ---
This article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated with CSS in a Hugo theme. This article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated with CSS in a Hugo theme.

View file

@ -0,0 +1,176 @@
---
author: "Mivinci"
title: "Markdown 语法指北"
date: "2021-07-18T10:52:59+08:00"
description: "一篇 Markdown 示例文章,翻译自官方示例。"
categories: ["markdown"]
tags: ["markdown"]
---
本文提供了一个可以在 Hugo 内容文件中使用的基本 Markdown 语法示例,还展示了基本 HTML 元素是否在 Hugo 主题中使用 CSS 进行修饰。
<!--more-->
## 标题
下面的 HTML `<h1>`—`<h6>` 元素代表了六个级别的章节标题。 `<h1>` 是最高的部分级别,而 `<h6>` 是最低的。
# 一级标题
## 二级标题
### 三级标题
#### 四级标题
##### 五级标题
###### 六级标题
## 段落
Xerum我可以和他解释谁在痛苦中。 当我来到你身边,当我充满快乐时,我被快乐所折磨,或者他是天生的,或者是一个骗子,因为那个让我快乐痛苦的人是事情的专家,或者他撕裂和撕破自己的意志,仿佛他值得被遮盖,他是不是走到了心坎上,以同样的心去追随同样的事情? 为什么毛孔会竖起来,当它被放置在一个不知道老鼠意志或一切的地方时? 我会安静的。 就我而言,我的心以一种或另一种方式受到干扰,我把它们撕下来擦干,这样我要么杀了它们,要么让它们逃跑。 他憎恨真相,因为 veliamenim 的浪潮是起因和面子本身,而版本的痛苦又重演了。
是旅行吗? 因为每一件事都有一些你讨厌或讨厌的东西,所以你会吃东西,以免让你的智慧隐藏这样一个事实,即心脏和心脏或有趣的东西会从中出来。
## 块引用
blockquote 元素表示从另一个来源引用的内容可选地带有必须在“footer”或“cite”元素内的引用以及可选的内联更改例如注释和缩写。
#### 不注明出处的块引用
> 然后,为了铸币安德普,要给予的知识相应地减少。
> **注意**您可以在块引用中使用 *Markdown 语法*
#### 带出处的块引用
> 不要通过共享内存来通信,通过通信来共享内存。<br>
> — <cite>Rob Pike[^1]</cite>
[^1]: 上述引述摘自 Rob Pike 在 2015 年 11 月 18 日 Gopherfest 期间的 [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c)。
## 表格
表格不是核心 Markdown 规范的一部分,但 Hugo 支持开箱即用地支持它们。
| 姓名 | 年龄 |
|:----:|:---:|
| 小明 | 27 |
| 大壮 | 23 |
#### 表格内的内联 Markdown
| 斜体 | 粗体 | 代码 |
|:---------:|:--------:|:------:|
| *斜体* | **粗体** | `code` |
## 代码块
#### 带反引号的代码块
```html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Example HTML5 Document</title>
</head>
<body>
<p>Test</p>
</body>
</html>
```
#### 缩进四个空格的代码块
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Example HTML5 Document</title>
</head>
<body>
<p>Test</p>
</body>
</html>
#### Golang 的代码块
```go {hl_lines=[3]}
type Registry interface {
Register(*Service, ...RegisterOption) error
Deregister(*Service, ...DeregisterOption) error
GetService(string, ...GetOption) ([]*Service, error)
}
```
#### C艹 的代码块
```c++
#include <iostream>
class Animal {
string name;
public:
void eat();
}
void Animal::eat() {
std::cout << "eat something" << std::endl;
}
```
#### Jvav 的代码块
```java
class Animal {
void speak() { /* speak */ }
}
class Dog extends Animal {
@override
void speak() { /* bark */ }
}
class Cat extends Animal {
@override
void speak() { /* mew */ }
}
```
#### Python 的代码块
```python
class Dog(Animal):
def __init__(self):
super.__init__()
def eat():
pass
```
## 列表类型
#### 有序列表
1. 第一项
2. 第二项
3. 第三项
- [x] 已勾选
- [ ] 未勾选
#### 无序列表
* 第一项
* 另一项
* 另另一项
#### 嵌套列表
* 水果
* 苹果
* 橘子
* 香蕉
* 乳制品
* 牛奶
* 奶酪

View file

@ -2,7 +2,7 @@
author: Hugo Authors author: Hugo Authors
title: Math Typesetting title: Math Typesetting
date: 2021-07-18T10:52:59+08:00 date: 2021-07-18T10:52:59+08:00
description: A brief guide to setup KaTeX description: A brief guide to setup KaTeX.
math: true math: true
categories: ["Markdown", "KaTeX"] categories: ["Markdown", "KaTeX"]
--- ---

View file

@ -2,7 +2,7 @@
author: Hugo Authors author: Hugo Authors
title: Mermaid Graphs title: Mermaid Graphs
date: 2021-07-18T10:52:59+08:00 date: 2021-07-18T10:52:59+08:00
description: A brief guide to setup Mermaid description: A brief guide to setup Mermaid.
mermaid: true mermaid: true
draft: false draft: false
categories: ["Markdown", "Mermaid"] categories: ["Markdown", "Mermaid"]
@ -15,4 +15,4 @@ graph LR
Start --> Stop Start --> Stop
{{</mermaid>}} {{</mermaid>}}
For more documentations on Mermaid, view [mermaid](https://mermaid-js.github.io/mermaid). For more documentations on Mermaid, check out [mermaid](https://mermaid-js.github.io/mermaid).

View file

@ -1,45 +0,0 @@
+++
author = "Hugo Authors"
title = "Placeholder Text"
date = "2021-07-11T10:52:59+08:00"
description = "Lorem Ipsum Dolor Si Amet"
toc = true
categories = ["Markdown"]
+++
Lorem est tota propiore conpellat pectoribus de pectora summo. <!--more-->Redit teque digerit hominumque toris verebor lumina non cervice subde tollit usus habet Arctonque, furores quas nec ferunt. Quoque montibus nunc caluere tempus inhospita parcite confusaque translucet patri vestro qui optatis lumine cognoscere flos nubis! Fronde ipsamque patulos Dryopen deorum.
1. Exierant elisi ambit vivere dedere
2. Duce pollice
3. Eris modo
4. Spargitque ferrea quos palude
Rursus nulli murmur; hastile inridet ut ab gravi sententia! Nomine potitus silentia flumen, sustinet placuit petis in dilapsa erat sunt. Atria tractus malis.
1. Comas hunc haec pietate fetum procerum dixit
2. Post torum vates letum Tiresia
3. Flumen querellas
4. Arcanaque montibus omnes
5. Quidem et
# Vagus elidunt
<svg class="canon" xmlns="http://www.w3.org/2000/svg" overflow="visible" viewBox="0 0 496 373" height="373" width="496"><g fill="none"><path stroke="#000" stroke-width=".75" d="M.599 372.348L495.263 1.206M.312.633l494.95 370.853M.312 372.633L247.643.92M248.502.92l246.76 370.566M330.828 123.869V1.134M330.396 1.134L165.104 124.515"></path><path stroke="#ED1C24" stroke-width=".75" d="M275.73 41.616h166.224v249.05H275.73zM54.478 41.616h166.225v249.052H54.478z"></path><path stroke="#000" stroke-width=".75" d="M.479.375h495v372h-495zM247.979.875v372"></path><ellipse cx="498.729" cy="177.625" rx=".75" ry="1.25"></ellipse><ellipse cx="247.229" cy="377.375" rx=".75" ry="1.25"></ellipse></g></svg>
[The Van de Graaf Canon](https://en.wikipedia.org/wiki/Canons_of_page_construction#Van_de_Graaf_canon)
## Mane refeci capiebant unda mulcebat
Victa caducifer, malo vulnere contra dicere aurato, ludit regale, voca! Retorsit colit est profanae esse virescere furit nec; iaculi matertera et visa est, viribus. Divesque creatis, tecta novat collumque vulnus est, parvas. **Faces illo pepulere** tempus adest. Tendit flamma, ab opes virum sustinet, sidus sequendo urbis.
Iubar proles corpore raptos vero auctor imperium; sed et huic: manus caeli Lelegas tu lux. Verbis obstitit intus oblectamina fixis linguisque ausus sperare Echionides cornuaque tenent clausit possit. Omnia putatur. Praeteritae refert ausus; ferebant e primus lora nutat, vici quae mea ipse. Et iter nil spectatae vulnus haerentia iuste et exercebat, sui et.
Eurytus Hector, materna ipsumque ut Politen, nec, nate, ignari, vernum cohaesit sequitur. Vel **mitis temploque** vocatus, inque alis, *oculos nomen* non silvis corpore coniunx ne displicet illa. Crescunt non unus, vidit visa quantum inmiti flumina mortis facto sic: undique a alios vincula sunt iactata abdita! Suspenderat ego fuit tendit: luna, ante urbem Propoetides **parte**.
{{< css.inline >}}
<style>
.canon { background: white; width: 100%; height: auto; }
</style>
{{< /css.inline >}}

22
i18n/en.yaml Normal file
View file

@ -0,0 +1,22 @@
recent:
other: Recent Posts
older:
other: Older Posts
home:
other: Home
about:
other: About
categories:
other: Categories
tags:
other: Tags
series:
other: Series
timeformat:
other: Jan 02, 2006
post:
at:
other: Post at

22
i18n/zh-cn.yaml Normal file
View file

@ -0,0 +1,22 @@
recent:
other: 近期文章
older:
other: 历史文章
home:
other: 首页
about:
other: 关于
categories:
other: 分类
tags:
other: 标签
series:
other: 系列
timeformat:
other: 2006 年 1 月 2 日
post:
at:
other: 发布于

View file

@ -1,10 +1,10 @@
{{ define "main" }} {{ define "main" }}
<div class="container mx-auto"> <div class="container mx-auto">
<h1 class="text-4xl font-extrabold mt-6 mb-6">{{ .Title }}</h1> <h1 class="text-4xl font-extrabold mt-6 mb-6">{{ .Title }}</h1>
<div class="mb-3 text-xs flex justify-between "> <div class="mb-3 text-sm flex justify-between ">
<div> <div>
{{ if .Site.Params.displayDate }} {{ if .Site.Params.displayDate }}
Posted at &mdash; {{ dateFormat .Site.Params.timeformat .Date }} {{ T "post.at" }} &mdash; {{ .Date | time.Format (T "timeformat") }}
{{ end }} {{ end }}
{{ if .Draft }} {{ if .Draft }}
<span class="ml-3 tag"> <span class="ml-3 tag">

View file

@ -1,12 +1,12 @@
{{ define "main" }} {{ define "main" }}
<main class="container mx-auto"> <main class="container mx-auto">
<h2 class="mt-8 text-3xl font-bold">{{ .Site.Params.iam }} {{ .Site.Author.name }}</h2> <h2 class="mt-8 text-3xl font-bold">{{ .Site.Params.greet }}</h2>
<p class="mt-0 mb-0">{{ .Site.Author.slogon }}</p> <p class="mt-0 mb-0">{{ .Site.Author.status }}</p>
<p class="mt-3 mb-3 home-intro">{{ .Site.Author.description | markdownify | safeHTML }}</p> <p class="mt-3 mb-3 home-intro">{{ .Site.Author.description | markdownify | safeHTML }}</p>
{{ if eq .Paginator.PageNumber 1 }} {{ if eq .Paginator.PageNumber 1 }}
<h3 class="mt-6 mb-4 text-2xl font-bold">{{ .Site.Params.recent }}</h3> <h3 class="mt-6 mb-4 text-2xl font-bold">{{ T "recent" }}</h3>
{{ else }} {{ else }}
<h3 class="mt-6 mb-4 text-2xl font-bold">{{ .Site.Params.older }}</h3> <h3 class="mt-6 mb-4 text-2xl font-bold">{{ T "older" }}</h3>
{{ end }} {{ end }}
<div> <div>
{{ $paginator := .Paginate (where .Site.RegularPages "Kind" "page") }} {{ $paginator := .Paginate (where .Site.RegularPages "Kind" "page") }}

View file

@ -5,15 +5,15 @@
{{ if .Site.Params.brand }} {{ if .Site.Params.brand }}
<div class="mr-3 text-3xl"><a href="/">{{ .Site.Params.brand }}</a></div> <div class="mr-3 text-3xl"><a href="/">{{ .Site.Params.brand }}</a></div>
{{ end }} {{ end }}
<div id="theme-switcher" class="text-2xl cursor-pointer">{{ index .Site.Params.switch 1 }}</div> <div id="theme-switcher" class="text-3xl cursor-pointer">{{ index .Site.Params.switch 1 }}</div>
</div> </div>
<ul class="flex items-center font-medium <ul class="flex items-center font-medium
whitespace-nowrap overflow-x-auto overflow-y-hidden"> whitespace-nowrap overflow-x-auto overflow-y-hidden">
{{ range .Site.Menus.main }} {{ range .Site.Menus.main }}
<li class="ml-1 mr-1"><a href="{{ .URL | absLangURL }}">{{ .Name }}</a></li> <li class="ml-1 mr-1"><a href="{{ .URL | absLangURL }}">{{ T .Identifier | default .Name }}</a></li>
{{ end }} {{ end }}
</ul> </ul>
<ul class="flex item-center text-xs font-bold"> <ul class="flex item-center text-sm font-bold">
{{ range $.Site.Home.AllTranslations }} {{ range $.Site.Home.AllTranslations }}
<li class="ml-2"><a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></li> <li class="ml-2"><a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></li>
{{ end}} {{ end}}

View file

@ -1,16 +1,16 @@
<div> <div>
<div class="flex justify-between"> <div class="flex justify-between">
{{ if .Page.Params.link }} {{ if .Page.Params.link }}
<a class="font-bold" href="{{ .Page.Params.link }}">{{ .Title }}</a> <a class="text-lg font-bold" href="{{ .Page.Params.link }}">{{ .Title }}</a>
{{ else }} {{ else }}
<a class="font-bold" href="{{ .RelPermalink }}">{{ .Title }}</a> <a class="text-lg font-bold" href="{{ .RelPermalink }}">{{ .Title }}</a>
{{ end }} {{ end }}
{{ if .Site.Params.displayDate }} {{ if .Site.Params.displayDate }}
<div class="text-xs font-bold">{{ dateFormat .Site.Params.timeformat .Date }}</div> <div class="text-sm font-bold">{{ .Date | time.Format (T "timeformat") }}</div>
{{ end }} {{ end }}
</div> </div>
{{ if .Site.Params.displayDescription }} {{ if .Site.Params.displayDescription }}
<p class="text-sm mb-2"> <p class="text-base mb-2">
{{ .Description | markdownify | safeHTML }} {{ .Description | markdownify | safeHTML }}
</p> </p>
{{ end }} {{ end }}