-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
143 lines (143 loc) · 11.5 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<!doctype html><html lang=en dir=auto>
<head><meta charset=utf-8>
<meta http-equiv=x-ua-compatible content="IE=edge">
<meta name=viewport content="width=device-width,initial-scale=1,shrink-to-fit=no">
<meta name=robots content="index, follow">
<title>找個地方復健作文能力</title>
<meta name=description content>
<meta name=author content>
<link rel=canonical href=https://lynii12.github.io/>
<link crossorigin=anonymous href=/assets/css/stylesheet.min.c88963fe2d79462000fd0fb1b3737783c32855d340583e4523343f8735c787f0.css integrity="sha256-yIlj/i15RiAA/Q+xs3N3g8MoVdNAWD5FIzQ/hzXHh/A=" rel="preload stylesheet" as=style>
<link rel=icon href=https://lynii12.github.io/favicon.ico>
<link rel=icon type=image/png sizes=16x16 href=https://lynii12.github.io/favicon-16x16.png>
<link rel=icon type=image/png sizes=32x32 href=https://lynii12.github.io/favicon-32x32.png>
<link rel=apple-touch-icon href=https://lynii12.github.io/apple-touch-icon.png>
<link rel=mask-icon href=https://lynii12.github.io/safari-pinned-tab.svg>
<meta name=theme-color content="#2e2e33">
<meta name=msapplication-TileColor content="#2e2e33">
<meta name=generator content="Hugo 0.87.0">
<link rel=alternate type=application/rss+xml href=https://lynii12.github.io/index.xml>
<link rel=alternate type=application/json href=https://lynii12.github.io/index.json>
<noscript>
<style>#theme-toggle,.top-link{display:none}</style>
<style>@media(prefers-color-scheme:dark){:root{--theme:rgb(29, 30, 32);--entry:rgb(46, 46, 51);--primary:rgb(218, 218, 219);--secondary:rgb(155, 156, 157);--tertiary:rgb(65, 66, 68);--content:rgb(196, 196, 197);--hljs-bg:rgb(46, 46, 51);--code-bg:rgb(55, 56, 62);--border:rgb(51, 51, 51)}.list{background:var(--theme)}.list:not(.dark)::-webkit-scrollbar-track{background:0 0}.list:not(.dark)::-webkit-scrollbar-thumb{border-color:var(--theme)}}</style>
</noscript><meta property="og:title" content="找個地方復健作文能力">
<meta property="og:description" content>
<meta property="og:type" content="website">
<meta property="og:url" content="https://lynii12.github.io/">
<meta name=twitter:card content="summary">
<meta name=twitter:title content="找個地方復健作文能力">
<meta name=twitter:description content>
<script type=application/ld+json>{"@context":"https://schema.org","@type":"Organization","name":"找個地方復健作文能力","url":"https://lynii12.github.io/","description":"","thumbnailUrl":"https://lynii12.github.io/favicon.ico","sameAs":["https://github.com/lynii12","mailto:[email protected]"]}</script>
</head>
<body class=list id=top>
<script>localStorage.getItem("pref-theme")==="dark"?document.body.classList.add('dark'):localStorage.getItem("pref-theme")==="light"?document.body.classList.remove('dark'):window.matchMedia('(prefers-color-scheme: dark)').matches&&document.body.classList.add('dark')</script>
<header class=header>
<nav class=nav>
<div class=logo>
<a href=https://lynii12.github.io/ accesskey=h title="找個地方復健作文能力 (Alt + H)">找個地方復健作文能力</a>
<span class=logo-switches>
<button id=theme-toggle accesskey=t title="(Alt + T)"><svg id="moon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"/></svg><svg id="sun" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/></svg>
</button>
</span>
</div>
<ul id=menu>
<li>
<a href=https://lynii12.github.io/search title="search (Alt + /)" accesskey=/>
<span>search</span>
</a>
</li>
<li>
<a href=https://lynii12.github.io/posts/ title=posts>
<span>posts</span>
</a>
</li>
</ul>
</nav>
</header>
<main class=main>
<article class="first-entry home-info">
<header class=entry-header>
<h1>找個地方復健作文能力</h1>
</header>
<section class=entry-content>
<p>👨🦼 🌞</p>
</section>
<footer class=entry-footer>
<div class=social-icons>
<a href=https://github.com/lynii12 target=_blank rel="noopener noreferrer me" title=Github><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37.0 00-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44.0 0020 4.77 5.07 5.07.0 0019.91 1S18.73.65 16 2.48a13.38 13.38.0 00-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07.0 005 4.77 5.44 5.44.0 003.5 8.55c0 5.42 3.3 6.61 6.44 7A3.37 3.37.0 009 18.13V22"/></svg>
</a>
<a href=mailto:[email protected] target=_blank rel="noopener noreferrer me" title=Email><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 21" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 4h16c1.1.0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1.0-2-.9-2-2V6c0-1.1.9-2 2-2z"/><polyline points="22,6 12,13 2,6"/></svg>
</a>
</div>
</footer>
</article>
<article class=post-entry>
<header class=entry-header>
<h2>Functional Programming 筆記
</h2>
</header>
<section class=entry-content>
<p>重要的概念 function 是 first class,可作為參數,也可當作output immutable curry function -> 將multiple arity function 拆作unary function, curry 將參數變得有序,參數的優先順序會影響function 的實用程度,most specific -> least specific,least specific 通常像是 data pure function -> no side effect point free programming composition, library like lamda or lodash associative property -> 1 + (2 + 3) or (1 + 2) + 3 debug in composition 常見 side effect outside the world like console.log same input, different outputs global state like use constants in the function mutable, mutate the state in the application </p>
</section>
<footer class=entry-footer><span title="2022-02-05 15:26:15 +0800 CST">February 5, 2022</span></footer>
<a class=entry-link aria-label="post link to Functional Programming 筆記" href=https://lynii12.github.io/posts/functional-programming/></a>
</article>
<article class=post-entry>
<header class=entry-header>
<h2>多個網址參數儲存方式
</h2>
</header>
<section class=entry-content>
<p>搜尋參數儲存複雜的資料格式
用URLSearchParams API 儲存陣列 // get url const searchParams = new URLSearchParams('?name=1&name=2&name=3') searchParams.getAll('name') // ['1', '2', '3', '4'] // set url const names = ['1', '2', '3', '4'] const searchParams = new URLSearchParams(names.map(name => ['name', name])) searchParams.toString() // name=1&name=2&name=3&name=4 用 encodeURIComponent 加上 decodeURIComponent 的組合將字串編碼 // 拿 fb 的網址作測試 // get url const searchParams = 'name%2Cdelivery%2Ccampaign_name%2Cbid%2Cbudget%2Cactions%3Alink_click' decodeURIComponent(searchParams) // 'name,delivery,campaign_name,bid,budget,actions:link_click' // set url const data = 'name,delivery,campaign_name,bid,budget,actions:link_click' encodeURIComponent(data) // name%2Cdelivery%2Ccampaign_name%2Cbid%2Cbudget%2Cactions%3Alink_click 附註:encodeURI 和 encodeURIComponent 的差異是後者還會對保留字元(:、/、;、?...</p>
</section>
<footer class=entry-footer><span title="2022-01-26 09:09:00 +0800 CST">January 26, 2022</span></footer>
<a class=entry-link aria-label="post link to 多個網址參數儲存方式" href=https://lynii12.github.io/posts/multiple-url-parameter/></a>
</article>
<article class=post-entry>
<header class=entry-header>
<h2>next 設定公版頁
</h2>
</header>
<section class=entry-content>
<p>next 是hydration ssr 的框架,導轉頁面時會重新做hydration,當不同頁面有共同元件,不想要導轉時重新render 時,可以運用next 定義_app.js 的設定公版頁
舉例專案現在有兩個頁面,一個 a 頁面,一個 b 頁面
cd next-project touch /page/a.js touch /page/b.js const APage = () => { return <div><Nav />A</div> } const BPage = () => { return <div><Nav />B</div> } 兩個頁面都需要顯示 Nav ,透過連結跳轉頁面時會發現Nav 都會閃一下重新載入,這和想像中的行為不同,預期希望只異動頁面內容(顯示 A 或是 B)
這種情形可以用 next 提供的 _app.js ,可以透過這個檔案作全域的設定,像是匯入全域的css 檔案,store provider 等,而公版頁也可以在這裡設定,像是
// 移除Nav 元件 const APage = () => { return <div>A</div> } // 移除Nav 元件 const BPage = () => { return <div>B</div> } export default function MyApp(props) { return ( <div> <Nav /> <Component {....</p>
</section>
<footer class=entry-footer><span title="2021-08-28 10:41:58 +0800 CST">August 28, 2021</span></footer>
<a class=entry-link aria-label="post link to next 設定公版頁" href=https://lynii12.github.io/posts/next-layout/></a>
</article>
<article class=post-entry>
<header class=entry-header>
<h2>my first post
</h2>
</header>
<section class=entry-content>
<p>第一篇文章 ✊
使用 hugo 建制自己的部落格,目的是希望養成書寫的習慣,順便能紀錄遇到的問題或工具
套用的模版是 Hugo PaperMod
snippet 新增文章 hugo new --kind post content/posts/<name> code highlight
console.log('hello internet!'); 本機開發 hugo server -D </p>
</section>
<footer class=entry-footer><span title="2021-08-26 23:50:10 +0800 CST">August 26, 2021</span></footer>
<a class=entry-link aria-label="post link to my first post" href=https://lynii12.github.io/posts/my-first-post/></a>
</article>
</main>
<footer class=footer>
<span>© 2022 <a href=https://lynii12.github.io/>找個地方復健作文能力</a></span>
<span>
Powered by
<a href=https://gohugo.io/ rel="noopener noreferrer" target=_blank>Hugo</a> &
<a href=https://git.io/hugopapermod rel=noopener target=_blank>PaperMod</a>
</span>
</footer>
<a href=#top aria-label="go to top" title="Go to Top (Alt + G)" class=top-link id=top-link accesskey=g><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 6" fill="currentcolor"><path d="M12 6H0l6-6z"/></svg>
</a>
<script>let menu=document.getElementById('menu');menu&&(menu.scrollLeft=localStorage.getItem("menu-scroll-position"),menu.onscroll=function(){localStorage.setItem("menu-scroll-position",menu.scrollLeft)}),document.querySelectorAll('a[href^="#"]').forEach(a=>{a.addEventListener("click",function(b){b.preventDefault();var a=this.getAttribute("href").substr(1);window.matchMedia('(prefers-reduced-motion: reduce)').matches?document.querySelector(`[id='${decodeURIComponent(a)}']`).scrollIntoView():document.querySelector(`[id='${decodeURIComponent(a)}']`).scrollIntoView({behavior:"smooth"}),a==="top"?history.replaceState(null,null," "):history.pushState(null,null,`#${a}`)})})</script>
<script>var mybutton=document.getElementById("top-link");window.onscroll=function(){document.body.scrollTop>800||document.documentElement.scrollTop>800?(mybutton.style.visibility="visible",mybutton.style.opacity="1"):(mybutton.style.visibility="hidden",mybutton.style.opacity="0")}</script>
<script>document.getElementById("theme-toggle").addEventListener("click",()=>{document.body.className.includes("dark")?(document.body.classList.remove('dark'),localStorage.setItem("pref-theme",'light')):(document.body.classList.add('dark'),localStorage.setItem("pref-theme",'dark'))})</script>
</body>
</html>