Skip to content

Commit

Permalink
feat: widget system for configuring homepage
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Param 'hero' in params.toml is deprecated.

BREAKING CHANGE: Param 'icon_pack' in %q is deprecated. Use 'iconPack'.

BREAKING CHANGE: 'doc_list' in doc layout is deprecated. Use 'doc-list'.

Closes #11
  • Loading branch information
wangchucheng committed Dec 27, 2020
1 parent 3023aca commit c33985a
Show file tree
Hide file tree
Showing 72 changed files with 887 additions and 264 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ Read [Getting Started](https://www.wangchucheng.com/en/docs/eureka/getting-start
## View Document

- **[Getting Started](https://www.wangchucheng.com/en/docs/eureka/getting-started/)**: In [Getting Started](https://www.wangchucheng.com/en/docs/eureka/getting-started/) you will learn how to quickly build a Hugo site with Eureka.
- **[Content Management](https://www.wangchucheng.com/en/docs/eureka/content-management/)**: In [Getting Started](https://www.wangchucheng.com/en/docs/eureka/getting-started/), I believe you have successfully run the Hugo site using Eureka. Next we will add some content. Content Management will lead you to understand site content structure and editing skills.
- **[Customize Eureka](https://www.wangchucheng.com/en/docs/eureka/customize-eureka/)**: In [Content Management](https://www.wangchucheng.com/en/docs/eureka/content-management/), you have already learned about all kinds of content of Eureka. Next, we will introduce Eureka's customization options. [Customize Eureka](https://www.wangchucheng.com/en/docs/eureka/customize-eureka/) will lead you to understand how Eureka is configured and its options.
- **[Multilingual Mode](https://www.wangchucheng.com/en/docs/eureka/multilingual-mode/)**: In addition to [Content Management](https://www.wangchucheng.com/en/docs/eureka/content-management/) and [Customize Eureka](https://www.wangchucheng.com/en/docs/eureka/customize-eureka/) described above, Eureka also supports [Multilingual Mode](https://www.wangchucheng.com/en/docs/eureka/multilingual-mode/). [Multilingual Mode](https://www.wangchucheng.com/en/docs/eureka/multilingual-mode/) will lead you to understand how to build a multilingual site.
- **[Update Eureka](https://www.wangchucheng.com/en/docs/eureka/update-eureka/)**: [Update Eureka](https://www.wangchucheng.com/en/docs/eureka/update-eureka/) will introduce different ways to update Eureka.
- **[Homepage Configuration](https://www.wangchucheng.com/en/docs/eureka/homepage-configuration/)**: In [Getting Started](https://www.wangchucheng.com/en/docs/eureka/getting-started/), I believe you have successfully run the Hugo site using Eureka. In [Homepage Configuration](https://www.wangchucheng.com/en/docs/eureka/homepage-configuration/) you will learn how to customize the website homepage.
- **[Content Management](https://www.wangchucheng.com/en/docs/eureka/content-management/)**: You have configured the website homepage in [Homepage Configuration](https://www.wangchucheng.com/en/docs/eureka/homepage-configuration/). Next we will add some content. Content Management will lead you to understand site content structure and editing skills.
- **[Customize Eureka](https://www.wangchucheng.com/en/docs/eureka/customization/)**: In [Content Management](https://www.wangchucheng.com/en/docs/eureka/content-management/), you have already learned about all kinds of content of Eureka. Next, we will introduce Eureka's customization options. [Customize Eureka](https://www.wangchucheng.com/en/docs/eureka/customization/) will lead you to understand how Eureka is configured and its options.
- **[Multilingual Mode](https://www.wangchucheng.com/en/docs/eureka/multilingual-mode/)**: In addition to [Content Management](https://www.wangchucheng.com/en/docs/eureka/content-management/) and [Customize Eureka](https://www.wangchucheng.com/en/docs/eureka/customization/) described above, Eureka also supports [Multilingual Mode](https://www.wangchucheng.com/en/docs/eureka/multilingual-mode/). [Multilingual Mode](https://www.wangchucheng.com/en/docs/eureka/multilingual-mode/) will lead you to understand how to build a multilingual site.
- **[Update Eureka](https://www.wangchucheng.com/en/docs/eureka/update/)**: [Update Eureka](https://www.wangchucheng.com/en/docs/eureka/update/) will introduce different ways to update Eureka.
9 changes: 5 additions & 4 deletions README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ Eureka致力于为[Hugo](https://gohugo.io/)提供一个优雅,功能丰富且
## 阅读文档

- **[入门](https://www.wangchucheng.com/zh/docs/eureka/getting-started/)**:在[入门](https://www.wangchucheng.com/zh/docs/eureka/getting-started/)中你将了解到如何快速搭建一个Eureka主题的Hugo网站。
- **[内容管理](https://www.wangchucheng.com/zh/docs/eureka/content-management/)**:在[入门](https://www.wangchucheng.com/zh/docs/eureka/getting-started/)中,相信你已经成功运行了使用Eureka主题的Hugo网站。接下来我们将添加一些内容。[内容管理](https://www.wangchucheng.com/zh/docs/eureka/content-management/)将带领你了解网站内容结构及编辑技巧。
- **[定制Eureka](https://www.wangchucheng.com/zh/docs/eureka/customize-eureka/)**:在[内容管理](https://www.wangchucheng.com/zh/docs/eureka/content-management/)中,你已经了解了Eureka的各类内容。接下来我们将介绍Eureka的定制化选项。[定制Eureka](https://www.wangchucheng.com/zh/docs/eureka/customize-eureka/)将带领你了解Eureka的配置方式及其选项。
- **[多语言模式](https://www.wangchucheng.com/zh/docs/eureka/multilingual-mode/)**:除了前文的[内容管理](https://www.wangchucheng.com/zh/docs/eureka/content-management/)以及[定制Eureka](https://www.wangchucheng.com/zh/docs/eureka/customize-eureka/),Eureka也支持[多语言模式](https://www.wangchucheng.com/zh/docs/eureka/multilingual-mode/)[多语言模式](https://www.wangchucheng.com/zh/docs/eureka/multilingual-mode/)将带领你了解如何构建一个多语言网站。
- **[更新Eureka](https://www.wangchucheng.com/zh/docs/eureka/update-eureka/)**[更新Eureka](https://www.wangchucheng.com/zh/docs/eureka/update-eureka/)将介绍通过不同方式更新Eureka的方法。
- **[主页配置](https://www.wangchucheng.com/zh/docs/eureka/homepage-configuration)**:在[入门](https://www.wangchucheng.com/zh/docs/eureka/getting-started)中,相信你已经成功运行了使用Eureka主题的Hugo网站。在[主页配置](https://www.wangchucheng.com/zh/docs/eureka/homepage-configuration)中你将了解如何自定义网站主页。
- **[内容管理](https://www.wangchucheng.com/zh/docs/eureka/content-management)**:在[主页配置](https://www.wangchucheng.com/zh/docs/eureka/homepage-configuration)中你已经配置好了主页样式。接下来我们将添加一些内容。[内容管理](https://www.wangchucheng.com/zh/docs/eureka/content-management)将带领你了解网站内容结构及编辑技巧。
- **[定制Eureka](https://www.wangchucheng.com/zh/docs/eureka/customization/)**:在[内容管理](https://www.wangchucheng.com/zh/docs/eureka/content-management/)中,你已经了解了Eureka的各类内容。接下来我们将介绍Eureka的定制化选项。[定制Eureka](https://www.wangchucheng.com/zh/docs/eureka/customization/)将带领你了解Eureka的配置方式及其选项。
- **[多语言模式](https://www.wangchucheng.com/zh/docs/eureka/multilingual-mode/)**:除了前文的[内容管理](https://www.wangchucheng.com/zh/docs/eureka/content-management/)以及[定制Eureka](https://www.wangchucheng.com/zh/docs/eureka/customization/),Eureka也支持[多语言模式](https://www.wangchucheng.com/zh/docs/eureka/multilingual-mode/)[多语言模式](https://www.wangchucheng.com/zh/docs/eureka/multilingual-mode/)将带领你了解如何构建一个多语言网站。
- **[更新Eureka](https://www.wangchucheng.com/zh/docs/eureka/update/)**[更新Eureka](https://www.wangchucheng.com/zh/docs/eureka/update/)将介绍通过不同方式更新Eureka的方法。
4 changes: 2 additions & 2 deletions archetypes/authors/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ avatar = ""

# Check the available icons on https://fontawesome.com/.
# You can get similar results like this <i class="fab fa-github"></i> after searching.
# Then icon is github and icon_pack is fab for this case.
# Then icon is github and iconPack is fab for this case.
[[social]]
icon = ""
icon_pack = ""
iconPack = ""
url = ""
+++
2 changes: 1 addition & 1 deletion archetypes/docs/_index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
+++
title = "Docs"
layout = "doc_list" #Do not modify
layout = "doc-list" #Do not modify
+++
46 changes: 46 additions & 0 deletions archetypes/widgets/about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
+++
title = "{{ replace .Name "-" " " | title }}"
weight = 1
draft = false

role = ""
bio = ""
avatar = ""

[organization]
name = ""
url = ""

# Check the available icons on https://fontawesome.com/.
# You can get similar results like this <i class="fab fa-github"></i> after searching.
# Then icon is github and iconPack is fab for this case.
[[social]]
icon = ""
iconPack = ""
url = ""

[widget]
handler = "about"

# Options: sm, md, lg and xl. Default is md.
width = ""

[widget.sidebar]
# Options: left and right. Leave blank to hide.
position = ""
# Options: sm, md, lg and xl. Default is md.
scale = ""

[widget.background]
# Options: primary, secondary, tertiary or any valid color value. Default is primary.
color = ""

# See TODO
image = ""
# Options: auto, cover and contain. Default is auto.
size = ""
# Options: center, top, right, bottom, left.
position = ""
# Options: fixed, local, scroll.
attachment = ""
+++
30 changes: 30 additions & 0 deletions archetypes/widgets/blank.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
+++
title = "{{ replace .Name "-" " " | title }}"
weight = 1
draft = false

[widget]
handler = "blank"

# Options: sm, md, lg and xl. Default is md.
width = ""

[widget.sidebar]
# Options: left and right. Leave blank to hide.
position = ""
# Options: sm, md, lg and xl. Default is md.
scale = ""

[widget.background]
# Options: primary, secondary, tertiary or any valid color value. Default is primary.
color = ""

# See TODO
image = ""
# Options: auto, cover and contain. Default is auto.
size = ""
# Options: center, top, right, bottom, left.
position = ""
# Options: fixed, local, scroll.
attachment = ""
+++
37 changes: 37 additions & 0 deletions archetypes/widgets/pages.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
+++
title = "{{ replace .Name "-" " " | title }}"
weight = 1
draft = false

# Section you want to display
section = "posts"
# Pages count
count = 5
# Options: card, plain and masonry.
style = "card"

[widget]
handler = "pages"

# Options: sm, md, lg and xl. Default is md.
width = ""

[widget.sidebar]
# Options: left and right. Leave blank to hide.
position = ""
# Options: sm, md, lg and xl. Default is md.
scale = ""

[widget.background]
# Options: primary, secondary, tertiary or any valid color value. Default is primary.
color = ""

# See TODO
image = ""
# Options: auto, cover and contain. Default is auto.
size = ""
# Options: center, top, right, bottom, left.
position = ""
# Options: fixed, local, scroll.
attachment = ""
+++
35 changes: 35 additions & 0 deletions archetypes/widgets/vintage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
+++
title = "{{ replace .Name "-" " " | title }}"
weight = 1
draft = false

slogan = ""
# See TODO
imgLeft = ""
imgRight = ""

[widget]
handler = "vintage"

# Options: sm, md, lg and xl. Default is md.
width = ""

[widget.sidebar]
# Options: left and right. Leave blank to hide.
position = ""
# Options: sm, md, lg and xl. Default is md.
scale = ""

[widget.background]
# Options: primary, secondary, tertiary or any valid color value. Default is primary.
color = ""

# See TODO
image = ""
# Options: auto, cover and contain. Default is auto.
size = ""
# Options: center, top, right, bottom, left.
position = ""
# Options: fixed, local, scroll.
attachment = ""
+++
6 changes: 6 additions & 0 deletions assets/css/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ module.exports = {
'mono': ['SFMono-Regular', 'Menlo'],
},
extend: {
height: {
'(screen-16)': 'calc(100vh - 4rem)',
'96': '24rem',
'128': '32rem',
'160': '40rem',
},
minHeight: {
'16': '4rem',
},
Expand Down
2 changes: 1 addition & 1 deletion assets/js/eureka.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function resizeInstance(instance) {
resizeGridItem(item);
}

//color schema
//color components/schema
function getcolorscheme() {
let storageColorScheme = localStorage.getItem("lightDarkMode")
let element = document.getElementById('lightDarkMode');
Expand Down
1 change: 1 addition & 0 deletions data/eureka.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version = "0.4.0"
2 changes: 1 addition & 1 deletion exampleSite/config/_default/menus.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[[main]]
name = "About"
url = "/about/"
url = "#about"
weight = 1

[[main]]
Expand Down
6 changes: 0 additions & 6 deletions exampleSite/config/_default/params.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ icon = "images/icon.png"
publisherName = "C. Wang"
publisherLogo = ""

[hero]
slogan = "We are all in the gutter, but some of us are looking at the stars."
# Specify the image name in `assets/images/` folder.
imgLeft = "images/hero-left.jpg"
imgRight = "images/hero-right.jpg"

[math]
handler = "katex"

Expand Down
28 changes: 0 additions & 28 deletions exampleSite/content/about.md

This file was deleted.

8 changes: 4 additions & 4 deletions exampleSite/content/authors/example-author/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
title = "Example Author"
role = "Example Role"
bio = "Aenean vel bibendum quam. Aliquam at mollis quam. Proin efficitur."
avatar = "images/avatar.jpg"
avatar = "images/icon.png"

[organization]
name = "Example Organization"
url = "https://example.com/"

[[social]]
icon = "envelope"
icon_pack = "fas"
iconPack = "fas"
url = "mailto:[email protected]"

[[social]]
icon = "twitter"
icon_pack = "fab"
iconPack = "fab"
url = "https://example.com/"

[[social]]
icon = "github"
icon_pack = "fab"
iconPack = "fab"
url = "https://example.com/"

+++
Expand Down
Binary file not shown.
6 changes: 3 additions & 3 deletions exampleSite/content/authors/hugo-authors/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ shortContent = "Example Short Content"

[[social]]
icon = "envelope"
icon_pack = "fas"
iconPack = "fas"
url = "mailto:[email protected]"

[[social]]
icon = "twitter"
icon_pack = "fab"
iconPack = "fab"
url = "https://example.com/"

[[social]]
icon = "github"
icon_pack = "fab"
iconPack = "fab"
url = "https://example.com/"

+++
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/docs/_index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
+++
title = "Docs"
layout = "doc_list"
layout = "doc-list"
+++
Loading

0 comments on commit c33985a

Please sign in to comment.