move to vue-blogify

This commit is contained in:
patarapolw committed 2019-08-22 08:28:55 +07:00
1 parent 4fe597979c
commit bb1e397daa
90 files changed
+10347 -2666

No files matched your search

+34
View File
@@ -0,0 +1,34 @@
<template lang="pug">
div
b-navbar(toggleable="lg" type="dark" variant="success")
b-navbar-brand(to="/") {{title}}
b-navbar-toggle(target="nav-collapse")
b-collapse#nav-collapse(is-nav)
b-navbar-nav
b-nav-item(v-for="t in tabs" :key="t.name" :to="t.to" :url="t.url") {{t.name}}
b-navbar-nav.ml-auto
b-nav-form(@submit.stop.prevent)
b-form-input.mr-sm-2(size="sm" placeholder="Type to search" style="min-width: 200px" v-model="g.q")
b-nav-item(to="/about") About
b-container.mt-3
b-row
b-col(sm=12 lg=8)
router-view
b-col(sm=12 lg=4)
sidebar
</template>
<script lang="ts">
import { Vue, Component } from "vue-property-decorator";
import Sidebar from "@/layouts/Sidebar.vue";
import { g } from "@/shared";
@Component({
components: {Sidebar}
})
export default class App extends Vue {
private title = g.config.title || "BLOG"
private tabs = g.config.tabs || []
private g = g;
}
</script>
-9
View File
@@ -1,9 +0,0 @@
.hanzi-img {
display: flex;
justify-content: center;
align-items: center;
width: 100px;
height: 100px;
font-size: 80px;
font-family: serif;
}
-39
View File
@@ -1,39 +0,0 @@
import "./disqus";
import "./app.scss";
window.addEventListener("keydown", (ev) => {
if (ev.key === "s") {
const s = window.getSelection().toString();
if (s) {
speak(s);
}
}
});
window.onload = () => {
for (const a of Array.from(document.getElementsByTagName("a"))) {
const href = a.href;
console.log(href);
const m = /^slide:github:([^/]+)\/([^/]+)\/(.+)$/.exec(href);
if (m) {
const url = new URL("https://reveal-md.herokuapp.com/");
url.searchParams.append("q", `https://raw.githubusercontent.com/${m[1]}/${m[2]}/master/src/resources/${m[3]}`);
a.href = url.href;
}
}
}
function speak(s: string) {
const allVoices = speechSynthesis.getVoices();
let vs = allVoices.filter((v) => /zh[-_]cn/i.test(v.lang));
if (vs.length === 0) {
vs = allVoices.filter((v) => /zh/i.test(v.lang));
}
if (vs.length > 0) {
const u = new SpeechSynthesisUtterance(s);
u.lang = vs[0].lang;
u.rate = 0.8;
speechSynthesis.speak(u);
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

+6
View File
@@ -0,0 +1,6 @@
declare const POSTS: Record<string, any>[];
declare const CONFIG: Record<string, any>;
declare const README: string;
declare module "@/plugins/render";
declare module 'vue-disqus';
-15
View File
@@ -1,15 +0,0 @@
/**
* RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
* LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/
/*
var disqus_config = function () {
this.page.url = PAGE_URL; // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
*/
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = 'https://zhdiary.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
+11
View File
@@ -0,0 +1,11 @@
<template lang="pug">
:markdown
### Sorry, but no post can be found.
</template>
<script lang="ts">
import Vue from 'vue'
export default Vue.extend({
})
</script>
+20
View File
@@ -0,0 +1,20 @@
<template lang="pug">
b-card
header: h1 Write a post!
.post-content
p Go to <code>./public/posts</code> folder and create your first post, creating <code>first-post.md</code> file filled with the following content:
pre.
---
title: First post
tag:
- news
---
# This is my first post!
</template>
<script lang="ts">
import Vue from 'vue'
export default Vue.extend({
})
</script>
+116
View File
@@ -0,0 +1,116 @@
<template lang="pug">
b-card.mb-3.post
.post-meta.mb-3
.float-right {{dateString}}
.post-meta-author
a(:href="author.link"): b-img(rounded="circle" :src="author.avatar")
a(:href="author.link") {{author.login}}
h2
b-link(v-if="isTeaser" :to="to") {{title}}
span(v-else="") {{title}}
div
div(v-if="isTeaser" v-html="teaser")
div(v-else="" v-html="content")
</template>
<script lang="ts">
import { Vue, Component, Prop } from "vue-property-decorator";
import moment, { Moment } from "moment";
import matter from "gray-matter";
import HyperPug from "hyperpug";
import { pugFilters, md } from "@/plugins/render";
import { g } from '../shared';
@Component
export default class Post extends Vue {
@Prop() private filename!: string;
@Prop({default: false}) private isTeaser!: boolean;
private matter: any = {};
get title() {
if (this.matter.data) {
return this.matter.data.title || ""
}
return ""
}
get moment(): Moment | null {
if (this.matter.data && this.matter.data.date) {
return moment(this.matter.data.date);
}
return null;
}
get dateString() {
return this.moment ? this.moment.format("ddd D MMMM YYYY") : "";
}
get author() {
const author = (this.matter.data ? this.matter.data.author : null) || g.config.author;
if (!author) {
return {
link: "#",
avatar: "#",
login: "Anonymous"
}
}
return author;
}
get url() {
return this.filename.replace(/^public\//, process.env.BASE_URL || "/")
}
get to() {
const m = this.moment;
if (m) {
return `/p/${m.format("YYYY")}/${m.format("MM")}/${
this.filename
.replace(/^.*\//, "")
.replace(/\.[^.]+$/, "")}`;
}
return "";
}
get teaser() {
const { content } = this.matter;
const m = /^([^]+)\s+===\s+([^]+)$/.exec(content || "");
if (m) {
return this.parseContent(m[1]);
}
return this.parseContent(content || "");
}
get content() {
const { content } = this.matter;
const m = /^([^]+)\s+===\s+([^]+)$/.exec(content || "");
console.log(m)
if (m) {
return this.parseContent(m[1] + (m[2] || ""));
}
return this.parseContent(content || "");
}
public async mounted() {
console.log(this.url);
this.matter = matter(await (await fetch(this.url)).text());
}
private parseContent(s: string): string {
if (/\.pug$/.test(this.filename)) {
s = new HyperPug(pugFilters).parse(s);
} else if (/\.html?$/.test(this.filename)) {
return s;
}
return md.md2html(s);
}
}
</script>
+84
View File
@@ -0,0 +1,84 @@
<template lang="pug">
div
b-card.mb-3
:markdown
#### Record my journey to Chinese by [@polvcode](https://polvcode.dev)
Highlight text and press "s" to speak.
a.twitter-timeline(href="https://twitter.com/ChinesePol" data-height="600") Tweets by ChinesePol
b-card
h3 Tag cloud
span.mr-3(v-for="t in tags" :key="t.name" :class="t.class")
b-link(:to="'/tag/' + t.name") {{t.name}}
</template>
<script lang="ts">
import { Vue, Component } from "vue-property-decorator";
import { g } from '../shared';
@Component
export default class Sidebar extends Vue {
get tags() {
const tagList: Record<string, number> = {};
g.posts.forEach((p) => {
for (const t of p.tag || []) {
tagList[t] = (tagList[t] || 0) + 1;
}
});
return Object.keys(tagList).sort().map((t) => {
return {
name: t,
class: (() => {
const count = tagList[t];
if (count > 30) {
return "c30"
} else if (count > 20) {
return "c20"
} else if (count > 10) {
return "c10"
} else if (count > 5) {
return "c5"
} else if (count > 3) {
return "c3"
} else if (count > 1) {
return "c2"
}
return "c1"
})()
}
});
}
}
</script>
<style lang="scss" scoped>
.c30 {
font-size: 40px;
}
.c20 {
font-size: 30px;
}
.c10 {
font-size: 25px;
}
.c5 {
font-size: 20px;
}
.c3 {
font-size: 16px;
}
.c2 {
font-size: 13px;
}
.c1 {
font-size: 10px;
}
</style>
+16
View File
@@ -0,0 +1,16 @@
import '@babel/polyfill';
import 'mutationobserver-shim';
import Vue from 'vue';
import './plugins/bootstrap-vue';
import App from './App.vue';
import router from './router';
import VueDisqus from 'vue-disqus';
import "./plugins/gtag";
Vue.config.productionTip = false
Vue.use(VueDisqus)
new Vue({
router,
render: h => h(App)
}).$mount('#app')
-3
View File
@@ -1,3 +0,0 @@
---
title: '中文 Diary - My Chinese learning diary'
---
-143
View File
@@ -1,143 +0,0 @@
---
title: "千字文"
date: "2019-08-10"
tags:
- 千字文
- 汉字
---
1
天地玄黃,宇宙洪荒。
日月盈昃,辰宿列張。
寒來暑往,秋收冬藏。
閏餘成歲,律呂調陽。
雲騰致雨,露結為霜。
金生麗水,玉出崑岡。
劍號巨闕,珠稱夜光。
果珍李柰,菜重芥薑。
海咸河淡,鱗潛羽翔。
2
龍師火帝,鳥官人皇。
始制文字,乃服衣裳。
推位讓國,有虞陶唐。
弔民伐罪,周發殷湯。
坐朝問道,垂拱平章。
愛育黎首,臣伏戎羌。
遐邇一體,率賓歸王。
鳴鳳在竹,白駒食場。
化被草木,賴及萬方。
===
3
蓋此身髮,四大五常。
恭惟鞠養,豈敢毀傷。
女慕貞絜,男效才良。
知過必改,得能莫忘。
罔談彼短,靡恃己長。
信使可覆,器欲難量。
墨悲絲染,詩讚羔羊。
景行維賢,克念作聖。
德建名立,形端表正。
空谷傳聲,虛堂習聽。
禍因惡積,福緣善慶。
尺璧非寶,寸陰是競。
資父事君,曰嚴與敬。
孝當竭力,忠則盡命。
臨深履薄,夙興溫凊。
似蘭斯馨,如松之盛。
川流不息,淵澄取映。
容止若思,言辭安定。
篤初誠美,慎終宜令。
榮業所基,藉甚無竟。
學優登仕,攝職從政。
存以甘棠,去而益詠。
樂殊貴賤,禮別尊卑。
上和下睦,夫唱婦隨。
外受傅訓,入奉母儀。
諸姑伯叔,猶子比兒。
孔懷兄弟,同氣連根。
交友投分,切磨箴規。
仁慈隱惻,造次弗離。
節義廉退,顛沛匪虧。
性靜情逸,心動神疲。
守真志滿,逐物意移。
堅持雅操,好爵自縻。
4
都邑華夏,東西二京。
背邙面洛,浮渭據涇。
宮殿盤郁,樓觀飛驚。
圖寫禽獸,畫彩仙靈。
丙舍傍啟,甲帳對楹。
肆筵設席,鼓瑟吹笙。
升階納陛,弁轉疑星。
右通廣內,左達承明。
既集墳典,亦聚群英。
杜稿鍾隸,漆書壁經。
府羅將相,路俠槐卿。
戶封八縣,家給千兵。
高冠陪輦,驅轂振纓。
世祿侈富,車駕肥輕。
策功茂實,勒碑刻銘。
磻溪伊尹,佐時阿衡。
奄宅曲阜,微旦孰營。
桓公匡合,濟弱扶傾。
綺回漢惠,說感武丁。
俊乂密勿,多士寔寧。
晉楚更霸,趙魏困橫。
假途滅虢,踐土會盟。
何遵約法,韓弊煩刑。
起翦頗牧,用軍最精。
宣威沙漠,馳譽丹青。
九州禹跡,百郡秦并。
岳宗泰岱,禪主云亭。
雁門紫塞,雞田赤城。
昆池碣石,鉅野洞庭。
曠遠綿邈,岩岫杳冥。
5
治本於農,務茲稼穡。
俶載南畝,我藝黍稷。
稅熟貢新,勸賞黜陟。
孟軻敦素,史魚秉直。
庶幾中庸,勞謙謹敕。
聆音察理,鑒貌辨色。
貽厥嘉猷,勉其祗植。
省躬譏誡,寵增抗極。
殆辱近恥,林皋幸即。
兩疏見機,解組誰逼。
索居閒處,沉默寂寥。
求古尋論,散慮逍遙。
欣奏累遣,慼謝歡招。
渠荷的歷,園莽抽條。
枇杷晚翠,梧桐蚤凋。
陳根委翳,落葉飄搖。
游鵾獨運,凌摩絳霄。
6
耽讀玩市,寓目囊箱。
易輶攸畏,屬耳垣牆。
具膳餐飯,適口充腸。
飽飫烹宰,飢厭糟糠。
親戚故舊,老少異糧。
妾御績紡,待巾帷房。
紈扇圓潔,銀燭煒煌。
晝眠夕寐,藍筍象床。
弦歌酒宴,接杯舉觴。
矯手頓足,悅豫且康。
嫡後嗣續,祭祀烝嘗。
稽顙再拜,悚懼恐惶。
箋牒簡要,顧答審詳。
骸垢想浴,執熱願涼。
驢騾犢特,駭躍超驤。
誅斬賊盜,捕獲叛亡。
7
布射僚丸,嵇琴阮嘯。
恬筆倫紙,鈞巧任釣。
釋紛利俗,竝皆佳妙。
毛施淑姿,工顰妍笑。
年矢每催,曦暉朗曜。
璿璣懸斡,晦魄環照。
指薪修祜,永綏吉劭。
矩步引領,俯仰廊廟。
束帶矜庄,徘徊瞻眺。
孤陋寡聞,愚蒙等誚。
謂語助者,焉哉乎也。
-52
View File
@@ -1,52 +0,0 @@
---
title: "千字文 - 1/1"
date: "2019-08-11"
tags:
- 千字文
- 汉字
---
.w-100.mt-3: h3.text-center 天地玄黃,宇宙洪荒。
.w-100
figure.d-inline-block
img(src="https://upload.wikimedia.org/wikipedia/commons/a/ab/天-order.gif" height=100)
figcaption.text-center tian1
figure.d-inline-block
img(src="https://upload.wikimedia.org/wikipedia/commons/f/fb/地-order.gif" height=100)
figcaption.text-center di4
figure.d-inline-block
img(src="https://upload.wikimedia.org/wikipedia/commons/d/d3/玄-order.gif" height=100)
figcaption.text-center xuan2
figure.d-inline-block
img(src="https://upload.wikimedia.org/wikipedia/commons/e/e7/黄-order.gif" height=100)
figcaption.text-center huang2
.w-100
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/23431.gif" height=100)
figcaption.text-center yu3
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/23449.gif" height=100)
figcaption.text-center zhou4
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/27946.gif" height=100)
figcaption.text-center hong2
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/33618.gif" height=100)
figcaption.text-center huang1
| ===
.w-100.mt-3
:markdown
宇宙 | yǔzhòu | universe / cosmos
宇航 | yǔháng | space flight
宇航员 | yǔhángyuán | astronaut
宇宙飞船 | yǔzhòufēichuán | spacecraft
防洪 | fánghóng | flood control / flood prevention
山洪 | shānhóng | mountain flash flood / mountain torrent
荒 | huāng | desolate / shortage / scarce / out of practice / absurd / uncultivated / to neglect
荒野 | huāngyě | wilderness
style.
table td:first-child {
width: 10em;
}
-65
View File
@@ -1,65 +0,0 @@
---
title: "千字文 - 1/2"
date: "2019-08-12"
tags:
- 千字文
- 汉字
---
.w-100.mt-3: h3.text-center 日月盈昃,辰宿列張。
.w-100
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/26085.gif" height=100)
figcaption.text-center ri4
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/26376.gif" height=100)
figcaption.text-center yue4
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/30408.gif" height=100)
figcaption.text-center ying2
figure.d-inline-block
.hanzi-img 昃
figcaption.text-center ze4
.w-100
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/36784.gif" height=100)
figcaption.text-center chen2
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/23487.gif" height=100)
figcaption.text-center su4
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/21015.gif" height=100)
figcaption.text-center lie2
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/24373.gif" height=100)
figcaption.text-center zhang1
| ===
.w-100.mt-3
:markdown
盈利 | yínglì | profit / gain
轻盈 | qīngyíng | graceful / lithe / light and graceful / lighthearted / relaxed
盈亏 | yíngkuī | profit and loss / waxing and waning
昃 | zè | afternoon / decline
星辰 | xīngchén | stars
时辰 | shíchen | time / one of the 12 two-hour periods of the day
北辰 | Běichén | Polaris / North Star
诞辰 | dànchén | birthday
生辰 | shēngchén | birthday
宿舍 | sùshè | dormitory / dorm room / living quarters / hostel / CL: 間|间
住宿 | zhùsù | to stay at / lodging / accommodation
列表 | lièbiǎo | list
系列 | xìliè | series / set
列 | liè | to arrange / to line up / file / series / (in data tables) column / (Tw) row
序列 | xùliè | sequence
下列 | xiàliè | following
列车 | lièchē | (railway) train
张 | zhāng | to open up / to spread / sheet of paper / classifier for flat objects, sheet / classifier for votes
紧张 (緊張) | jǐnzhāng | nervous / keyed up / intense / tense / strained / in short supply / scarce / CL: 陣|阵
主张 | zhǔzhāng | to advocate / to stand for / view / position / stand / proposition / viewpoint / assertion / CL: 個|个
扩张 (擴張) | kuòzhāng | expansion / dilation / to expand (e.g. one's power or influence) / to broaden
style.
table td:first-child {
width: 10em;
}
-65
View File
@@ -1,65 +0,0 @@
---
title: "千字文 - 1/3"
date: "2019-08-13"
tags:
- 千字文
- 汉字
---
.w-100.mt-3: h3.text-center 寒來暑往,秋收冬藏。
.w-100
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/23506.gif" height=100)
figcaption.text-center han2
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/20358.gif" height=100)
figcaption.text-center lai2
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/26257.gif" height=100)
figcaption.text-center shu3
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/24448.gif" height=100)
figcaption.text-center wang3
.w-100
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/31179.gif" height=100)
figcaption.text-center qiu1
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/25910.gif" height=100)
figcaption.text-center shou1
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/20908.gif" height=100)
figcaption.text-center dong1
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/34255.gif" height=100)
figcaption.text-center cang2
| ===
.w-100.mt-3
:markdown
寒假 | hánjià | winter vacation
伤寒 (傷寒) | shānghán | typhoid
严寒 | yánhán | bitter cold / severe winter
暑期 | shǔqī | summer vacation time
暑假 | shǔjià | summer vacation / CL: 個|个
避暑 | bìshǔ | to be away for the summer holidays / to spend a holiday at a summer resort / to prevent sunstroke
前往 | qiánwǎng | to leave for / to proceed towards / to go
往往 | wǎngwǎng | usually / in many cases / more often than not
往年 | wǎngnián | in former years / in previous years
往返 | wǎngfǎn | to go back and forth / to go to and fro / round trip
过往 (過往) | guòwǎng | to come and go / to have friendly relations with / in the past / previous
交往 | jiāowǎng | to associate (with) / to have contact (with) / to hang out (with) / to date / (interpersonal) relationship / association / contact
以往 | yǐwǎng | in the past / formerly
往事 | wǎngshì | past events / former happenings
秋季 | qiūjì | autumn / fall
春秋 | chūnqiū | spring and autumn / four seasons / year / a person's age / annals (used in book titles)
冬季 | dōngjì | winter
冬天 | dōngtiān | winter / CL: 個|个
春夏秋冬 | chūnxiàqiūdōng | the four seasons / spring, summer, autumn and winter
冬瓜 | dōngguā | wax gourd (Cucurbitaceae, Benincasa hispida) / white gourd / white hairy melon / Chinese squash
收藏 | shōucáng | to hoard / to collect / collection / to bookmark (Internet)
style.
table td:first-child {
width: 10em;
}
-83
View File
@@ -1,83 +0,0 @@
---
title: "千字文 - 1/4"
date: "2019-08-14"
tags:
- 千字文
- 汉字
---
.w-100.mt-3: h3.text-center 閏餘成歲,律呂調陽。
.w-100
figure.d-inline-block
.hanzi-img 閏
figcaption.text-center run4
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/39192.gif" height=100)
figcaption.text-center yu2
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/25104.gif" height=100)
figcaption.text-center cheng2
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/27506.gif" height=100)
figcaption.text-center sui4
.w-100
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/24459.gif" height=100)
figcaption.text-center lu:4
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/21570.gif" height=100)
figcaption.text-center lu:3
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/35519.gif" height=100)
figcaption.text-center diao4
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/38525.gif" height=100)
figcaption.text-center yang2
| ===
.w-100.mt-3
:markdown
闰年 | rùnnián | leap year / (lunar calendar) year with a thirteen intercalary month
闰月 | rùnyuè | intercalary month in the lunar calendar / leap month
敖闰 | Áorùn | Dragon King of the West Sea, Ao Run, also Ao Ji (敖吉)
余额 (餘額) | yú'é | balance (of an account, bill etc) / surplus / remainder
剩余 (剩餘) | shèngyú | remainder / surplus
其余 (其餘) | qíyú | the rest / the others / remaining / remainder / apart from them
业余 (業餘) | yèyú | in one's spare time / outside working hours / amateur (historian etc)
多余 (多餘) | duōyú | superfluous / unnecessary / surplus
岁月 (歲月) | suìyuè | years / time
周岁 (週歲) | zhōusuì | one full year (e.g. on child's first birthday)
万岁 (萬歲) | wànsuì | Long live (the king, the revolution etc)! / Your Majesty / His Majesty
岁时 (歲時) | suìshí | season / time of the year
贺岁 (賀歲) | hèsuì | to extend New Year's greetings / to pay a New Year's visit
法律 | fǎlǜ | law / CL: 條|条, 套, 個|个
律师 | lǜshī | lawyer
规律 | guīlǜ | rule (e.g. of science) / law of behavior / regular pattern / rhythm / discipline
纪律 | jìlǜ | discipline
吕 | lǚ | pitchpipe, pitch standard, one of the twelve semitones in the traditional tone system
吕梁 | Lǚliáng | Lüliang prefecture-level city in Shanxi 山西
调研 | diàoyán | to investigate and research / research / investigation
调 | diào | to transfer / to move (troops or cadres) / to investigate / to enquire into / accent / view / argument / key (in music) / mode (music) / tune / tone / melody
调 | tiáo | to harmonize / to reconcile / to blend / to suit well / to adjust / to regulate / to season (food) / to provoke / to incite
调整 | tiáozhěng | to adjust / adjustment / revision / CL: 個|个
空调 | kōngtiáo | air conditioning / air conditioner (including units that have a heating mode) / CL: 臺|台
调查 | diàochá | investigation / inquiry / to investigate / to survey / survey / (opinion) poll / CL: 項|项, 個|个
强调 (強調) | qiángdiào | to emphasize (a statement) / to stress
调节 (調節) | tiáojié | to adjust / to regulate / to harmonize / to reconcile (accountancy etc)
调试 | tiáoshì | to debug / to adjust components during testing / debugging
调用 | diàoyòng | to transfer (for a specific purpose) / to allocate / (computing) to invoke (a command, an application etc)
协调 (協調) | xiétiáo | to coordinate / to harmonize / to fit together / to match (colors etc) / harmonious / concerted
调剂 (調劑) | tiáojì | to adjust / to balance / to make up a medical prescription
色调 | sèdiào | hue / tone
调理 | tiáolǐ | to nurse one's health / to recuperate / to take care of / to look after / to discipline / to educate / to train / to prepare food / (dialect) to make fun of / (medicine) to opsonize
太阳 (太陽) | tàiyang | sun / CL: 個|个 / abbr. for 太陽穴|太阳穴
阳光 (陽光) | yángguāng | sunshine / CL: 線|线 / transparent (open to public scrutiny)
斜阳 (斜陽) | xiéyáng | setting sun
朝阳 (朝陽) | cháoyáng | to be exposed to the sun / in a position facing the sun
朝阳 (朝陽) | zhāoyáng | the morning sun
HSK 4
style.
table td:first-child {
width: 10em;
}
-102
View File
@@ -1,102 +0,0 @@
---
title: "千字文 - 1/5"
date: "2019-08-15"
tags:
- 千字文
- 汉字
---
.w-100.mt-3: h3.text-center 雲騰致雨,露結為霜。
.w-100
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/38642.gif" height=100)
figcaption.text-center yun2
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/39472.gif" height=100)
figcaption.text-center teng2
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/33268.gif" height=100)
figcaption.text-center zhi4
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/38632.gif" height=100)
figcaption.text-center yu3
.w-100
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/38706.gif" height=100)
figcaption.text-center lu4
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/32080.gif" height=100)
figcaption.text-center jie2
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/28858.gif" height=100)
figcaption.text-center wei4
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/38684.gif" height=100)
figcaption.text-center shuang1
| ===
.w-100.mt-3
:markdown
风云 | fēngyún | weather / unstable situation
白云 | báiyún | white cloud
腾讯 (騰訊) | Téngxùn | Tencent see 騰訊控股有限公司|腾讯控股有限公司
腾 | téng | to soar / to gallop / to prance / to turn over / to vacate / to clear
奔腾 | Bēnténg | Pentium (microprocessor by Intel)
奔腾 | bēnténg | (of waves) to surge forward / to roll on in waves / to gallop
腾飞 | téngfēi | lit. to fly upwards swiftly / fig. rapid advance / rapidly developing (situation)
折腾 | zhēteng | to toss from side to side (e.g. sleeplessly) / to repeat sth over and over again / to torment sb / to play crazy / to squander (time, money)
图腾 | túténg | totem (loanword)
一致 | yīzhì | unanimous / identical (views or opinions)
致力 | zhìlì | to work for / to devote one's efforts to
致 (緻) | zhì | fine / delicate
致 | zhì | to send / to devote / to deliver / to cause / to convey
导致 (導致) | dǎozhì | to lead to / to create / to cause / to bring about
致辞 (致辭) | zhìcí | to express in words or writing / to make a speech (esp. short introduction, vote of thanks, afterword, funeral homily etc) / to address (an audience) / same as 致詞|致词
精致 (精緻) | jīngzhì | delicate / fine / exquisite / refined
致命 | zhìmìng | fatal / mortal / deadly / to sacrifice one's life
细致 (細緻) | xìzhì | delicate / fine / careful / meticulous / painstaking
致敬 | zhìjìng | to greet / to pay respects to
下雨 | xiàyǔ | to rain
风雨 | fēngyǔ | wind and rain / the elements / trials and hardships
暴雨 | bàoyǔ | torrential rain / rainstorm / CL: 場|场, 陣|阵
烟雨 (煙雨) | yānyǔ | misty rain / drizzle
雨伞 (雨傘) | yǔsǎn | umbrella / CL: 把
降雨 | jiàngyǔ | precipitation / rainfall
雷阵雨 | léizhènyǔ | thunder shower
结构 (結構) | jiégòu | structure / composition / makeup / architecture / CL: 座, 個|个
结果 | jiēguǒ | to bear fruit / CL: 個|个
结果 | jiéguǒ | outcome / result / conclusion / in the end / as a result / to kill / to dispatch
结合 | jiéhé | to combine / to link / to integrate / binding / CL: 次
结束 | jiéshù | termination / to finish / to end / to conclude / to close
总结 (總結) | zǒngjié | to sum up / to conclude / summary / résumé / CL: 個|个
结婚 | jiéhūn | to marry / to get married / CL: 次
结算 | jiésuàn | to settle a bill / to close an account
结局 | jiéjú | conclusion / ending
成为 | chéngwéi | to become / to turn into
行为 | xíngwéi | action / conduct / behavior / activity
为什么 | wèishénme | why? / for what reason?
因为 | yīnwèi | because / owing to / on account of
华为 (華為) | Huáwéi | Huawei (brand)
为何 | wèihé | why
作为 | zuòwéi | one's conduct / deed / activity / accomplishment / achievement / to act as / as (in the capacity of) / qua / to view as / to look upon (sth as) / to take sth to be
为了 | wèile | in order to / for the purpose of / so as to
分为 | fēnwéi | to divide sth into (parts) / to subdivide
为准 | wéizhǔn | to serve as the norm / ...shall prevail (as standard for rules, regulations, price etc)
面霜 | miànshuāng | facial cream (cosmetics)
眼霜 | yǎnshuāng | eye cream
风霜 | fēngshuāng | wind and frost / fig. hardships
冰霜 | bīngshuāng | moral integrity / austerity
防晒霜 (防曬霜) | fángshàishuāng | suntan lotion / sunscreen cream
雪上加霜 | xuěshàngjiāshuāng | to add hail to snow (idiom); one disaster on top of another / to make things worse in a bad situation
隔离霜 (隔離霜) | gélíshuāng | pre-makeup cream / makeup base / foundation primer
披露 | pīlù | to reveal / to publish / to make public / to announce
露 | lòu | to show / to reveal / to betray / to expose
露 | lù | dew / syrup / nectar / outdoors (not under cover) / to show / to reveal / to betray / to expose
透露 | tòulù | to leak out / to divulge / to reveal
泄露 | xièlù | to leak (information) / to divulge / also pr. [xie4 lou4]
露营 (露營) | lùyíng | to camp out / camping
style.
table td:first-child {
width: 10em;
}
-83
View File
@@ -1,83 +0,0 @@
---
title: "千字文 - 1/6"
date: "2019-08-16"
tags:
- 千字文
- 汉字
---
.w-100.mt-3: h3.text-center 金生麗水,玉出崑岡。
.w-100
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/37329.gif" height=100)
figcaption.text-center jin1
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/29983.gif" height=100)
figcaption.text-center sheng1
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/40599.gif" height=100)
figcaption.text-center li4
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/27700.gif" height=100)
figcaption.text-center shui3
.w-100
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/29577.gif" height=100)
figcaption.text-center yu4
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/20986.gif" height=100)
figcaption.text-center chu1
figure.d-inline-block
.hanzi-img 崑
figcaption.text-center kun1
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/23713.gif" height=100)
figcaption.text-center gang1
| ===
.w-100.mt-3
:markdown
资金 | zījīn | funds / funding / capital
基金 | jījīn | fund
黄金 (黃金) | huángjīn | gold / golden (opportunity) / prime (time)
金属 (金屬) | jīnshǔ | metal / CL: 種|种
公积金 (公積金) | gōngjījīn | official reserves / accumulated fund
金额 (金額) | jīn'é | sum of money / monetary value
金币 (金幣) | jīnbì | gold coin
五金 | wǔjīn | metal hardware (nuts and bolts) / the five metals: gold, silver, copper, iron and tin 金銀銅鐵錫|金银铜铁锡
生产 (生產) | shēngchǎn | to produce / to manufacture / to give birth to a child
招生 | zhāoshēng | to enroll new students / to get students
本科生 | běnkēshēng | undergraduate student
卫生 (衛生) | wèishēng | health / hygiene / sanitation
发生 (發生) | fāshēng | to happen / to occur / to take place / to break out
生活 | shēnghuó | life / activity / to live / livelihood
学生 (學生) | xuésheng | student / schoolchild
生态 (生態) | shēngtài | ecology
美丽 (美麗) | měilì | beautiful
华丽 (華麗) | huálì | gorgeous
高丽 (高麗) | Gāolí | Korean Goryeo dynasty, 918-1392 / Korea, esp. in context of art and culture
艳丽 (艷麗) | yànlì | gorgeous / garish and beautiful
水平 | shuǐpíng | level (of achievement etc) / standard / horizontal
水利 | shuǐlì | water conservancy / irrigation works
水果 | shuǐguǒ | fruit / CL: 個|个
水电 (水電) | shuǐdiàn | hydroelectric power / plumbing and electricity
防水 | fángshuǐ | waterproof
热水 (熱水) | rèshuǐ | hot water
水晶 | shuǐjīng | crystal
玉米 | yùmǐ | corn / maize / CL: 粒
出口 | chūkǒu | an exit / CL: 個|个 / to speak / to export / (of a ship) to leave port
出游 (出遊) | chūyóu | to go on a tour / to have an outing
提出 | tíchū | to raise (an issue) / to propose / to put forward / to suggest / to post (on a website) / to withdraw (cash)
出现 (出現) | chūxiàn | to appear / to arise / to emerge / to show up
出来 (出來) | chūlái | to come out / to appear / to arise
出来 (出來) | chulai | (after a verb, indicates coming out, completion of an action, or ability to discern or detect)
出版 | chūbǎn | to publish
退出 | tuìchū | to withdraw / to abort / to quit / to log out (computing)
昆山 (崑山) | Kūnshān | Kunshan county level city in Suzhou 蘇州|苏州, Jiangsu
昆仑 (崑崙) | Kūnlún | Kunlun (Karakorum) mountain range in Xinjiang
山冈 (山岡) | shāngāng | mound / small hill
style.
table td:first-child {
width: 10em;
}
-88
View File
@@ -1,88 +0,0 @@
---
title: "千字文 - 1/7"
date: "2019-08-17"
tags:
- 千字文
- 汉字
---
.w-100.mt-3: h3.text-center 劍號巨闕,珠稱夜光。
.w-100
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/21133.gif" height=100)
figcaption.text-center jian4
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/34399.gif" height=100)
figcaption.text-center hao4
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/24040.gif" height=100)
figcaption.text-center ju4
figure.d-inline-block
.hanzi-img 闕
figcaption.text-center que4
.w-100
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/29664.gif" height=100)
figcaption.text-center zhu1
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/31281.gif" height=100)
figcaption.text-center cheng1
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/22812.gif" height=100)
figcaption.text-center ye4
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/20809.gif" height=100)
figcaption.text-center guang1
| ===
.w-100.mt-3
:markdown
刀剑 (刀劍) | dāojiàn | sword
剑桥 (劍橋) | Jiànqiáo | Cambridge
利剑 (利劍) | lìjiàn | sharp sword
剑道 (劍道) | jiàndào | kendō (sports)
账号 (賬號) | zhànghào | account / username
号码 (號碼) | hàomǎ | number / CL: 堆, 個|个
编号 (編號) | biānhào | to number / numbering / serial number
型号 (型號) | xínghào | model (particular version of a manufactured article) / type (product specification in terms of color, size etc)
巨大 | jùdà | huge / immense / very large / tremendous / gigantic / enormous
巨人 | jùrén | giant
巨头 (巨頭) | jùtóu | tycoon / magnate / big player (including company, country, school etc) / big shot
巨蟹 | Jùxiè | Cancer (star sign)
巨蟒 | jùmǎng | python
巨型 | jùxíng | giant / enormous
阙 (闕) | quē | used in place of 缺 (old) / mistake
阙 (闕) | què | Imperial city watchtower (old) / fault / deficiency
宫阙 (宮闕) | gōngquè | palace
城阙 (城闕) | chéngquè | watchtower on either side of a city gate / (literary) city / imperial palace
金阙 (金闕) | jīnquè | the imperial palace
珠宝 (珠寶) | zhūbǎo | pearls / jewels / precious stones
珍珠 | zhēnzhū | pearl / CL: 顆|颗
明珠 | míngzhū | pearl / jewel (of great value)
简称 (簡稱) | jiǎnchēng | to be abbreviated to / abbreviation / short form
名称 (名稱) | míngchēng | name (of a thing) / name (of an organization)
称 (稱) | chèn | to fit / balanced / suitable
称 (稱) | chēng | to weigh / to state / to name / name / appellation / to praise
职称 (職稱) | zhíchēng | one's professional position / title / job title
人称 (人稱) | rénchēng | person (first person, second person etc in grammar) / called / known as
称为 (稱為) | chēngwéi | called / to call sth (by a name) / to name
夜间 (夜間) | yèjiān | nighttime / evening or night (e.g. classes)
夜晚 | yèwǎn | night / CL: 個|个
深夜 | shēnyè | very late at night
午夜 | wǔyè | midnight
黑夜 | hēiyè | night
夜色 | yèsè | night scene / the dim light of night
夜景 | yèjǐng | nightscape
熬夜 | áoyè | to stay up late or all night
阳光 (陽光) | yángguāng | sunshine / CL: 線|线 / transparent (open to public scrutiny)
时光 (時光) | shíguāng | time / era / period of time
光明 | guāngmíng | light / radiance / (fig.) bright (prospects etc) / openhearted
光电 (光電) | guāngdiàn | photoelectric
风光 (風光) | fēngguāng | scene / view / sight / landscape / to be well-regarded / to be well-off / grand (dialect) / impressive (dialect)
曝光 | bàoguāng | to expose (photography) / (fig.) to expose (a scandal) / (advertising) exposure / Taiwan pr. [pu4 guang1]
激光 | jīguāng | laser
style.
table td:first-child {
width: 10em;
}
-96
View File
@@ -1,96 +0,0 @@
---
title: "千字文 - 1/8"
date: "2019-08-18"
tags:
- 千字文
- 汉字
---
.w-100.mt-3: h3.text-center 果珍李柰,菜重芥薑。
.w-100
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/26524.gif" height=100)
figcaption.text-center guo3
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/29645.gif" height=100)
figcaption.text-center zhen1
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/26446.gif" height=100)
figcaption.text-center li3
figure.d-inline-block
.hanzi-img 柰
figcaption.text-center nai4
.w-100
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/33756.gif" height=100)
figcaption.text-center cai4
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/37325.gif" height=100)
figcaption.text-center zhong4
figure.d-inline-block
.hanzi-img 柰
figcaption.text-center jie4
figure.d-inline-block
.hanzi-img 薑
figcaption.text-center jiang1
| ===
.w-100.mt-3
:markdown
如果 | rúguǒ | if / in case / in the event that
结果 (結果) | jiēguǒ | to bear fruit / CL: 個|个
结果 (結果) | jiéguǒ | outcome / result / conclusion / in the end / as a result / to kill / to dispatch
效果 | xiàoguǒ | result / effect / quality / CL: 個|个
成果 | chéngguǒ | result / achievement / gain / profit / CL: 個|个
苹果 (蘋果) | píngguǒ | apple / CL: 個|个, 顆|颗
珍珠 | zhēnzhū | pearl / CL: 顆|颗
珍惜 | zhēnxī | to treasure / to value / to cherish
珍爱 (珍愛) | zhēn'ài | to cherish
珍贵 (珍貴) | zhēnguì | precious
珍藏 | zhēncáng | collection / to collect (valuables)
珍稀 | zhēnxī | rare / precious and uncommon
珍品 | zhēnpǐn | valuable object / curio
行李 | xíngli | luggage / CL: 件
李子 | lǐzi | plum / CL: 個|个
柰 | nài | crab-apple / how can one help
菜单 (菜單) | càidān | menu / CL: 份, 張|张
蔬菜 | shūcài | vegetables / CL: 種|种
白菜 | báicài | Chinese cabbage / pak choi / CL: 棵, 個|个
菜鸟 | càiniǎo | (coll.) sb new to a particular subject / rookie / beginner / newbie
重新 | chóngxīn | again / once more / re-
重点 (重點) | chóngdiǎn | to recount (e.g. results of election) / to re-evaluate
重点 (重點) | zhòngdiǎn | important point / main point / focus / key (project etc) / to focus on / to put the emphasis on
重大 | zhòngdà | great / important / major / significant
重要 | zhòngyào | important / significant / major
严重 (嚴重) | yánzhòng | grave / serious / severe / critical
重复 (重複|重覆) | chóngfù | to repeat / to duplicate / CL: 個|个
重生 | chóngshēng | rebirth
重视 (重視) | zhòngshì | to attach importance to sth / to value
隆重 | lóngzhòng | grand / prosperous / ceremonious / solemn
注重 | zhùzhòng | to pay attention to / to emphasize
重置 | chóngzhì | to reset / reset / replacement
郑重 | zhèngzhòng | serious / solemn
菜谱 (菜譜) | càipǔ | menu (in restaurant) / recipe / cookbook
菜单栏 (菜單欄) | càidānlán | menu bar (computing)
韭菜 | jiǔcài | garlic chives (Allium tuberosum), aka Chinese chives / (fig.) retail investors who lose their money to more experienced operators (i.e. they are "harvested" like garlic chives)
菠菜 | bōcài | spinach / CL: 棵
芥末 | jièmo | mustard / wasabi
芥 | jiè | mustard
芥菜 | jiècài | leaf mustard (Brassica juncea) / also pr. [gai4 cai4]
荆芥 (荊芥) | jīngjiè | schizonepeta, herb used in Chinese medicine
芥蒂 | jièdì | an obstruction / barrier / ill-feeling / grudge
芥蓝 (芥藍) | gàilán | Chinese broccoli / Chinese kale / cabbage mustard / Brassica oleracea var. alboglabra / also pr. [jie4 lan2]
芥子气 (芥子氣) | jièzǐqì | mustard gas
芥菜籽 | jiècàizǐ | mustard seed
青芥辣 | qīngjièlà | horseradish / wasabi / green mustard
拾芥 | shíjiè | to pick up cress / fig. sth easy to do / a piece of cake
生姜 (生薑) | shēngjiāng | fresh ginger
姜黄 (薑黃) | jiānghuáng | turmeric
干姜 (乾薑) | gānjiāng | dried ginger
姜汁 (薑汁) | jiāngzhī | ginger ale
仔姜 (仔薑) | zǐjiāng | stem ginger
style.
table td:first-child {
width: 10em;
}
-98
View File
@@ -1,98 +0,0 @@
---
title: "千字文 - 1/9"
date: "2019-08-19"
tags:
- 千字文
- 汉字
---
.w-100.mt-3: h3.text-center 海咸河淡,鱗潛羽翔。
.w-100
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/28023.gif" height=100)
figcaption.text-center hai3
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/21688.gif" height=100)
figcaption.text-center xian2
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/27827.gif" height=100)
figcaption.text-center he2
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/28129.gif" height=100)
figcaption.text-center dan4
.w-100
figure.d-inline-block
.hanzi-img 鱗
figcaption.text-center lin2
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/28507.gif" height=100)
figcaption.text-center qian2
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/32701.gif" height=100)
figcaption.text-center yu3
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/32724.gif" height=100)
figcaption.text-center xiang2
| ===
.w-100.mt-3
:markdown
海报 (海報) | hǎibào | poster / playbill / notice
海外 | hǎiwài | overseas / abroad
海洋 | hǎiyáng | ocean / CL: 個|个
海口 | hǎikǒu | estuary / coastal inlet / river mouth / seaport / see also 誇海口|夸海口
海关 (海關) | hǎiguān | customs (i.e. border crossing inspection) / CL: 個|个
南海 | Nán Hǎi | South China Sea
海绵 (海綿) | hǎimián | sponge (zoology) / sponge (piece of absorbent material, either natural or made from plastic etc) / foam rubber
航海 | hánghǎi | sailing / navigation / voyage by sea
海贼 (海賊) | hǎizéi | pirate
海鲜 (海鮮) | hǎixiān | seafood
咸鱼 (鹹魚) | xiányú | salted fish
咸 | xián | all / everyone / each / widespread / harmonious
咸 (鹹) | xián | salted / salty / stingy / miserly
咸水 (鹹水) | xiánshuǐ | salt water / brine
咸鸭蛋 (鹹鴨蛋) | xiányādàn | salted duck egg
咸菜 (鹹菜) | xiáncài | salted vegetables / pickles
黄河 (黃河) | Huáng Hé | Yellow River or Huang He
银河 (銀河) | Yínhé | Milky Way / our galaxy
天河 | Tiānhé | Milky Way / Tianhe district of Guangzhou city 廣州市|广州市, Guangdong
河流 | héliú | river / CL: 條|条
淡 | dàn | insipid / diluted / weak / mild / light in color / tasteless / fresh / indifferent / nitrogen
淡定 | dàndìng | calm and collected / unperturbed
平淡 | píngdàn | flat / dull / ordinary / nothing special
淡化 | dànhuà | to water down / to play down / to trivialize / to weaken / to become dull with time / to desalinate / desalination
淡淡 | dàndàn | faint / dim / dull / insipid / unenthusiastic / indifferent
淡水 | dànshuǐ | potable water (water with low salt content) / fresh water
淡雅 | dànyǎ | simple and elegant
淡出 | dànchū | to fade out (cinema) / to withdraw from (politics, acting etc) / to fade from (memory)
清淡 | qīngdàn | light (of food, not greasy or strongly flavored) / insipid / slack (sales)
暗淡 | àndàn | dark / dim (light) / dull (color) / drab / (fig.) gloomy / bleak
惨淡 (慘淡) | cǎndàn | dark / gloomy / dismal / by painstaking effort
淡漠 | dànmò | apathetic / indifferent / unsympathetic
鳞 (鱗) | lín | scales (of fish)
鳞片 (鱗片) | línpiàn | scale / fish scales
鱼鳞 (魚鱗) | yúlín | fish scales
鳞甲 (鱗甲) | línjiǎ | scale / plate of armor
鳞状细胞癌 (鱗狀細胞癌) | línzhuàngxìbāo'ái | squamous cell carcinoma
遍体鳞伤 (遍體鱗傷) | biàntǐlínshāng | covered all over with cuts and bruises / beaten black and blue / be a mass of bruises
鳞状 (鱗狀) | línzhuàng | scaly / squamous
潜力 (潛力) | qiánlì | potential / capacity
潜 (潛) | qián | hidden / secret / latent / to hide / to conceal / to submerge / to dive
潜水 (潛水) | qiánshuǐ | to dive / to go under water / lurker (Internet slang for sb who reads forum posts but never replies)
潜能 (潛能) | qiánnéng | potential / hidden capability
潜在 (潛在) | qiánzài | hidden / potential / latent
潜艇 (潛艇) | qiántǐng | submarine
羽毛 | yǔmáo | feather / plumage / plume
关羽 (關羽) | Guān Yǔ | Guan Yu (-219), general of Shu and blood-brother of Liu Bei in Romance of the Three Kingdoms, fearsome fighter famous for virtue and loyalty / posthumously worshipped and identified with the guardian Bodhisattva Sangharama
羽绒 (羽絨) | yǔróng | down (soft feathers)
羽翼 | yǔyì | wing / (fig.) assistant
羽化 | yǔhuà | levitation (of Daoist immortal) / to become as light as a feather and ascend to heaven / (in Daoism) to become immortal / to die / of winged insects, to emerge from the cocoon in adult form / eclosion
翔 | xiáng | to soar / to glide / variant of 詳|详
飞翔 (飛翔) | fēixiáng | to circle in the air / to soar
翱翔 | áoxiáng | to soar / to wheel about in the sky
滑翔 | huáxiáng | to glide
style.
table td:first-child {
width: 10em;
}
-51
View File
@@ -1,51 +0,0 @@
---
title: "千字文 - 2/1"
date: "2019-08-20"
tags:
- 千字文
- 汉字
---
.w-100.mt-3: h3.text-center 龍師火帝,鳥官人皇。
.w-100
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/40845.gif" height=100)
figcaption.text-center long2
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/24107.gif" height=100)
figcaption.text-center shi1
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/28779.gif" height=100)
figcaption.text-center huo3
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/24093.gif" height=100)
figcaption.text-center di4
.w-100
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/40165.gif" height=100)
figcaption.text-center niao3
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/23448.gif" height=100)
figcaption.text-center guan1
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/20154.gif" height=100)
figcaption.text-center ren2
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/30343.gif" height=100)
figcaption.text-center huang1
| ===
.w-100.mt-3
:markdown
官方 | guānfāng | government / official (approved or issued by an authority)
官员 (官員) | guānyuán | official (in an organization or government) / administrator
法官 | fǎguān | judge
警官 | jǐngguān | constable / police officer
感官 | gǎnguān | sense / sense organ
指挥官 (指揮官) | zhǐhuīguān | commander
收官 | shōuguān | final part of a go game (see 官子) / endgame / to finish up / to come to the final stage
style.
table td:first-child {
width: 10em;
}
-118
View File
@@ -1,118 +0,0 @@
---
title: "千字文 - 2/2"
date: "2019-08-21"
tags:
- 千字文
- 汉字
---
.w-100.mt-3: h3.text-center 始制文字,乃服衣裳。
.w-100
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/22987.gif" height=100)
figcaption.text-center shi3
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/21046.gif" height=100)
figcaption.text-center zhi4
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/25991.gif" height=100)
figcaption.text-center wen2
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/23383.gif" height=100)
figcaption.text-center zi4
.w-100
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/20035.gif" height=100)
figcaption.text-center nai3
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/26381.gif" height=100)
figcaption.text-center fu2
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/34915.gif" height=100)
figcaption.text-center yi1
figure.d-inline-block
img(src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/35059.gif" height=100)
figcaption.text-center chang2
| ===
.w-100.mt-3
:markdown
开始 (開始) | kāishǐ | to begin / beginning / to start / initial / CL: 個|个
始终 (始終) | shǐzhōng | from beginning to end / all along
初始 | chūshǐ | initial / starting (point)
创始 (創始) | chuàngshǐ | to initiate / to found
控制 | kòngzhì | control / to exercise control over / to contain
制造 (製造) | zhìzào | to manufacture / to make
制作 (製作) | zhìzuò | to make / to manufacture
制度 | zhìdù | system (e.g. political, adminstrative etc) / institution / CL: 個|个
复制 (複製) | fùzhì | to duplicate / to make a copy of / to copy / to reproduce / to clone
制品 (製品) | zhìpǐn | products / goods
编制 (編制) | biānzhì | to establish (a unit or department) / staffing structure (excluding temporary and casual staff)
编制 (編製) | biānzhì | to weave / to plait / to compile / to put together (a lesson plan, budget etc)
强制 (強制) | qiángzhì | to enforce / enforcement / forcibly / compulsory
法制 | fǎzhì | legal system and institutions
法制 (法製) | Fǎzhì | made in France
制药 (制藥) | zhìyào | to manufacture medicine
限制 | xiànzhì | to restrict / to limit / to confine / restriction / limit / CL: 個|个
文件 | wénjiàn | document / file / CL: 份
英文 | Yīngwén | English (language)
文字 | wénzì | character / script / writing / written language / writing style / phraseology / CL: 個|个
文化 | wénhuà | culture / civilization / cultural / CL: 個|个, 種|种
文章 | wénzhāng | article / essay / literary works / writings / hidden meaning / CL: 篇, 段, 頁|页
文明 | wénmíng | civilized / civilization / culture / CL: 個|个
文库 (文庫) | wénkù | collection of documents / library / book series / sequence of data, esp. genome
文学 (文學) | wénxué | literature / CL: 種|种
人文 | rénwén | humanities / human affairs / culture
字符 | zìfú | character (computing)
文字 | wénzì | character / script / writing / written language / writing style / phraseology / CL: 個|个
名字 | míngzi | name (of a person or thing) / CL: 個|个
数字 (數字) | shùzì | numeral / digit / number / figure / amount / digital (electronics etc) / CL: 個|个
字典 | zìdiǎn | dictionary / character dictionary / CL: 本
字母 | zìmǔ | letter (of the alphabet) / CL: 個|个
字体 (字體) | zìtǐ | calligraphic style / typeface / font
汉字 (漢字) | hànzì | Chinese character / CL: 個|个 / Japanese: kanji / Korean: hanja / Vietnamese: hán tự
关键字 (關鍵字) | guānjiànzì | keyword
字词 (字詞) | zìcí | letters or words / words or phrase
数字化 (數字化) | shùzìhuà | to digitalize / digital
写字楼 (寫字樓) | xiězìlóu | office building
字号 (字號) | zìhào | characters and numbers (as used in a code) / alphanumeric code / serial number
字号 (字號) | zìhao | character size / font size / fame / reputation / shop / name of a shop
写字 (寫字) | xiězì | to write characters
字幕 | zìmù | caption / subtitle
字节 (字節) | zìjié | byte
字符串 | zìfúchuàn | string (computer science)
乃至 | nǎizhì | and even / to go so far as to
木乃伊 | mùnǎiyī | mummy (preserved corpse) (loanword)
乃是 | nǎishì | equivalent to either 是 or 就是
康乃馨 | kāngnǎixīn | carnation or clove pink / Dianthus caryophyllus (botany)
乃尔 (乃爾) | nǎi'ěr | thus / like this
服务 (服務) | fúwù | to serve / service / CL: 項|项
服务器 (服務器) | fúwùqì | server (computer) / CL: 臺|台
服装 (服裝) | fúzhuāng | dress / clothing / costume / clothes / CL: 身
衣服 | yīfu | clothes / CL: 件, 套
服饰 (服飾) | fúshì | apparel / clothing and personal adornment
服务业 (服務業) | fúwùyè | service industry
伺服 | sìfú | servo (small electric motor) / computer server
征服 | zhēngfú | to conquer / to subdue / to vanquish
舒服 | shūfu | comfortable / feeling well
内衣 (內衣) | nèiyī | undergarment / underwear / CL: 件
衣柜 (衣櫃) | yīguì | wardrobe / armoire / CL: 個|个
洗衣 | xǐyī | laundry
连衣裙 (連衣裙) | liányīqún | woman's dress / frock / gown
制衣 | zhìyī | clothing manufacture
睡衣 | shuìyī | night clothes / pajamas
卫衣 (衛衣) | wèiyī | sweatshirt
成衣 | chéngyī | ready-made clothes
穿衣 | chuānyī | to wear clothes / clothing
上衣 | shàngyī | jacket / upper outer garment / CL: 件
大衣 | dàyī | overcoat / topcoat / cloak / CL: 件
裳 | cháng | lower garment / skirts / petticoats / garments
霓裳 | Nícháng | Nichang, abbr. for the Tang Dynasty song "Raiment of Rainbows and Feathers" 霓裳羽衣曲 or 霓裳羽衣舞
霓裳 | nícháng | nichang, rainbow colored clothes worn by the Eight Immortals 八仙
衣裳 | yīshang | clothes
衣裳钩儿 (衣裳鈎兒) | yīshanggōur | clothes hook
style.
table td:first-child {
width: 10em;
}
-13
View File
@@ -1,13 +0,0 @@
---
title: "句子 1.1"
date: "2019-08-16 1:00"
tags:
- 千字文
- 句子
---
### Sentence quiz
Please see [`slide:github:patarapolw/zhdiary/slides/句子1.1.md`](slide:github:patarapolw/zhdiary/slides/句子1.1.md)
Highlight text and press "x" inside the presentation to speak.
-13
View File
@@ -1,13 +0,0 @@
---
title: "句子 1.2"
date: "2019-08-17 1:00"
tags:
- 千字文
- 句子
---
### Sentence quiz
Please see [`slide:github:patarapolw/zhdiary/slides/句子1.2.md`](slide:github:patarapolw/zhdiary/slides/句子1.2.md)
Highlight text and press "x" inside the presentation to speak.
-13
View File
@@ -1,13 +0,0 @@
---
title: "句子 1.3"
date: "2019-08-17 2:00"
tags:
- 千字文
- 句子
---
### Sentence quiz
Please see [`slide:github:patarapolw/zhdiary/slides/句子1.3.md`](slide:github:patarapolw/zhdiary/slides/句子1.3.md)
Highlight text and press "x" inside the presentation to speak.
-51
View File
@@ -1,51 +0,0 @@
---
title: "身体1"
date: "2019-08-18 1:00"
tags:
- 分类词汇
- 身体
---
:markdown
From <https://www.yellowbridge.com/chinese/listsearch.php?listID=44>
### Sentence quiz
Please see [`slide:github:patarapolw/zhdiary/slides/身体1.md`](slide:github:patarapolw/zhdiary/slides/身体1.md)
Highlight text and press "x" inside the presentation to speak.
| ===
:markdown
胳膊 | gēbo | arm
手膀 | shǒubǎng | arm
肚子 | dùzi | belly; abdomen; stomach
臀部 | túnbù | butt; buttocks
胸部 | xiōngbù | chest; bosom
手肘 | shǒuzhǒu | elbow
脸 | liǎn | face
手指 | shǒuzhǐ | finger
指甲 | zhǐjia | fingernail
脚 | jiǎo | foot; leg (of an animal or an object); base (of an object); measure word for kicks
头发 | tóufa | hair (on the head)
手 | shǒu | hand; (formal) to hold; person engaged in certain types of work; person skilled in certain types of work; personal(ly); convenient; measure word for skill
头 | tóu | head; hair style; the top; end; beginning or end; a stub; remnant; chief; boss; side; aspect; first; leading; measure word for pigs or livestock
膝盖 | xīgài | knee
腿 | tuǐ | leg
脖子 | bózi | neck
颈项 | jǐngxiàng | neck
肩头 | jiāntóu | on one's shoulders; (dialect) shoulder
手掌 | shǒuzhǎng | palm
肩膀 | jiānbǎng | shoulder
皮肤 | pífū | skin
大腿 | dàtuǐ | thigh
喉咙 | hóulóng | throat; larynx
脚趾 | jiǎozhǐ | toe
腰 | yāo | waist; lower back; pocket; middle; loins
腕 | wàn | wrist; (squid, starfish etc) arm
style.
table td:first-child {
width: 4em;
}
+7
View File
@@ -0,0 +1,7 @@
import Vue from 'vue'
import BootstrapVue from 'bootstrap-vue'
import 'bootstrap/dist/css/bootstrap.min.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'
Vue.use(BootstrapVue)
+22
View File
@@ -0,0 +1,22 @@
import { g } from "@/shared";
import { dotGetter } from './search';
declare const dataLayer: any[];
async function gAnalytics(id: string) {
var d = document, s = d.createElement('script');
s.src = `https://www.googletagmanager.com/gtag/js?id=${id}`;
s.setAttribute('data-timestamp', new Date().toISOString());
(d.head || d.body).appendChild(s);
(window as any).dataLayer = dataLayer || [];
function gtag(...x: any[]){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', id);
}
const id = dotGetter(g.config, "external.google.analytics");
if (id) {
gAnalytics(id);
}
+43
View File
@@ -0,0 +1,43 @@
import showdown from "showdown";
import h from "hyperscript";
export class Markdown {
constructor() {
this.converter = new showdown.Converter({
parseImgDimensions: true
});
this.converter.setFlavor("github");
this.converter.addExtension({
type: "lang",
filter(text) {
const rowRegex = /(?:(?:^|\r?\n)(?:\| )?(?:(?:.* \| )+.+)*(?:.* \| )+.+(?: \|)?(?:$|\r?\n))+/m;
text = text.replace(rowRegex, (p0) => {
return h("table.table", p0.trim().split("\n").map((pi) => {
pi = pi.trim().replace(/^|/, "").replace(/|$/, "")
return h("tr", pi.split(" | ").map((x) => x.trim()).map((qi) => {
return h("td", qi);
}))
})).outerHTML;
});
return text;
}
})
}
md2html(md) {
return this.converter.makeHtml(md);
}
}
export const md = new Markdown();
export const pugFilters = {
markdown: (text) => {
return md.md2html(text);
},
css: (text) => {
return h("style", {innerHTML: text});
}
};
+21
View File
@@ -0,0 +1,21 @@
import SearchParser from "./search";
const p = new SearchParser();
describe("SearchParser.doParse", () => {
[
"",
"a",
"a:b",
"a:b c",
"a:b c:d",
"a:b OR c",
"date:2018-08-12",
"date>2018-08-12",
" tag:分类词汇"
].forEach((q) => {
it(q, () => {
console.dir(p.parseFull(q), {depth: null});
})
});
})
+396
View File
@@ -0,0 +1,396 @@
/**
* Adapted from https://github.com/patarapolw/rep2recall-web/blob/master/src/node/engine/search.ts
*/
import uuid from "uuid/v4";
import moment from "moment";
import { g } from '@/shared';
export interface ISearchParserResult {
is: Set<string>;
sortBy: string | null;
desc: boolean | null;
cond: Record<string, any>;
}
export default class SearchParser {
public is: Set<string> = new Set();
public sortBy: string | null = null;
public desc: boolean | null = null;
private readonly anyOf: Set<string> | null = null;
private readonly isString = new Set(["title", "author", "tag"]);
private readonly isDate = new Set(["date"]);
public filterPosts(q: string): Record<string, any>[] {
const cond = this.parse(q);
let ps = g.posts;
if (this.sortBy) {
ps = ps.sort(sorter(this.sortBy, this.desc || false));
} else {
ps = ps.sort(sorter("date", true));
}
ps = ps.filter(mongoFilter(cond));
return ps;
}
public parse(q: string): Record<string, any> {
this.is = new Set();
this.sortBy = null
this.desc = null;
try {
return this._parse(q);
} catch (e) { }
return {};
}
public parseFull(q: string): ISearchParserResult {
return {
cond: this.parse(q),
is: this.is,
sortBy: this.sortBy,
desc: this.desc
}
}
private _parse(q: string): Record<string, any> {
q = q.trim();
for (const method of [
this.removeBrackets,
this.parseSep(" OR "),
this.parseSep(" "),
this.parseNeg,
this.parseFullExpr,
this.parsePartialExpr
]) {
try {
return method.bind(this)(q);
} catch (e) { }
}
throw new Error();
}
private removeBrackets(q: string) {
if (q[0] === "(" && q[q.length - 1] === ")") {
return this.parse(q.substr(1, q.length - 2));
}
throw new Error("Not bracketed");
}
private parseSep(sep: string) {
return (q: string) => {
const brackets: any = {};
q = q.replace(/\([^)]+\)/g, (p0) => {
const id = uuid();
brackets[id] = p0;
return id;
});
const tokens = q.split(sep);
tokens.forEach((t, i) => {
for (const k of Object.keys(brackets)) {
tokens[i] = tokens[i].replace(k, brackets[k]);
}
});
if (tokens.length >= 2) {
const parsedTokens = tokens.map((t) => this._parse(t)).map((t) => t);
if (parsedTokens.length > 1) {
return { [sep === " OR " ? "$or" : "$and"]: parsedTokens };
} else {
return parsedTokens[0];
}
}
throw new Error(`Not separated by '${sep}'`);
}
}
private parseNeg(q: string) {
if (q[0] === "-") {
const sb = "-sortBy:";
if (q.startsWith(sb) && q !== sb) {
this.sortBy = q.substr(sb.length);
return {};
}
return { $not: this.parse(q.substr(1)) };
}
throw new Error("Not negative");
}
private parseFullExpr(q: string) {
const m = /^([\w-]+)(:|~|[><]=?|=)([\S-]+|"[^"]+")$/.exec(q);
if (m) {
let [_, k, op, v]: any[] = m;
if (v.length > 2 && v[0] === '"' && v[v.length - 1] === '"') {
v = v.substr(1, v.length - 2);
} else {
const m1 = /^\d+(?:\.\d+)?$/.exec(v);
if (m1) {
v = parseFloat(v);
}
}
if (k === "is") {
if (v === "due") {
k = "nextReview";
op = "<=";
v = new Date();
} else if (v === "leech") {
k = "srsLevel";
op = "=";
v = 0;
} else if (v === "new") {
k = "nextReview";
op = "=";;
v = "NULL";
} else {
this.is.add(v);
return {};
}
} else if (k === "sortBy") {
this.sortBy = v;
return {};
}
if (op === ":") {
if (k === "due" || k === "nextReview") {
k = "nextReview";
v = "<="
} else if (k === "created" || k === "modified") {
v = "<=";
}
}
if (v === "NULL") {
v = null;
}
if (this.isDate.has(k)) {
if (v === "NOW") {
v = new Date();
} else if (typeof v === "string") {
const m1 = /^([-+]?\\d+)(\\S*)$/.exec(v);
let isMomentParsed = false;
if (m1) {
try {
v = moment().add(parseInt(m1[1]), m1[2] as any).toDate();
isMomentParsed = true;
} catch (e) { }
}
if (!isMomentParsed) {
try {
v = moment(v).toDate()
} catch (e) { }
}
}
}
// if (moment.isDate(v) && op === ":") {
// op = ">";
// }
if (v) {
if (op === ":") {
if (typeof v === "string" || this.isString.has(k)) {
v = { $substr: v };
}
} else if (op === "~") {
v = { $regex: v.toString() };
} else if (op === ">=") {
v = { $gte: v };
} else if (op === ">") {
v = { $gt: v }
} else if (op === "<=") {
v = { $lte: v };
} else if (op === "<") {
v = { $lt: v };
}
}
return { [k]: v };
}
throw new Error("Not full expression");
}
private parsePartialExpr(q: string) {
if (q && q.indexOf(":") === -1) {
const orCond: any[] = [];
if (this.anyOf) {
for (const a of this.anyOf) {
if (this.isString.has(a)) {
orCond.push({ [a]: { $substr: q } });
} else {
orCond.push({ [a]: q });
}
}
} else {
return {"*": {$substr: q}}
}
if (orCond.length > 1) {
return { $or: orCond };
} else if (orCond.length === 1) {
return orCond[0];
}
return {};
}
throw new Error("Not partial expression");
}
}
export function mongoFilter(cond: any) {
return (item: Record<string, any>): boolean => {
for (const k of Object.keys(cond)) {
if (k[0] === "$") {
if (k === "$and") {
return cond[k].every((x: Record<string, any>) => mongoFilter(x)(item));
} else if (k === "$or") {
return cond[k].some((x: Record<string, any>) => mongoFilter(x)(item));
} else if (k === "$not") {
return !mongoFilter(cond[k])(item);
}
} else {
let itemK = dotGetter(item, k);
if (cond[k] && cond[k].constructor === {}.constructor
&& Object.keys(cond[k]).some((k0) => k0[0] === "$")) {
return (() => {
for (const op of Object.keys(cond[k])) {
try {
if (op === "$regex") {
if (Array.isArray(itemK)) {
return itemK.some(new RegExp(cond[k][op].toString(), "i").test);
} else {
return new RegExp(cond[k][op].toString(), "i").test(itemK);
}
} else if (op === "$startswith") {
if (Array.isArray(itemK)) {
return itemK.some((el) => el.startsWith(cond[k][op]));
} else {
return itemK.startsWith(cond[k][op]);
}
} else if (op === "$substr") {
if (Array.isArray(itemK)) {
return itemK.some((el: string) => el.includes(cond[k][op]));
} else {
return itemK.includes(cond[k][op]);
}
} else if (op === "$exists") {
return (itemK === null || itemK === undefined || itemK === "") === cond[k][op];
} else {
let v = itemK;
let v0 = cond[k][op];
try {
[v, v0] = [parseInt(v), parseInt(v0)];
} catch (e) { }
if (op === "$gte") {
return v >= v0;
} else if (op === "$gt") {
return v > v0;
} else if (op === "$lte") {
return v <= v0;
} else if (op === "$lt") {
return v < v0;
}
}
} catch (e) { }
}
return false;
})();
} else if (Array.isArray(itemK)) {
if (!itemK.includes(cond[k])) {
return false;
}
} else if (itemK !== cond[k]) {
return false;
}
}
}
return true;
}
}
export function dotGetter(d: any, k: string) {
let v = d;
for (const kn of k.split(".")) {
if (v && v.constructor === {}.constructor) {
if (kn === "*") {
v = Object.values(v);
} else {
v = v[kn];
if (v === undefined) {
v = {};
}
}
} else if (Array.isArray(v)) {
try {
v = v[parseInt(kn)];
if (v === undefined) {
v = null;
break;
}
} catch (e) {
v = null;
break;
}
}
}
if (v && v.constructor === {}.constructor && Object.keys(v).length === 0) {
v = null;
}
return v;
}
export function sorter(sortBy?: string, desc?: boolean) {
return (a: any, b: any) => {
if (!sortBy) {
return 0;
}
const m = a[sortBy];
const n = b[sortBy];
if (typeof m === typeof n) {
if (typeof m === "string") {
return desc ? n.localeCompare(m) : m.localeCompare(n);
} else if (typeof m === "number") {
return desc ? n - m : m - n;
} else {
return 0;
}
} else {
const typeDict = {
"number": 1,
"string": 2,
"object": 3
} as any;
const tM = typeDict[typeof m] || -1;
const tN = typeDict[typeof n] || -1;
return desc ? tN - tM : tM - tN;
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 440 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 912 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

-1
View File
@@ -1 +0,0 @@
{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
-104
View File
@@ -1,104 +0,0 @@
---
shuffle: true
js:
- https://patarapolw.github.io/s2speak/index.min.js?key=x
---
罗马人的黄金时代已过去了。
--
- 罗 马 luó mǎ Rome, capital of Italy
- 黄 金 时 代 huáng jīn shí dài golden age
- 已 yǐ already; to stop
- 过 去 guò qù (in the) past
---
黄河是中国的第二大河流。
--
- 河 流 hé liú river
---
哲学上的玄想出自实际情况。
--
- 哲 学 zhé xué philosophy
- 玄 xuán black; mysterious
- 想 出 xiǎng chū to figure out
- 实 际 情 况 shí jì qíng kuàng actual circumstances
---
宇宙毫无疑问是无限的。
--
- 宇 宙 yǔ zhòu universe; cosmos
- 毫 无 疑 问 háo wú yí wèn certainty
- 无 限 wú xiàn unlimited
---
许多房屋被洪水冲走了。
--
- 许 多 xǔ duō many; a lot of
- 房 屋 fáng wū house; building
- 被 bèi quilt; by
- 洪 水 hóng shuǐ deluge; flood
- 冲 走 chōng zǒu to flush away
---
多么荒唐的故事!
--
- 荒 唐 huāng táng beyond belief
- 故 事 gù shì old practice
---
我当初荒废了岁月。
--
- 当 初 dāng chū at that time
- 荒 废 huāng fèi to abandon (cultivated fields)
- 岁 月 suì yuè years; time
---
资产盈利能力或一些其他的价值,它们的主人。
--
- 资 产 zī chǎn property; assets
- 盈 利 yíng lì profit; gain
- 能 力 néng lì capability; ability
- 或 huò maybe; perhaps; or
- 一 些 yī xiē some; a few
- 其 他 qí tā other; the rest
- 价 值 jià zhí value; worth
- 主 人 zhǔ rén master; host; owner
---
庆祝历史上的每个圣人的诞辰
--
- 庆 祝 qìng zhù to celebrate
- 历 史 上 lì shǐ shàng historical
- 圣 人 shèng rén saint; sage
- 诞 辰 dàn chén birthday
---
那张CD是我儿子的。
-156
View File
@@ -1,156 +0,0 @@
---
shuffle: true
js:
- https://patarapolw.github.io/s2speak/index.min.js?key=x
---
一股寒流侵袭了欧洲。
--
- 寒 流 hán liú cold stream
- 侵 袭 qīn xí to invade
- 欧 洲 ōu zhōu Europe
---
天气非常寒冷。
--
- 寒 冷 hán lěng cold (climate)
---
寒风席卷北方。
--
- 席 卷 xí juǎn to engulf; to sweep
- 北 方 běi fāng north
---
暑假期间,我在邮局工作。
--
- 暑 假 shǔ jià summer vacation
- 期 间 qī jiān period of time
- 邮 局 yóu jú post office
---
他们去了爱丁堡避暑。
--
- 爱 丁 堡 ài dīng bǎo Edinburgh, capital of Scotland
- 避 暑 bì shǔ to be away for the summer holidays
---
然而,相反的理论往往也是真的。
--
- 然 而 rán ér however; yet; but
- 相 反 xiāng fǎn opposite; contrary
- 理 论 lǐ lùn theory; to argue
- 往 往 wǎng wǎng often; frequently
---
我不能再往前走了。
--
- 往 前 wǎng qián to move forwards
---
春天和秋天,你更喜欢哪个?
---
今年中秋节是星期一吗?
--
- 中 秋 节 zhōng qiū jié the Mid-Autumn Festival on 15th of 8th lunar month
---
你有没有收据?
--
- 收 据 shōu jù receipt
---
对不起。我收回我的话。
--
- 收 回 shōu huí to regain
---
我今天收到了她的信。
--
- 收 到 shōu dào to receive
---
西藏的好水就是世界的好水。
--
- 西 藏 xī zàng Tibet
- 世 界 shì jiè world
---
他把它藏在了门后。
---
谁在影子里藏着?
--
- 影 子 yǐng zi shadow; reflection
---
我想知道这个冬天在我们的城市会不会下雪。
--
- 城 市 chéng shì city; town
- 下 雪 xià xuě to snow
---
冬季是一年中最冷的季节。
--
- 冬 季 dōng jì winter
- 年 中 nián zhōng within the year
- 季 节 jì jié time; season
---
我们为过冬储备了10吨煤。
--
- 过 冬 guò dōng to get through the winter
- 储 备 chǔ bèi reserves
- 吨 dūn ton (loanword)
- 煤 méi coal
-126
View File
@@ -1,126 +0,0 @@
---
shuffle: true
js:
- https://patarapolw.github.io/s2speak/index.min.js?key=x
---
用闰表来测定的格林尼治时间。
--
- 测 定 cè dìng to survey and evaluate
- 格 林 尼 治 gé lín ní zhì Greenwich (former location of Greenwich observatory, at zero longitude)
---
闰的(闰日、闰年的)在日历中加入一天或一月而使历年与太阳年相吻合的
--
- 加 入 jiā rù to become a member
- 日 历 rì lì calendar
- 历 年 lì nián calendar year
- 吻 合 wěn hé to be a good fit
---
尽管现在中国人的生活越来越好了,可是还有改进的余地。
--
- 尽 管 jǐn guǎn despite; although
- 越 来 越 yuè lái yuè more and more
- 改 进 gǎi jìn to improve
- 余 地 yú dì margin; leeway
---
你留在这儿,其余的人去外面
--
- 其 余 qí yú the rest; remaining
---
他和我同岁。
---
你多大岁数了?
---
法律有很多不明确的地方。
--
- 法 律 fǎ lǜ law
- 不 明 确 bù míng què indefinite; unclear
---
嚴以律己, 寬以待人。
--
- 严 以 律 己 yǎn yǐ lǜ jǐ to be strict with oneself (idiom)
- 宽 以 待 人 kuān yǐ dài rén to be lenient with others (idiom)
---
心里正在捉着迷藏,吕校长鞠躬请他演讲,下面一阵鼓掌。
--
- 捉 zhuō to clutch; to grab
- 着 迷 zháo mí to be fascinated
- 校 长 xiào zhǎng (college, university) president
- 鞠 躬 jū gōng to bow
- 演 讲 yǎn jiǎng lecture
- 一 阵 yī zhèn a burst; a fit
- 鼓 掌 gǔ zhǎng to applaud; to clap
---
他强调都市生活的便利方面。
--
- 强 调 qiáng diào to emphasize (a statement)
- 都 市 dū shì city; metropolis
- 生 活 shēng huó life; activity
- 便 利 biàn lì convenient; easy
- 方 面 fāng miàn respect; aspect
---
现今人们没有空调无法生活。
--
- 无 法 wú fǎ unable; incapable
---
众口难调。
---
我想特别强调这一点。
---
如果没有太阳,那所有生物都会死。
---
住家的阳台都对着广
--
- 阳 台 yáng tái balcony; porch
---
这间房照不到很多阳光。
-111
View File
@@ -1,111 +0,0 @@
---
shuffle: true
js:
- https://patarapolw.github.io/s2speak/index.min.js?key=x
---
他们俩相爱已经多年。
---
她特别地恨那个男孩。
---
听了这消息我心里很不安。
---
她的优点是临危不乱。
---
多数旧电影片都是黑白的。
---
这个墨颜色很黑。
---
冰太薄,承受不住你的重量。
---
厚厚的云把风景遮住了。
---
我饱了,一点也吃不下了。
---
这孩子不是肚子饿,就是馋嘴。
---
他的境遇很可悲。
---
大厅里充满了他们的欢笑声。
---
他的背上有一个蛇形的红斑。
---
病人服药后腹痛逐止。
---
虽然笨,可是他很刻苦。
---
他很年轻,身子骨很灵巧。
---
这本书的缺点是太长。
---
他把头发剪成时兴的短发。
---
他发誓要为父亲报仇。
---
你不像是忘恩负义的人。
---
安居乐业
---
黑名单
---
厚此薄彼
---
悲欢离合
---
笨手笨脚
---
日短夜长
---
恩将仇报
@@ -1,172 +0,0 @@
---
shuffle: true
js:
- https://patarapolw.github.io/s2speak/index.min.js?key=x
source: https://th.hujiang.com/new/p394824/
---
调味料
--
เครื่องปรุงรส
---
沙拉油
--
น้ำมันสลัด
---
蚝油
--
น้ำมันหอย
---
面包屑
--
เศษขนมปัง
---
酦粉
--
แป้งฟู
---
调味汁
--
น้ำปรุงรสอาหาร
---
面粉
--
แป้งข้าวสาลี
---
香料
--
เครื่องเทศ
---
盐
--
เกลือ
---
胡椒
--
พริกไทย
---
蕃茄酱
--
ซอสมะเขือเทศ
---
酱油
--
ซีอิ๊ว
---
糖
--
น้ำตาล
---
辣酱
--
ซอสพริก
---
醋
--
น้ำส้ม
---
黄油
--
เนย
---
花生酱
--
เนยถั่ว
---
椰浆
--
น้ำกะทิ
---
牛奶
--
นม
---
虾酱
--
กะปิ
---
鱼露
--
น้ำปลา
-112
View File
@@ -1,112 +0,0 @@
---
shuffle: true
js:
- https://patarapolw.github.io/s2speak/index.min.js?key=x
---
我们应当用右手拿着坚固的盾牌去捍卫我们在中东的利益。
--
- 应 当 yīng dāng should; ought to
- 右 手 yòu shǒu right hand
- 拿 ná to hold; to seize
- 坚 固 jiān gù firm; firmly; hard
- 盾 牌 dùn pái shield; pretext
- 捍 卫 hàn wèi to defend
- 利 益 lì yì benefit
---
倾盆大雨劈头盖脸地浇了下来。
--
- 倾 盆 大 雨 qīng pén dà yǔ a downpour
- 劈 头 盖 脸 pī tóu gài liǎn lit. splitting the head and covering the face (idiom)
- 浇 jiāo to pour liquid
- 下 来 xià lai to come down
---
我踢足球的時候弄傷了腿。
--
- 踢 tī to kick
- 足 球 zú qiú soccer ball; soccer
- 弄 伤 nòng shāng to bruise
- 腿 tuǐ hip bone
---
你认为汤姆的腰围是多少?
--
- 汤 姆 tāng mǔ Tom (name)
- 腰 围 yāo wéi waist measurement
---
一定是有人偷了你的手錶。
--
- 偷 tōu to steal; to pilfer
- 手 表 shǒu biǎo wrist watch
---
抡锤子的工作使胳膊上的肌肉结成了一块块硬疙瘩。
--
- 抡 lūn to swing (one's arms, a heavy object)
- 锤 子 chuí zi hammer
- 胳 膊 gē bo arm
- 肌 肉 jī ròu muscle; flesh
- 结 成 jié chéng to form
- 硬 yìng hard; stiff; strong
- 疙 瘩 gē da swelling or lump on skin
---
吃些火腿。
--
- 些 xiē some; few; several
- 火 腿 huǒ tuǐ ham
---
他脸上显出一副严肃的神色。
--
- 脸 liǎn face
- 显 出 xiǎn chū to express
- 严 肃 yán sù solemn; grave
- 神 色 shén sè expression; look
---
鸟的翅膀相当于人的胳膊。
--
- 翅 膀 chì bǎng wing
- 相 当 于 xiāng dāng yú equivalent to
- 胳 膊 gē bo arm
---
这事他早就扔在脖子后边了。
--
- 早 就 zǎo jiù already at an earlier time
- 扔 rēng to throw
- 脖 子 bó zi neck
- 后 边 hòu bian back; rear; behind
-3
View File
@@ -1,3 +0,0 @@
{
"root": "."
}
+17
View File
@@ -0,0 +1,17 @@
import Vue from 'vue';
import Router from 'vue-router';
import Search from './views/Search.vue';
import Single from "./views/Single.vue";
import About from "./views/About.vue";
Vue.use(Router);
export default new Router({
mode: "history",
routes: [
{ path: '/', component: Search },
{ path: '/tag/:tag', component: Search },
{ path: "/p/:y/:mo/:name", component: Single },
{ path: "/about", component: About }
]
});
+5
View File
@@ -0,0 +1,5 @@
export const g = {
q: "",
posts: POSTS,
config: CONFIG
};
+13
View File
@@ -0,0 +1,13 @@
import Vue, { VNode } from 'vue'
declare global {
namespace JSX {
// tslint:disable no-empty-interface
interface Element extends VNode {}
// tslint:disable no-empty-interface
interface ElementClass extends Vue {}
interface IntrinsicElements {
[elem: string]: any
}
}
}
+4
View File
@@ -0,0 +1,4 @@
declare module '*.vue' {
import Vue from 'vue'
export default Vue
}
+11
View File
@@ -0,0 +1,11 @@
export function escapeRegExp(s: string) {
return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
}
export function normalizeArray(it: any): any {
if (Array.isArray(it)) {
return it[0];
}
return it;
}
+17
View File
@@ -0,0 +1,17 @@
<template lang="pug">
b-card.p-3(v-html="content")
</template>
<script lang="ts">
import { Vue, Component } from "vue-property-decorator";
import { md } from "@/plugins/render";
@Component
export default class About extends Vue {
private content: string = "";
public mounted() {
this.content = md.md2html(README);
}
}
</script>
+61
View File
@@ -0,0 +1,61 @@
<template lang="pug">
div
h1.tag(v-if="$route.tag") {{$route.tag}}
div(v-if="posts && posts.length > 0")
post(v-for="p in posts" :filename="p.filename" :is-teaser="true" :key="p.filename")
b-pagination(v-model="page" :total-rows="count" :per-page="perPage")
div(v-else-if="posts")
empty
div(v-else)
first
</template>
<script lang="ts">
import { Vue, Component, Prop, Watch } from "vue-property-decorator";
import Post from "@/layouts/Post.vue";
import Empty from "@/layouts/Empty.vue";
import First from "@/layouts/First.vue";
import SearchParser from "@/plugins/search";
import { normalizeArray } from "@/util";
import { g } from "@/shared";
@Component({
components: {
Post, Empty, First
}
})
export default class Search extends Vue {
private posts?: any[] = [];
private g = g;
private page: number = 1;
private count: number = 0;
private perPage: number = 5;
public mounted() {
this.page = parseInt(normalizeArray(this.$route.query.page) || "1");
this.updatePosts();
}
@Watch("g.q")
@Watch("page")
@Watch("$route.params")
private async updatePosts() {
const parser = new SearchParser();
let ps = this.$route.params.tag
? parser.filterPosts([this.g.q, `tag=${this.$route.params.tag}`].join(" "))
: parser.filterPosts(this.g.q);
const { perPage } = g.config.posts;
this.perPage = perPage;
this.count = ps.length;
ps = ps.filter((p, i) => {
const iPage = i / perPage;
return iPage >= this.page - 1 && iPage < this.page;
});
this.posts = ps;
}
}
</script>
+49
View File
@@ -0,0 +1,49 @@
<template lang="pug">
div
div(v-if="filename")
post(:is-teaser="false" :filename="filename")
vue-disqus(:shortname="disqus" :identifier="$route.path")
div(v-else="")
empty
</template>
<script lang="ts">
import { Vue, Component, Prop } from "vue-property-decorator";
import Post from "@/layouts/Post.vue";
import Empty from "@/layouts/Empty.vue";
import moment from "moment";
import { g } from '../shared';
import { dotGetter } from '../plugins/search';
@Component({
components: {
Post, Empty
}
})
export default class Search extends Vue {
private filename: string = "";
private disqus: string = dotGetter(g.config, "external.disqus");
public mounted() {
const ps = g.posts.filter((p) => {
const m = moment(p.date);
if (m.format("YYYY") === this.$route.params.y && m.format("MM") === this.$route.params.mo) {
if (p.filename
.replace(/^.*\//, "")
.replace(/\.[^.]+$/, "") === this.$route.params.name) {
return true;
}
}
return false;
});
if (!ps[0]) {
this.filename = "";
}
this.filename = ps[0].filename;
}
}
</script>