Skip to content

Commit

Permalink
v0.9.0
Browse files Browse the repository at this point in the history
* Improve: search implementation
  * hide the mismatch objects instead of removing it while searching
  * widen the control range of search result
* Improve: gallery layout's key and value now support markdown syntax
* Improve: Zooming.js configuration
  * speed up animations
  * setup transparent background
* Change: for consistency, the names of the following parameters are changed:
  * page's `collapsibleTOC` => `collapsible_toc`
  * page's `collapsibleChangelogs` => `collapsible_changelogs`
* Change: font-size of html is changed from `18px` to `16px`
* Add: `breadcrumbs` shortcode
* Add: list layout properties `group_by_year` and `show_date`
* Fix: terms-cloud typo ([#4](#4))
  • Loading branch information
kaiiiz committed Jan 31, 2022
2 parents 8c96d83 + 0ca9efc commit 59c4506
Show file tree
Hide file tree
Showing 40 changed files with 36,945 additions and 842 deletions.
2 changes: 1 addition & 1 deletion assets/css/site.pcss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*! purgecss start ignore */

html {
font-size: 18px;
font-size: 16px;
}

@import "components/color.pcss";
Expand Down
10 changes: 5 additions & 5 deletions assets/css/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ module.exports = {
minHeight: {
10: '2.5rem',
},
gridTemplateColumns: {
'svg-group': 'repeat(auto-fill, 1rem)',
'bookcase-item': 'repeat(auto-fill, 8rem)',
'statistic': 'max-content 1fr',
},
},
fill: {
'gray': gray,
Expand Down Expand Up @@ -91,11 +96,6 @@ module.exports = {
},
overlay: 'rgba(0,0,0,0.75)',
},
gridTemplateColumns: {
'svg-group': 'repeat(auto-fill, 1rem)',
'bookcase-item': 'repeat(auto-fill, 8rem)',
'statistic': 'max-content 1fr',
},
margin: marginAndPadding,
padding: marginAndPadding,
gap: theme => ({
Expand Down
48 changes: 23 additions & 25 deletions assets/js/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ async function init() {
});

const index_json = await (await data).json();
const items_list = [];

// create index
let id = 0;
Expand All @@ -46,11 +47,11 @@ async function init() {
});

const createItem = (title, permalink, content) => {
const item = document.createElement("div");
item.className = "search-menu-result-item";
const item = document.createElement("a");
item.href = permalink;

const item_link = document.createElement("a");
item_link.href = permalink;
const item_wrapper = document.createElement("div");
item_wrapper.className = "search-menu-result-item";

const item_title = document.createElement("div");
item_title.className = "search-menu-result-item-title";
Expand All @@ -60,29 +61,28 @@ async function init() {
item_content.className = "search-menu-result-item-content";
item_content.innerHTML = content;

item_link.appendChild(item_title);
item_link.appendChild(item_content);
item.appendChild(item_link);
item_wrapper.appendChild(item_title);
item_wrapper.appendChild(item_content);
item.appendChild(item_wrapper);

return item;
};

const clearAllItems = () => {
while (search_menu_results.firstChild) {
search_menu_results.removeChild(search_menu_results.lastChild);
}
const showAllItems = () => {
items_list.forEach(i => {
i.classList.remove("hidden");
});
};

const buildAllItems = () => {
clearAllItems();
index_json.forEach(index_item => {
const item = createItem(index_item.title, index_item.permalink, index_item.content);
search_menu_results.appendChild(item);
items_list.push(item);
})
};

const search = (value) => {
clearAllItems();
let ascii_res = ascii_index.search(value);
let nonascii_res = nonascii_index.search(value);

Expand All @@ -91,24 +91,22 @@ async function init() {
curr.result.forEach(x => acc.add(x));
return acc;
}, new Set());
}

let res_id = new Set([...reduce_res_to_id(ascii_res), ...reduce_res_to_id(nonascii_res)])
};

res = Array.from(res_id).reduce((acc, id) => {
acc.push(ascii_index.get(id));
return acc;
}, new Array());
let res_id = new Set([...reduce_res_to_id(ascii_res), ...reduce_res_to_id(nonascii_res)]);

res.forEach(post => {
const item = createItem(post.title, post.permalink, post.content);
search_menu_results.appendChild(item);
});
for (let i = 0; i < items_list.length; i++) {
if (res_id.has(i)) {
items_list[i].classList.remove("hidden");
} else {
items_list[i].classList.add("hidden");
}
}
};

search_menu_input.addEventListener("input", function () {
if (this.value === '') {
buildAllItems();
showAllItems();
} else {
search(this.value);
}
Expand Down
5 changes: 4 additions & 1 deletion assets/js/zooming.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import Zooming from 'zooming';

document.addEventListener('DOMContentLoaded', function () {
const zooming = new Zooming()
const zooming = new Zooming({
bgOpacity: 0,
transitionDuration: 0.2,
})
zooming.listen('#content img')
});
36 changes: 0 additions & 36 deletions exampleSite/config/_default/menus/menus.en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,42 +101,6 @@
name = "Shortcodes"
url = "/shortcodes/"
weight = 5
[[navbar]]
identifier = "shortcodes_svg_wrapper"
name = "SVG Wrapper"
url = "/shortcodes/svg-wrapper/"
weight = 1
parent = "shortcodes"
[[navbar]]
identifier = "shortcodes_codepen"
name = "CodePen"
url = "/shortcodes/codepen/"
weight = 2
parent = "shortcodes"
[[navbar]]
identifier = "shortcodes_jsfiddle"
name = "JSFiddle"
url = "/shortcodes/jsfiddle/"
weight = 3
parent = "shortcodes"
[[navbar]]
identifier = "shortcodes_color_block"
name = "Color Block"
url = "/shortcodes/color-block/"
weight = 4
parent = "shortcodes"
[[navbar]]
identifier = "shortcodes_icon_group"
name = "Icon Group"
url = "/shortcodes/icon-group/"
weight = 5
parent = "shortcodes"
[[navbar]]
identifier = "shortcodes_terms_cloud"
name = "Terms Cloud"
url = "/shortcodes/terms-cloud/"
weight = 6
parent = "shortcodes"
[[navbar]]
identifier = "posts"
name = "Posts"
Expand Down
36 changes: 0 additions & 36 deletions exampleSite/config/_default/menus/menus.zh-tw.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,42 +101,6 @@
name = "短代碼"
url = "/zh-tw/shortcodes/"
weight = 5
[[navbar]]
identifier = "shortcodes_svg_wrapper"
name = "SVG Wrapper"
url = "/zh-tw/shortcodes/svg-wrapper/"
weight = 1
parent = "shortcodes"
[[navbar]]
identifier = "shortcodes_codepen"
name = "CodePen"
url = "/zh-tw/shortcodes/codepen/"
weight = 2
parent = "shortcodes"
[[navbar]]
identifier = "shortcodes_jsfiddle"
name = "JSFiddle"
url = "/zh-tw/shortcodes/jsfiddle/"
weight = 3
parent = "shortcodes"
[[navbar]]
identifier = "shortcodes_color_block"
name = "Color Block"
url = "/zh-tw/shortcodes/color-block/"
weight = 4
parent = "shortcodes"
[[navbar]]
identifier = "shortcodes_icon_group"
name = "Icon Group"
url = "/zh-tw/shortcodes/icon-group/"
weight = 5
parent = "shortcodes"
[[navbar]]
identifier = "shortcodes_terms_cloud"
name = "Terms Cloud"
url = "/zh-tw/shortcodes/terms-cloud/"
weight = 6
parent = "shortcodes"
[[navbar]]
identifier = "posts"
name = "文章"
Expand Down
12 changes: 6 additions & 6 deletions exampleSite/content/en/about/acknowledgement.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ weight: 1000
gallery_img_src: 'thanks.jpg'
gallery_img_caption: '<span>Photo by <a href="https://unsplash.com/@swimstaralex?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Alexander Sinn</a> on <a href="https://unsplash.com/s/photos/thanks?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></span>'
gallery_statistic:
- key: key1
value: value1
- key: key2
value: value2
- key: key3
value: value3
- key: '**key1**'
value: '*value1*'
- key: '**key2**'
value: '*value2*'
- key: '**key3**'
value: '*value3*'
---

* [Hugo](https://gohugo.io/)
Expand Down
12 changes: 6 additions & 6 deletions exampleSite/content/en/about/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ weight: 1
gallery_img_src: 'pottery.jpg'
gallery_img_caption: '<span>Photo by <a href="https://unsplash.com/@mochiel?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Mercy</a> on <a href="https://unsplash.com/s/photos/vase?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></span>'
gallery_statistic:
- key: key1
value: value1
- key: key2
value: value2
- key: key3
value: value3
- key: '**key1**'
value: '*value1*'
- key: '**key2**'
value: '*value2*'
- key: '**key3**'
value: '*value3*'
---

1. **Clean UI with small resources.** Monochrome has clean UI design and can remove unused resources in production environment.
Expand Down
13 changes: 7 additions & 6 deletions exampleSite/content/en/about/timeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ weight: 2
gallery_img_src: 'clock.jpg'
gallery_img_caption: '<span>Photo by <a href="https://unsplash.com/@oceanng?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Ocean Ng</a> on <a href="https://unsplash.com/s/photos/clock?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></span>'
gallery_statistic:
- key: key1
value: value1
- key: key2
value: value2
- key: key3
value: value3
- key: '**key1**'
value: '*value1*'
- key: '**key2**'
value: '*value2*'
- key: '**key3**'
value: '*value3*'
---

* 2022/01/31 - v0.9.0 release
* 2021/07/29 - v0.8.0 release
* 2021/07/08 - v0.7.1 release
* 2021/06/24 - v0.7.0 release
Expand Down
17 changes: 17 additions & 0 deletions exampleSite/content/en/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@ toc: false

## Changelog

### v0.9.0 - 2022/01/31

* Improve: search implementation
* hide the mismatch objects instead of removing it while searching
* widen the control range of search result
* Improve: gallery layout's key and value now support markdown syntax
* Improve: Zooming.js configuration
* speed up animations
* setup transparent background
* Change: for consistency, the names of the following parameters are changed:
* page's `collapsibleTOC` => `collapsible_toc`
* page's `collapsibleChangelogs` => `collapsible_changelogs`
* Change: font-size of html is changed from `18px` to `16px`
* Add: `breadcrumbs` shortcode
* Add: list layout properties `group_by_year` and `show_date`
* Fix: terms-cloud typo ([#4](https://github.com/kaiiiz/hugo-theme-monochrome/pull/4))

### v0.8.0 - 2021/07/29

* Improve: flexsearch multilingual search capability
Expand Down
16 changes: 10 additions & 6 deletions exampleSite/content/en/configuration/page.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ weight: 3
bookcase_cover_src: 'cover/catalogue.png'
bookcase_cover_src_dark: 'cover/catalogue_dark.png'
changelogs:
- tag: 'v0.7.0'
- tag: 'v0.9.0'
description:
- 'Add `changelogs` property'
- "Update `disqus` fallback policy for none post pages"
- 'Rename `collapsibleTOC` to `collapsible_toc` for consistency'
- 'Rename `collapsibleChangelogs` to `collapsible_changelogs` for consistency'
- tag: 'v0.8.0'
description:
- 'Add `collapsibleTOC` and `collapsibleChangelogs` properties'
- tag: 'v0.7.0'
description:
- 'Add `changelogs` property'
- "Update `disqus` fallback policy for none post pages"
---

# Page Settings
Expand Down Expand Up @@ -59,7 +63,7 @@ toc: false

```yaml
---
collapsibleTOC: false
collapsible_toc: false
---
```

Expand All @@ -81,15 +85,15 @@ changelogs:
---
```

tag and description fields support markdown syntax.
tag and description both support markdown syntax.

> default: None
### Collapsible Changelogs

```yaml
---
collapsibleChangelogs: false
collapsible_changelogs: false
---
```

Expand Down
Loading

0 comments on commit 59c4506

Please sign in to comment.