Skip to content

Commit 2f67ddd

Browse files
committed
deploy: 214a5eb
1 parent 043efc3 commit 2f67ddd

File tree

7 files changed

+121
-5
lines changed

7 files changed

+121
-5
lines changed

images/bluesky.png

163 KB
Loading

index.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>❮ Z-Shell ❯</title><link>https://github.zshell.dev/</link><description>Recent content on ❮ Z-Shell ❯</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sun, 23 Mar 2025 00:02:28 +0000</lastBuildDate><atom:link href="https://github.zshell.dev/index.xml" rel="self" type="application/rss+xml"/><item><title>Typeset</title><link>https://github.zshell.dev/post/zsh/cheatsheet/typeset/</link><pubDate>Mon, 20 Mar 2023 01:39:43 +0000</pubDate><guid>https://github.zshell.dev/post/zsh/cheatsheet/typeset/</guid><description>&lt;h2 id="typeset">Typeset&lt;/h2>
1+
<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>❮ Z-Shell ❯</title><link>https://github.zshell.dev/</link><description>Recent content on ❮ Z-Shell ❯</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sun, 23 Mar 2025 05:21:30 +0000</lastBuildDate><atom:link href="https://github.zshell.dev/index.xml" rel="self" type="application/rss+xml"/><item><title>Typeset</title><link>https://github.zshell.dev/post/zsh/cheatsheet/typeset/</link><pubDate>Mon, 20 Mar 2023 01:39:43 +0000</pubDate><guid>https://github.zshell.dev/post/zsh/cheatsheet/typeset/</guid><description>&lt;h2 id="typeset">Typeset&lt;/h2>
22
&lt;p>Set or display attributes and values for shell parameters.
33
Except as noted below for control flags that change the behavior, a parameter is created for each name that does not already
44
refer to one. When inside a function, a new parameter is created for every name (even those that already exist) and is unset again when the function completes.

js/search.js

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
(() => {
2+
fetch('/index.json')
3+
.then(response => response.json())
4+
.then(data => {
5+
const fuse = new Fuse(data, {
6+
keys: ['title', 'content'],
7+
shouldSort: true,
8+
includeMatches: true,
9+
minMatchCharLength: 2,
10+
threshold: 0.0,
11+
ignoreLocation: true,
12+
})
13+
14+
document.getElementById('search-form').addEventListener('submit', function (e) {
15+
e.preventDefault();
16+
const data = new FormData(e.target)
17+
// data.entries() returns iterator, [...data.entries()] returns [["q", "input"]]
18+
const input = [...data.entries()][0][1]
19+
const results = fuse.search(input)
20+
displayResults(input, results)
21+
});
22+
});
23+
})();
24+
25+
function displayResults(input, results) {
26+
const searchResults = document.getElementById('search-result');
27+
searchResults.setAttribute('style', 'display: block;')
28+
searchResults.nextElementSibling.setAttribute('style', 'display: none;')
29+
let html = renderResultsCountHtml(results.length, input)
30+
if (results.length > 0) {
31+
let li = renderResultsItemHtml(results)
32+
html += `<ul>${li}</ul>`
33+
}
34+
searchResults.innerHTML = html
35+
}
36+
37+
function renderResultsCountHtml(count, input) {
38+
let html = `
39+
<div class="TableObject border-gray-light py-3 mt-6">
40+
<div class="user-repo-search-results-summary TableObject-item TableObject-item--primary v-align-top">
41+
<strong>${count}</strong>
42+
results
43+
for "<strong>${input}</strong>"
44+
</div>
45+
</div>
46+
`
47+
return html
48+
}
49+
50+
function renderResultsItemHtml(results) {
51+
// modified from https://github.com/brunocechet/Fuse.js-with-highlight
52+
var highlighter = function(resultItem){
53+
resultItem.matches.forEach((matchItem) => {
54+
var text = resultItem.item[matchItem.key];
55+
var result = []
56+
var matches = [].concat(matchItem.indices);
57+
var pair = matches.shift()
58+
59+
for (var i = 0; i < text.length; i++) {
60+
var char = text.charAt(i)
61+
if (pair && i == pair[0]) {
62+
result.push('<span style="color: red;">')
63+
}
64+
result.push(char)
65+
if (pair && i == pair[1]) {
66+
result.push('</span>')
67+
pair = matches.shift()
68+
}
69+
}
70+
resultItem.highlight = result.join('');
71+
72+
if(resultItem.children && resultItem.children.length > 0){
73+
resultItem.children.forEach((child) => {
74+
highlighter(child);
75+
});
76+
}
77+
});
78+
};
79+
80+
let html = ``
81+
results.forEach(result => {
82+
highlighter(result)
83+
// truncated highlight content
84+
let truncated = result.highlight.substring(0, 2000)
85+
const reg = /(<span style="color: red;">[a-zA-Z0-9\u4e00-\u9fa5]+<\/span>)/g
86+
let array = truncated.split(reg)
87+
// drop unstable part
88+
array.pop()
89+
let content = ""
90+
if (array.length > 0) {
91+
content = array.join('')
92+
} else {
93+
// fallback to no highlighted truncated content
94+
content = result.item.content.substring(0, 2000)
95+
}
96+
html += `
97+
<li class="col-12 d-flex width-full py-4 border-top color-border-secondary public source">
98+
<div class="col-12 d-inline-block">
99+
<div class="d-inline-block mb-1">
100+
<h3 class="wb-break-all">
101+
<a href="${result.item.permalink}">${result.item.title}</a>
102+
</h3>
103+
</div>
104+
105+
<div>
106+
<div class="col-12 d-inline-block text-gray mb-2 pr-4">
107+
${content} ...
108+
</div>
109+
</div>
110+
111+
</div>
112+
</li>
113+
`
114+
})
115+
return html
116+
}

