diff --git a/assets/css/_common/components/post/post-footer.scss b/assets/css/_common/components/post/post-footer.scss index fa231a5..2a58bf0 100644 --- a/assets/css/_common/components/post/post-footer.scss +++ b/assets/css/_common/components/post/post-footer.scss @@ -19,11 +19,31 @@ } @if $creative_commons_post { - .post-copyright ul { - list-style: none; - padding: .5em 1em; - @include post-card(); + + .post-copyright { + border-left: 3px solid #ff2a2a; + background: var(--card-bg-color); + + img { + margin: 8px; + opacity: .8; + filter: blur(.08em); + -webkit-transform: rotate(320deg); + -moz-transform: rotate(320deg); + -ms-transform: rotate(320deg); + -o-transform: rotate(320deg); + transform: rotate(320deg); + } + + ul { + list-style: none; + padding: .5em 1em; + @include post-card(); + border: none; + background: none; + } } + } .post-tags { diff --git a/assets/css/_variables/base.scss b/assets/css/_variables/base.scss index 26c1802..492bc72 100644 --- a/assets/css/_variables/base.scss +++ b/assets/css/_variables/base.scss @@ -299,7 +299,7 @@ $b2t-bg-color : $black-deep; $post-eof-margin-top : 80px; // or 160px for more white space; $post-eof-margin-bottom : 60px; // or 120px for less white space; -$post-card-margin : 1em 0 0; +$post-card-margin : 1em 0; // Note colors diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index 372cf37..bac466a 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -8,6 +8,11 @@ baseURL: / theme: hugo-theme-next +markup: + goldmark: + renderer: + unsafe: true + defaultContentLanguage: zh-cn languages: zh-cn: @@ -123,7 +128,7 @@ params: # Available values: big | small size: big sidebar: true - post: false + post: true # You can set a language value if you prefer a translated version of CC license, e.g. deed.zh # CC licenses are available in 39 languages, you can find the specific and correct abbreviation you need on https://creativecommons.org # language: @@ -173,7 +178,7 @@ params: sidebar: # Sidebar Position. - position: left + position: right #position: right # Manual define the sidebar width. If commented, will be default for: diff --git a/exampleSite/content/hello-world.md b/exampleSite/content/hello-world.md new file mode 100644 index 0000000..24c9eb4 --- /dev/null +++ b/exampleSite/content/hello-world.md @@ -0,0 +1,60 @@ +--- +title: "'Hello World'" +isCJKLanguage: true + +author: elkan1788 +lastmod: '2022-06-02T11:52:03+08:00' +publishDate: '2022-06-02T11:52:03+08:00' + +categories: + - 博客 +tags: + - Hugo + - 开始 + +toc: false +draft: true +url: hello-world2.html +--- + +The world’s fastest framework for building websites. + +[Hugo](https://gohugo.io/) is one of the most popular open-source static site generators. With its amazing speed and flexibility, Hugo makes building websites fun again. + + + +## Quick Start + +### Create a new post + +```shell +$ hugo new hello-world.md +``` + +More info: [Content's Formats](https://gohugo.io/content-management/formats/) + +### Run server + +```shell +$ hugo server +``` + +More info: [Hugo Server CLI](https://gohugo.io/commands/hugo_server/) + +### Generate static files + +```shell +$ hugo +``` + +More info: [Hugo Build Site](https://gohugo.io/commands/hugo/) + +### Deploy to remote sites + +```language +$ hugo deploy +``` + +More info: [Hugo Deployment](https://gohugo.io/commands/hugo_deploy/) + +See you will enjoy the Hugo journey and good luck for you! \ No newline at end of file diff --git a/exampleSite/content/post/basic-elements.md b/exampleSite/content/post/basic-elements.md deleted file mode 100644 index d387c45..0000000 --- a/exampleSite/content/post/basic-elements.md +++ /dev/null @@ -1,109 +0,0 @@ ---- -title: 'Basic Elements' -description: 'The main purpose of this article is to make sure that all basic HTML Elements are decorated with CSS so as to not miss any possible elements when creating new themes for Hugo.' -keywords: 'Basic,Element' -isCJKLanguage: false - -lastmod: '2022-06-02T11:52:18+08:00' -publishDate: '2022-06-02T11:52:18+08:00' - -categories: - - Example -tags: - - HTML - - Element - -toc: false -draft: true -url: 'basic-elements.html' ---- - -The main purpose of this article is to make sure that all basic HTML Elements are decorated with CSS so as to not miss any possible elements when creating new themes for Hugo. - - - -## Headings - -Let's start with all possible headings. The HTML `
-- -According to Mozilla's website,My goal wasn't to make a ton of money. It was to build good computers. I only started the company when I realized I could be an engineer forever.
- -
Firefox 1.0 was released in 2004 and became a big success.diff --git a/exampleSite/content/post/hello-world.md b/exampleSite/content/post/hello-world.md index 4e4eaff..38688ea 100644 --- a/exampleSite/content/post/hello-world.md +++ b/exampleSite/content/post/hello-world.md @@ -1,60 +1,62 @@ --- -title: 'Hello World' -isCJKLanguage: false +title: "世界,你好!" +description: "快速的描述下有关于 Hugo 建站的基本用法。" +isCJKLanguage: true -author: 'Author of the article' -lastmod: '2022-06-02T11:52:03+08:00' -publishDate: '2022-06-02T11:52:03+08:00' +lastmod: 2022-06-03T16:43:23+08:00 +publishDate: 2022-06-02T11:52:03+08:00 categories: - - Blog + - 博客 tags: - Hugo - - Startup + - 开始 toc: false -draft: true -url: 'hello-world.html' +draft: false +expand: true +url: hello-world.html +weight: 1 --- -The world’s fastest framework for building websites. +“Hugo 是现今世界上最快的网站建设框架。” -[Hugo](https://gohugo.io/) is one of the most popular open-source static site generators. With its amazing speed and flexibility, Hugo makes building websites fun again. +[Hugo](https://gohugo.io/) 也是最流行的开源静态站点生成器之一。 凭借其惊人的速度和灵活性,Hugo 让建设网站再次变得有趣起来。 -## Quick Start +## 快速开始 -### Create a new post +### 发表新文章 ```shell $ hugo new hello-world.md ``` -More info: [Content's Formats](https://gohugo.io/content-management/formats/) +更多信息:[内容格式](https://gohugo.io/content-management/formats/) -### Run server +### 启动服务 ```shell $ hugo server ``` -More info: [Hugo Server CLI](https://gohugo.io/commands/hugo_server/) +更多信息:[Hugo 服务命令行](https://gohugo.io/commands/hugo_server/) -### Generate static files +### 生成静态文件 ```shell $ hugo ``` -More info: [Hugo Build Site](https://gohugo.io/commands/hugo/) +更多信息:[Hugo 建站](https://gohugo.io/commands/hugo/) -### Deploy to remote sites +### 部署到服务器 ```language $ hugo deploy ``` -More info: [Hugo Deployment](https://gohugo.io/commands/hugo_deploy/) +更多信息:[Hugo 发布](https://gohugo.io/commands/hugo_deploy/) -See you will enjoy the Hugo journey and good luck for you! \ No newline at end of file +祝你好运,相信你会喜欢上 Hugo 建站的旅程! \ No newline at end of file diff --git a/exampleSite/content/post/markdown-syntax.md b/exampleSite/content/post/markdown-syntax.md new file mode 100644 index 0000000..6a2423e --- /dev/null +++ b/exampleSite/content/post/markdown-syntax.md @@ -0,0 +1,193 @@ +--- +title: "Markdown 语法支持" +description: "描述下 NexT 主题所支持的各种 markdown 语法及效果展示。" +isCJKLanguage: false + +lastmod: 2022-06-01T11:52:18+08:00 +publishDate: 2022-06-01T11:52:18+08:00 + +author: Mainroad +originLink: https://mainroad-demo.netlify.app/post/basic-elements/ + +categories: + - 示例 +tags: + - Markdown + - 语法 + +toc: false +draft: false +url: markdown-syntax.html +--- + +仅以此篇文章来测试下在 `NexT` 主题中在通过 `Hugo` 引擎来建站时,是否支持 `Markdown` 文件内容中所写的各种语法,并展示下实际的效果。 + + + +## 标题样式 + +让我们从所有可能的标题开始,在 HTML 中 `
++ +根据 Mozilla 的网站记录,我的目标不是赚大钱,是为了制造好的电脑。当我意识到我可以永远当工程师时,我才创办了这家公司。
+ +
Firefox 1.0 于 2004 年发布,并取得了巨大成功。+ +## 表格 + +表格并不算是 `Markdown` 的核心要素,但 `Hugo` 同样支持它。 + +| ID | 创建者 | 模型 | 年份 | +| --- | --------- | ------- | ---- | +| 1 | Honda | Accord | 2009 | +| 2 | Toyota | Camry | 2012 | +| 3 | Hyundai | Elantra | 2010 | + +可以使用 : (英文格式冒号)来对表格内容进行对齐。 + +| 表格 | 可以是 | 很酷 | +|:----- |:-----:| ----:| +| 左对齐 | 居中 | 右对齐 | +| 左对齐 | 居中 | 右对齐 | +| 左对齐 | 居中 | 右对齐 | + +同样也可以在表格中使用 `Markdown` 语法。 + +| 表格 | 中 | 使用 | Markdown 语法 | +| ------ | --------- | ---------- | ------------- | +| *斜体* | **粗体** | ~~中划线~~ | `代码块` | + +## Code + +```html + + + + +
Test
+ + +``` + +{{< highlight html >}} + + + + +Test
+ + +{{< /highlight >}} + +## 其它元素: abbr、sub、sup、kbd等等 + +GIF 是位图图像格式。 + +H2O + +C6H12O6 + +Xn + Yn = Zn + +按X获胜。或按CTRL+ALT+F显示 FPS 计数器。 + +比特作为信息论中的信息单位,也被称为 shannon ,以信息论领域的创始人 Claude shannon 的名字命名。 + +参考: +- 来自 **Mainroad** 主题的 [Basic Elements](https://mainroad-demo.netlify.app/post/basic-elements/) 内容 diff --git a/exampleSite/start.sh b/exampleSite/start.sh index cecf594..165aa03 100644 --- a/exampleSite/start.sh +++ b/exampleSite/start.sh @@ -19,4 +19,4 @@ EOT next V0.0.1 -hugo server -D -t ../.. --port 1414 \ No newline at end of file +hugo server -D -t ../.. --port 1414 --panicOnWarning \ No newline at end of file diff --git a/i18n/en-us.yaml b/i18n/en-us.yaml index 5050f74..d649dc5 100644 --- a/i18n/en-us.yaml +++ b/i18n/en-us.yaml @@ -53,6 +53,19 @@ PostTag: PostReadMore: other: "Read More" +PostCRAuthor: + other: Post Author +PostCRLink: + other: Post Link +PostCROriginAuthor: + other: Written By +PostCROriginLink: + other: Originally From +PostCRLicenseTitle: + other: Copyright Notice +PostCRLicenseContent: + other: "All articles in this blog are licensed under %s unless stating additionally." + VisitorsLabel: other: Total Visitors PageViewsLabel: diff --git a/i18n/zh-cn.yaml b/i18n/zh-cn.yaml index 2936ff8..0333539 100644 --- a/i18n/zh-cn.yaml +++ b/i18n/zh-cn.yaml @@ -9,7 +9,7 @@ MSearchLabel: other: 搜索 SymbolColon: - other: ":" + other: ":" SbPostsLable: other: 日志 @@ -55,6 +55,19 @@ PostTags: PostReadMore: other: 阅读全文 +PostCRAuthor: + other: 本文作者 +PostCRLink: + other: 本文链接 +PostCROriginAuthor: + other: 原文作者 +PostCROriginLink: + other: 原文链接 +PostCRLicenseTitle: + other: 版权声明 +PostCRLicenseContent: + other: "本博客所有文章除特别声明外,均采用 %s 许可协议。转载请注明出处!" + UserVistorsLabel: other: 总访客量 PageViewsLabel: diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 019df06..c2e528d 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -6,8 +6,6 @@ {{- .Scratch.Set "pluginCDN" $pluginCDN -}} {{ $posts := len (where .Page.Site.RegularPages "Section" "in" .Site.Params.mainSections) }} {{- .Scratch.Set "posts" $posts -}} -{{/* TODO IsHome */}} -{{- .Scratch.Set "IsHome" .IsHome }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 4e67b7e..d02bf58 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,4 +1,4 @@ {{- define "main_class" }}page{{- end }} {{- define "main" }} -{{ partial "post_content.html" . }} +{{ partial "post_content.html" (dict "ctx" . "IsHome" false) }} {{- end }} \ No newline at end of file diff --git a/layouts/index.html b/layouts/index.html index ba068c2..aa32668 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,10 +1,8 @@ {{- define "main_class" }}index{{- end }} {{- define "main" }} -{{/* TODO IsHome */}} -{{- print "Get IsHome value from scratch before paginate: " (.Scratch.Get "IsHome") }} {{ $paginator := .Paginate (where .Site.RegularPages "Section" "in" .Site.Params.mainSections) }} {{- range $paginator.Pages }} -{{ partial "post_content.html" . }} +{{ partial "post_content.html" (dict "ctx" . "IsHome" true) }} {{- end }} {{- partial "partials/pagination.html" . }} {{- end }} \ No newline at end of file diff --git a/layouts/partials/head/opengraph.html b/layouts/partials/head/opengraph.html index f04faeb..c151602 100644 --- a/layouts/partials/head/opengraph.html +++ b/layouts/partials/head/opengraph.html @@ -9,7 +9,7 @@ {{- if .IsHome }} - + {{- end }} \ No newline at end of file diff --git a/layouts/partials/post/post_body.html b/layouts/partials/post/post_body.html index 94d425d..6138ccf 100644 --- a/layouts/partials/post/post_body.html +++ b/layouts/partials/post/post_body.html @@ -1,5 +1,6 @@ +{{ with .ctx }}