2024 © fdxx. Built with markhub
' 64 | 65 | ## Translate text. 66 | translate: 67 | published: 'Published' 68 | readmore: 'Read more' 69 | pageviews: 'Pageviews' 70 | 71 | 72 | ## pagecounter. Show post views 73 | ## https://github.com/fdxx/pagecounter 74 | pagecounter: 75 | enable: true 76 | ## server uri 77 | server: 'https://exp.com/pageviews' 78 | 79 | ## Specify domain value, default value: window.location.hostname 80 | ##domain: 'fdxx.github.io' 81 | 82 | 83 | ## A comments system powered by GitHub Discussions. 84 | ## https://giscus.app 85 | giscus: 86 | enable: true 87 | data-repo: "fdxx/markhub" 88 | data-repo-id: "R_kgDOMq6IwA" 89 | data-category: "Announcements" 90 | data-category-id: "DIC_kwDOMq6IwM4CiG-h" 91 | data-mapping: "pathname" 92 | ## default value: config.site.language 93 | ## data-lang: "en" 94 | 95 | ## Waline comments system 96 | ## https://waline.js.org 97 | waline: 98 | enable: false 99 | 100 | # Waline server address url, you should set this to your own link 101 | serverURL: https://waline.vercel.app 102 | 103 | # Waline library CDN url, you can set this to your preferred CDN 104 | libUrl: https://unpkg.com/@waline/client@v3/dist/waline.js 105 | 106 | # Waline CSS styles CDN url, you can set this to your preferred CDN 107 | cssUrl: https://unpkg.com/@waline/client@v3/dist/waline.css 108 | 109 | # Pageviews count, Note: You should not enable both `waline.pageview` and `leancloud_visitors`. 110 | pageview: true 111 | 112 | # Custom locales 113 | locale: 114 | placeholder: 'Say something..' 115 | 116 | dark: 'auto' 117 | # Custom emoji 118 | # emoji: 119 | # - https://unpkg.com/@waline/emojis@1.1.0/weibo 120 | # - https://unpkg.com/@waline/emojis@1.1.0/alus 121 | # - https://unpkg.com/@waline/emojis@1.1.0/bilibili 122 | # - https://unpkg.com/@waline/emojis@1.1.0/qq 123 | # - https://unpkg.com/@waline/emojis@1.1.0/tieba 124 | # - https://unpkg.com/@waline/emojis@1.1.0/tw-emoji 125 | 126 | # Comment information, valid meta are nick, mail and link 127 | # meta: 128 | # - nick 129 | # - mail 130 | # - link 131 | 132 | # Set required meta field, e.g.: [nick] | [nick, mail] 133 | # requiredMeta: 134 | # - nick 135 | 136 | # Language, available values: en-US, zh-CN, zh-TW, pt-BR, ru-RU, jp-JP, fr-FR 137 | # default value: config.site.language 138 | # lang: en 139 | 140 | # Word limit, no limit when setting to 0 141 | # wordLimit: 0 142 | 143 | # Whether enable login, can choose from 'enable', 'disable' and 'force' 144 | # login: enable 145 | 146 | # comment per page 147 | # pageSize: 10 148 | 149 | # turnstileKey: '' 150 | # 151 | # reaction: 152 | # - 'https://unpkg.com/@waline/emojis@1.2.0/tieba/tieba_agree.png' 153 | # - 'https://unpkg.com/@waline/emojis@1.2.0/tieba/tieba_sunglasses.png' 154 | # - 'https://unpkg.com/@waline/emojis@1.2.0/tieba/tieba_look_down.png' 155 | # - 'https://unpkg.com/@waline/emojis@1.2.0/tieba/tieba_antic.png' 156 | # - 'https://unpkg.com/@waline/emojis@1.2.0/tieba/tieba_pick_nose.png' 157 | 158 | 159 | -------------------------------------------------------------------------------- /example-site/config.yaml: -------------------------------------------------------------------------------- 1 | site: 2 | ## The title of your website. 3 | title: MarkHub 4 | 5 | ## The URL of your website. 6 | url: 'https://fdxx.github.io' 7 | 8 | ## HTML lang Attribute. Use a 2-letter ISO-639-1 code or optionally its variant. 9 | ## eg. en, zh-CN 10 | language: en 11 | 12 | ## The root directory of your website. 13 | ## If your website is in a subdirectory (such as http://example.org/blog), set root to /blog/. And 14 | ## add `/blog/` to the absolute path of the following configuration. 15 | root: '/markhub/' 16 | 17 | ## Default value for the article author if you don't specify one explicitly in the Front-matter. 18 | author: fdxx 19 | 20 | ## favicon link 21 | favicon: '/markhub/assets/images/favicon.ico' 22 | 23 | ## posts file directory. 24 | posts_dir: 'source/posts' 25 | 26 | ## Where to generate static web files. 27 | push_dir: 'public' 28 | 29 | ## Additional files/folders to copy after the build is complete, such as favicon, etc. 30 | copy_dir: 31 | - source: 'source/assets' 32 | dest: 'public/assets' 33 | 34 | ## Number of posts displayed on each page. 35 | pageSize: 36 | home: 10 37 | archive: 30 38 | 39 | ## CSS and JS links to add. 40 | ## If you don't need math, comment out katex to optimize page loading speed. 41 | css: 42 | - 'https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/5.6.1/github-markdown.min.css' 43 | - 'https://cdn.jsdelivr.net/npm/remixicon@4.3.0/fonts/remixicon.min.css' 44 | - 'https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css' 45 | - '/markhub/assets/css/highlight-github.css' 46 | - '/markhub/assets/css/main.css' 47 | js: 48 | - 'https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.js' 49 | - '/markhub/assets/js/main.js' 50 | 51 | ## The name and link of the navigation menu. 52 | navigation: 53 | Home: 54 | link: '/markhub/' 55 | Archive: 56 | link: '/markhub/archive/' 57 | Tags: 58 | link: '/markhub/tags/' 59 | About: 60 | link: '/markhub/about/' 61 | 62 | ## The text displayed in the footer. Raw HTML syntax. 63 | footer: 64 | content: '2024 © fdxx. Built with markhub
' 65 | 66 | ## Translate text. 67 | translate: 68 | published: 'Published' 69 | readmore: 'Read more' 70 | pageviews: 'Pageviews' 71 | 72 | 73 | ## pagecounter. Show post views 74 | ## https://github.com/fdxx/pagecounter 75 | pagecounter: 76 | enable: true 77 | ## server uri 78 | server: 'https://pagecounter.fdxx.workers.dev/pageviews' 79 | 80 | ## Specify domain value, default value: window.location.hostname 81 | domain: 'fdxx.github.io' 82 | 83 | 84 | ## A comments system powered by GitHub Discussions. 85 | ## https://giscus.app 86 | giscus: 87 | enable: true 88 | data-repo: "fdxx/markhub" 89 | data-repo-id: "R_kgDOMq6IwA" 90 | data-category: "Announcements" 91 | data-category-id: "DIC_kwDOMq6IwM4CiG-h" 92 | data-mapping: "pathname" 93 | ## default value: config.site.language 94 | ## data-lang: "en" 95 | 96 | ## Waline comments system 97 | ## https://waline.js.org 98 | waline: 99 | enable: false 100 | 101 | # Waline server address url, you should set this to your own link 102 | serverURL: https://waline.vercel.app 103 | 104 | # Waline library CDN url, you can set this to your preferred CDN 105 | libUrl: https://unpkg.com/@waline/client@v3/dist/waline.js 106 | 107 | # Waline CSS styles CDN url, you can set this to your preferred CDN 108 | cssUrl: https://unpkg.com/@waline/client@v3/dist/waline.css 109 | 110 | # Pageviews count, Note: You should not enable both `waline.pageview` and `leancloud_visitors`. 111 | pageview: true 112 | 113 | # Custom locales 114 | locale: 115 | placeholder: 'Say something..' 116 | 117 | dark: 'auto' 118 | # Custom emoji 119 | # emoji: 120 | # - https://unpkg.com/@waline/emojis@1.1.0/weibo 121 | # - https://unpkg.com/@waline/emojis@1.1.0/alus 122 | # - https://unpkg.com/@waline/emojis@1.1.0/bilibili 123 | # - https://unpkg.com/@waline/emojis@1.1.0/qq 124 | # - https://unpkg.com/@waline/emojis@1.1.0/tieba 125 | # - https://unpkg.com/@waline/emojis@1.1.0/tw-emoji 126 | 127 | # Comment information, valid meta are nick, mail and link 128 | # meta: 129 | # - nick 130 | # - mail 131 | # - link 132 | 133 | # Set required meta field, e.g.: [nick] | [nick, mail] 134 | # requiredMeta: 135 | # - nick 136 | 137 | # Language, available values: en-US, zh-CN, zh-TW, pt-BR, ru-RU, jp-JP, fr-FR 138 | # default value: config.site.language 139 | # lang: en 140 | 141 | # Word limit, no limit when setting to 0 142 | # wordLimit: 0 143 | 144 | # Whether enable login, can choose from 'enable', 'disable' and 'force' 145 | # login: enable 146 | 147 | # comment per page 148 | # pageSize: 10 149 | 150 | # turnstileKey: '' 151 | # 152 | # reaction: 153 | # - 'https://unpkg.com/@waline/emojis@1.2.0/tieba/tieba_agree.png' 154 | # - 'https://unpkg.com/@waline/emojis@1.2.0/tieba/tieba_sunglasses.png' 155 | # - 'https://unpkg.com/@waline/emojis@1.2.0/tieba/tieba_look_down.png' 156 | # - 'https://unpkg.com/@waline/emojis@1.2.0/tieba/tieba_antic.png' 157 | # - 'https://unpkg.com/@waline/emojis@1.2.0/tieba/tieba_pick_nose.png' 158 | 159 | 160 | -------------------------------------------------------------------------------- /example-site/source/assets/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fdxx/markhub/1ae44432497b49a61ad9d7fcda99aa4c610f986e/example-site/source/assets/images/favicon.ico -------------------------------------------------------------------------------- /example-site/source/posts/about.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'About' 3 | date: '2024-08-15' 4 | --- 5 | 6 | [MarkHub](https://github.com/fdxx/markhub), A simple blog system built with nodejs. It parses the Markdown file into an HTML file and outputs it to the specified directory. You need to use nginx etc. to present your website. 7 | 8 | ### [Preview](https://fdxx.github.io/markhub) 9 | 10 | ## Features 11 | - Easily write articles using markdown syntax. 12 | - github css theme styles. 13 | 14 | ## build 15 | ```bash 16 | git clone https://github.com/fdxx/markhub 17 | cd markhub 18 | npm install 19 | 20 | ## Copy the configuration file and edit it. 21 | cp config.example.yaml config.yaml 22 | 23 | ## build 24 | node index.js 25 | ``` 26 | 27 | ## Command Parameter 28 | - **config**: Specify config file path. default value `./config.yaml`. For config instructions, see `config.example.yaml`. 29 | - **noclean**: By default, all files in `config.site.push_dir` are deleted before building, specify this parameter to prevent deletion of the. 30 | 31 | Example: 32 | 33 | ```bash 34 | node index.js --config "path/to/config.yaml" --noclean 35 | ``` 36 | 37 | ## Front-matter 38 | At the beginning of the post, surround the yaml block with `---` 39 | ```yaml 40 | --- 41 | ## Post Title 42 | title: 'Hello World' 43 | 44 | ## Default value: config.site.author 45 | author: 'fdxx' 46 | 47 | ## description. Default value: title 48 | ## If the body does not have a '' , this value is also used as excerpt 49 | description: 'some description' 50 | 51 | ## Published date. Default value: file last modified date. 52 | date: '2024-09-01' 53 | 54 | ## last modified date. Default value: date 55 | lastmod: '2024-09-05' 56 | 57 | ## Enables comment feature for the post. Default value: true 58 | comments: true 59 | 60 | ## Tags. Default value: none 61 | tags: 62 | - 'test1' 63 | - 'test2' 64 | 65 | ## After building, these files are copied to the corresponding post directory. 66 | ## If it is a relative path, it will be find from the current md file path. 67 | resources: 68 | - 'pexels-dreamypixel-547115.jpg' 69 | - 'pexels-lazarevkirill-9801136.jpg' 70 | 71 | ## If it is a draft, it will not be output. Default value: false 72 | draft: false 73 | --- 74 | ``` 75 | 76 | ## Credit 77 | - [markdown-it](https://github.com/markdown-it/markdown-it) 78 | - [mdit-plugins](https://github.com/mdit-plugins/mdit-plugins) 79 | - [highlightjs](https://github.com/highlightjs/highlight.js) 80 | - [github-markdown-css](https://github.com/sindresorhus/github-markdown-css) 81 | - [RemixIcon](https://github.com/Remix-Design/RemixIcon) 82 | 83 | ## Design Reference 84 | - [hexo](https://github.com/hexojs/hexo) 85 | - [hexo-theme-next](https://github.com/next-theme/hexo-theme-next) 86 | 87 | -------------------------------------------------------------------------------- /example-site/source/posts/chinese-test.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: '余华《活着》' 3 | date: '2024-08-17' 4 | description: '中文排版测试' 5 | tags: 6 | - 'test1' 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 | -------------------------------------------------------------------------------- /example-site/source/posts/helloworld/helloworld.md: -------------------------------------------------------------------------------- 1 | --- 2 | ## Post Title 3 | title: 'Hello World' 4 | 5 | ## Default value: config.site.author 6 | author: 'fdxx' 7 | 8 | ## description. Default value: title 9 | ## If the body does not have a '' , this value is also used as excerpt 10 | description: 'some description' 11 | 12 | ## Published date. Default value: file last modified date. 13 | date: '2024-09-01' 14 | 15 | ## last modified date. Default value: date 16 | lastmod: '2024-09-05' 17 | 18 | ## Enables comment feature for the post. Default value: true 19 | comments: true 20 | 21 | ## Tags. Default value: none 22 | tags: 23 | - 'test1' 24 | - 'test2' 25 | 26 | ## After building, these files are copied to the corresponding post directory. 27 | ## If it is a relative path, it will be find from the current md file path. 28 | resources: 29 | - 'pexels-dreamypixel-547115.jpg' 30 | - 'pexels-lazarevkirill-9801136.jpg' 31 | 32 | ## If it is a draft, it will not be output. Default value: false 33 | draft: false 34 | --- 35 | 36 | This is a markdown example website. [Source code](https://raw.githubusercontent.com/fdxx/markhub/main/example-site/source/posts/helloworld/helloworld.md) of this article. 37 | 38 | ## Paragraphs 39 | **Markdown** is a lightweight markup language with concise syntax, allowing people to focus more on the content itself rather than the layout. It uses a plain text format that is easy to read and write to write documents, can be mixed with HTML, and can export HTML, PDF, and its own .md format files. Because of its simplicity, efficiency, readability, and ease of writing, `Markdown` is widely used, such as [Github](https://github.com/), Wikipedia, Jianshu, etc. 40 | 41 | ## Emphasis 42 | I just love **bold text**. 43 | Italicized text is the *cat's meow*. 44 | Underline requires `` HTML syntax 45 | ~~Delete this text.~~ 46 | Link to the [github.](https://github.com) 47 | 48 | ## Quoting text 49 | > **Markdown** is a lightweight markup language with concise syntax, allowing people to focus more on the content itself rather than the layout. It uses a plain text format that is easy to read and write to write documents, can be mixed with HTML, and can export HTML, PDF, and its own .md format files. Because of its simplicity, efficiency, readability, and ease of writing, `Markdown` is widely used, such as [Github](https://github.com/), Wikipedia, Jianshu, etc. 50 | 51 | ## Lists 52 | 53 | ### Ordered Lists 54 | 1. First item 55 | 2. Second item 56 | 3. Third item 57 | 4. Fourth item 58 | 59 | ### Unordered Lists 60 | - First item 61 | - Second item 62 | - Third item 63 | - Fourth item 64 | 65 | ### Task lists 66 | - [x] https://github.com/microsoft/vscode/issues/224902 67 | - [ ] Add delight to the experience when all tasks are complete 68 | 69 | ## Table 70 | | Left-aligned | Center-aligned | Right-aligned | 71 | | :--- | :---: | ---: | 72 | | git status | git status | git status | 73 | | git diff | git diff | git diff | 74 | 75 | ## Code blocks 76 | 77 | ``` 78 | #include<%= value['date'] %>: <%= value['title'] %>
41 | <%_ } _%> 42 |