post/index.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Posts on ❮ Z-Shell ❯</title><link>https://github.zshell.dev/post/</link><description>Recent content in Posts on ❮ Z-Shell ❯</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sun, 23 Mar 2025 00:02:28 +0000</lastBuildDate><atom:link href="https://github.zshell.dev/post/index.xml" rel="self" type="application/rss+xml"/><item><title>Typeset</title><link>https://github.zshell.dev/post/zsh/cheatsheet/typeset/</link><pubDate>Mon, 20 Mar 2023 01:39:43 +0000</pubDate><guid>https://github.zshell.dev/post/zsh/cheatsheet/typeset/</guid><description>&lt;h2 id="typeset">Typeset&lt;/h2>
1+
<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Posts on ❮ Z-Shell ❯</title><link>https://github.zshell.dev/post/</link><description>Recent content in Posts on ❮ Z-Shell ❯</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sun, 23 Mar 2025 05:21:30 +0000</lastBuildDate><atom:link href="https://github.zshell.dev/post/index.xml" rel="self" type="application/rss+xml"/><item><title>Typeset</title><link>https://github.zshell.dev/post/zsh/cheatsheet/typeset/</link><pubDate>Mon, 20 Mar 2023 01:39:43 +0000</pubDate><guid>https://github.zshell.dev/post/zsh/cheatsheet/typeset/</guid><description>&lt;h2 id="typeset">Typeset&lt;/h2>
22
&lt;p>Set or display attributes and values for shell parameters.
33
Except as noted below for control flags that change the behavior, a parameter is created for each name that does not already
44
refer to one. When inside a function, a new parameter is created for every name (even those that already exist) and is unset again when the function completes.

post/zsh/cheatsheet/typeset/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</span><span class=path-divider>/</span>
99
<strong class="css-truncate css-truncate-target mr-1" style=max-width:410px><a href=https://github.zshell.dev/post/zsh/cheatsheet/typeset/>Typeset</a></strong></h1><div class="note m-0">Created <relative-time datetime="Mon, 20 Mar 2023 01:39:43 +0000" class=no-wrap>Mon, 20 Mar 2023 01:39:43 +0000</relative-time>
1010
<span class=file-info-divider></span>
11-
Modified <relative-time datetime="Sun, 23 Mar 2025 00:02:28 +0000" class=no-wrap>Sun, 23 Mar 2025 00:02:28 +0000</relative-time></div></div></div></div></div></div></div><div class="container-lg px-3 new-discussion-timeline"><div class="repository-content gist-content"><div><div class="js-gist-file-update-container js-task-list-container file-box"><div id=file-pytest class="file my-2"><div id=post-header class="file-header d-flex flex-md-items-center flex-items-start sticky-header" style=z-index:2><div class="file-info d-flex flex-md-items-center flex-items-start flex-order-1 flex-auto"><div class="text-mono f6 flex-auto pr-3 flex-order-2 flex-md-order-1 mt-2 mt-md-0"><summary id=toc-toggle onclick=clickToc() class="btn btn-octicon m-0 mr-2 p-2"><svg aria-hidden="true" viewBox="0 0 16 16" height="16" width="16" class="octicon octicon-list-unordered"><path fill-rule="evenodd" d="M2 4a1 1 0 100-2 1 1 0 000 2zm3.75-1.5a.75.75.0 000 1.5h8.5a.75.75.0 000-1.5h-8.5zm0 5a.75.75.0 000 1.5h8.5a.75.75.0 000-1.5h-8.5zm0 5a.75.75.0 000 1.5h8.5a.75.75.0 000-1.5h-8.5zM3 8A1 1 0 111 8a1 1 0 012 0zm-1 6a1 1 0 100-2 1 1 0 000 2z"/></svg></summary><details-menu class=SelectMenu id=toc-details style="display: none;"><div class="SelectMenu-modal rounded-3 mt-1" style=max-height:340px><div class="SelectMenu-list SelectMenu-list--borderless p-2" style=overscroll-behavior:contain id=toc-list></div></div></details-menu>2948 Words</div><div class="file-actions flex-order-2 pt-0"></div></div></div><div class="Box-body px-5 pb-5" style=z-index:1><article class="markdown-body entry-content container-lg"><h2 id=typeset>Typeset</h2><p>Set or display attributes and values for shell parameters.
11+
Modified <relative-time datetime="Sun, 23 Mar 2025 05:21:30 +0000" class=no-wrap>Sun, 23 Mar 2025 05:21:30 +0000</relative-time></div></div></div></div></div></div></div><div class="container-lg px-3 new-discussion-timeline"><div class="repository-content gist-content"><div><div class="js-gist-file-update-container js-task-list-container file-box"><div id=file-pytest class="file my-2"><div id=post-header class="file-header d-flex flex-md-items-center flex-items-start sticky-header" style=z-index:2><div class="file-info d-flex flex-md-items-center flex-items-start flex-order-1 flex-auto"><div class="text-mono f6 flex-auto pr-3 flex-order-2 flex-md-order-1 mt-2 mt-md-0"><summary id=toc-toggle onclick=clickToc() class="btn btn-octicon m-0 mr-2 p-2"><svg aria-hidden="true" viewBox="0 0 16 16" height="16" width="16" class="octicon octicon-list-unordered"><path fill-rule="evenodd" d="M2 4a1 1 0 100-2 1 1 0 000 2zm3.75-1.5a.75.75.0 000 1.5h8.5a.75.75.0 000-1.5h-8.5zm0 5a.75.75.0 000 1.5h8.5a.75.75.0 000-1.5h-8.5zm0 5a.75.75.0 000 1.5h8.5a.75.75.0 000-1.5h-8.5zM3 8A1 1 0 111 8a1 1 0 012 0zm-1 6a1 1 0 100-2 1 1 0 000 2z"/></svg></summary><details-menu class=SelectMenu id=toc-details style="display: none;"><div class="SelectMenu-modal rounded-3 mt-1" style=max-height:340px><div class="SelectMenu-list SelectMenu-list--borderless p-2" style=overscroll-behavior:contain id=toc-list></div></div></details-menu>2948 Words</div><div class="file-actions flex-order-2 pt-0"></div></div></div><div class="Box-body px-5 pb-5" style=z-index:1><article class="markdown-body entry-content container-lg"><h2 id=typeset>Typeset</h2><p>Set or display attributes and values for shell parameters.
1212
Except as noted below for control flags that change the behavior, a parameter is created for each name that does not already
1313
refer to one. When inside a function, a new parameter is created for every name (even those that already exist) and is unset again when the function completes.
1414
See Local Parameters in zshparam(1). The same rules apply to special shell parameters, which retain their special attributes when made local.</p><p>For each name=value assignment, the parameter name is set to value.</p><p>If the shell option TYPESET_SILENT is not set, for each remaining name that refers to a parameter that is already set, the

readme/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
</span><span class=path-divider>/</span>
99
<strong class="css-truncate css-truncate-target mr-1" style=max-width:410px><a href=https://github.zshell.dev/readme/></a></strong></h1><div class="note m-0">Created <relative-time datetime="Mon, 01 Jan 0001 00:00:00 +0000" class=no-wrap>Mon, 01 Jan 0001 00:00:00 +0000</relative-time>
1010
<span class=file-info-divider></span>
11-
Modified <relative-time datetime="Sun, 23 Mar 2025 00:02:28 +0000" class=no-wrap>Sun, 23 Mar 2025 00:02:28 +0000</relative-time></div></div></div></div></div></div></div><div class="container-lg px-3 new-discussion-timeline"><div class="repository-content gist-content"><div><div class="js-gist-file-update-container js-task-list-container file-box"><div id=file-pytest class="file my-2"><div id=post-header class="file-header d-flex flex-md-items-center flex-items-start sticky-header" style=z-index:2><div class="file-info d-flex flex-md-items-center flex-items-start flex-order-1 flex-auto"><div class="text-mono f6 flex-auto pr-3 flex-order-2 flex-md-order-1 mt-2 mt-md-0"><summary id=toc-toggle onclick=clickToc() class="btn btn-octicon m-0 mr-2 p-2"><svg aria-hidden="true" viewBox="0 0 16 16" height="16" width="16" class="octicon octicon-list-unordered"><path fill-rule="evenodd" d="M2 4a1 1 0 100-2 1 1 0 000 2zm3.75-1.5a.75.75.0 000 1.5h8.5a.75.75.0 000-1.5h-8.5zm0 5a.75.75.0 000 1.5h8.5a.75.75.0 000-1.5h-8.5zm0 5a.75.75.0 000 1.5h8.5a.75.75.0 000-1.5h-8.5zM3 8A1 1 0 111 8a1 1 0 012 0zm-1 6a1 1 0 100-2 1 1 0 000 2z"/></svg></summary><details-menu class=SelectMenu id=toc-details style="display: none;"><div class="SelectMenu-modal rounded-3 mt-1" style=max-height:340px><div class="SelectMenu-list SelectMenu-list--borderless p-2" style=overscroll-behavior:contain id=toc-list></div></div></details-menu>0 Words</div><div class="file-actions flex-order-2 pt-0"></div></div></div><div class="Box-body px-5 pb-5" style=z-index:1><article class="markdown-body entry-content container-lg"><p><a href=https://www.zshell.dev><img src=https://github.com/z-shell/.github/raw/main/profile/img/branch_box.png#max-size80 alt=LOGO#center></a></p><p><a href=https://github.com/z-shell><img src=https://raw.githubusercontent.com/z-shell/.github/main/metrics/plugin/metrics.svg#size80 alt=Metrics#center></a></p><p><a href=https://github.com/orgs/z-shell/repositories><img src=https://raw.githubusercontent.com/z-shell/.github/main/metrics/plugin/repositories_metrics.svg#size80 alt=Repositories#center></a></p><p><a href=https://github.com/orgs/z-shell/projects><img src=https://github.zshell.dev/.github/plugin/followup/followup.svg#size80 alt=Followup#center></a></p><p><a href=https://translate.zshell.dev><img src=https://badges.awesome-crowdin.com/translation-200015146-2.png#max-size80 alt=Translations#center></a></p></article></div></div></div></div></div></div></main></div><script type=application/javascript src=https://github.zshell.dev/js/toc.js></script><link rel=stylesheet href=https://github.zshell.dev/css/toc.css><div class="footer container-xl width-full p-responsive"><div class="position-relative d-flex flex-row-reverse flex-lg-row flex-wrap flex-lg-nowrap flex-justify-center flex-lg-justify-between flex-sm-items-center pt-6 pb-2 mt-6 f6 text-gray border-top border-gray-light"><a aria-label=Homepage title=GitHub class="footer-octicon d-none d-lg-block mr-lg-4" href=https://github.zshell.dev/><svg height="24" class="octicon octicon-mark-github" viewBox="0 0 16 16" width="24"><path fill-rule="evenodd" d="M8 0C3.58.0.0 3.58.0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38.0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95.0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12.0.0.67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15.0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48.0 1.07-.01 1.93-.01 2.2.0.21.15.46.55.38A8.013 8.013.0 0016 8c0-4.42-3.58-8-8-8z"/></svg></a><ul class="list-style-none d-flex flex-wrap col-12 flex-justify-center flex-lg-justify-between mb-2 mb-lg-0"><li class="mr-3 mr-lg-0">Theme by <a href=https://github.com/MeiK2333/github-style>github-style</a></li></ul></div><div class="d-flex flex-justify-center pb-6"><span class="f6 text-gray-light"></span></div></div></body><script type=application/javascript src=https://github.zshell.dev/js/github-style.js></script></html>
11+
Modified <relative-time datetime="Sun, 23 Mar 2025 05:21:30 +0000" class=no-wrap>Sun, 23 Mar 2025 05:21:30 +0000</relative-time></div></div></div></div></div></div></div><div class="container-lg px-3 new-discussion-timeline"><div class="repository-content gist-content"><div><div class="js-gist-file-update-container js-task-list-container file-box"><div id=file-pytest class="file my-2"><div id=post-header class="file-header d-flex flex-md-items-center flex-items-start sticky-header" style=z-index:2><div class="file-info d-flex flex-md-items-center flex-items-start flex-order-1 flex-auto"><div class="text-mono f6 flex-auto pr-3 flex-order-2 flex-md-order-1 mt-2 mt-md-0"><summary id=toc-toggle onclick=clickToc() class="btn btn-octicon m-0 mr-2 p-2"><svg aria-hidden="true" viewBox="0 0 16 16" height="16" width="16" class="octicon octicon-list-unordered"><path fill-rule="evenodd" d="M2 4a1 1 0 100-2 1 1 0 000 2zm3.75-1.5a.75.75.0 000 1.5h8.5a.75.75.0 000-1.5h-8.5zm0 5a.75.75.0 000 1.5h8.5a.75.75.0 000-1.5h-8.5zm0 5a.75.75.0 000 1.5h8.5a.75.75.0 000-1.5h-8.5zM3 8A1 1 0 111 8a1 1 0 012 0zm-1 6a1 1 0 100-2 1 1 0 000 2z"/></svg></summary><details-menu class=SelectMenu id=toc-details style="display: none;"><div class="SelectMenu-modal rounded-3 mt-1" style=max-height:340px><div class="SelectMenu-list SelectMenu-list--borderless p-2" style=overscroll-behavior:contain id=toc-list></div></div></details-menu>0 Words</div><div class="file-actions flex-order-2 pt-0"></div></div></div><div class="Box-body px-5 pb-5" style=z-index:1><article class="markdown-body entry-content container-lg"><p><a href=https://www.zshell.dev><img src=https://github.com/z-shell/.github/raw/main/profile/img/branch_box.png#max-size80 alt=LOGO#center></a></p><p><a href=https://github.com/z-shell><img src=https://raw.githubusercontent.com/z-shell/.github/main/metrics/plugin/metrics.svg#size80 alt=Metrics#center></a></p><p><a href=https://github.com/orgs/z-shell/repositories><img src=https://raw.githubusercontent.com/z-shell/.github/main/metrics/plugin/repositories_metrics.svg#size80 alt=Repositories#center></a></p><p><a href=https://github.com/orgs/z-shell/projects><img src=https://github.zshell.dev/.github/plugin/followup/followup.svg#size80 alt=Followup#center></a></p><p><a href=https://translate.zshell.dev><img src=https://badges.awesome-crowdin.com/translation-200015146-2.png#max-size80 alt=Translations#center></a></p></article></div></div></div></div></div></div></main></div><script type=application/javascript src=https://github.zshell.dev/js/toc.js></script><link rel=stylesheet href=https://github.zshell.dev/css/toc.css><div class="footer container-xl width-full p-responsive"><div class="position-relative d-flex flex-row-reverse flex-lg-row flex-wrap flex-lg-nowrap flex-justify-center flex-lg-justify-between flex-sm-items-center pt-6 pb-2 mt-6 f6 text-gray border-top border-gray-light"><a aria-label=Homepage title=GitHub class="footer-octicon d-none d-lg-block mr-lg-4" href=https://github.zshell.dev/><svg height="24" class="octicon octicon-mark-github" viewBox="0 0 16 16" width="24"><path fill-rule="evenodd" d="M8 0C3.58.0.0 3.58.0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38.0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95.0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12.0.0.67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15.0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48.0 1.07-.01 1.93-.01 2.2.0.21.15.46.55.38A8.013 8.013.0 0016 8c0-4.42-3.58-8-8-8z"/></svg></a><ul class="list-style-none d-flex flex-wrap col-12 flex-justify-center flex-lg-justify-between mb-2 mb-lg-0"><li class="mr-3 mr-lg-0">Theme by <a href=https://github.com/MeiK2333/github-style>github-style</a></li></ul></div><div class="d-flex flex-justify-center pb-6"><span class="f6 text-gray-light"></span></div></div></body><script type=application/javascript src=https://github.zshell.dev/js/github-style.js></script></html>

0 commit comments

Comments
 (0)