#flash
6 discoveries · Hand-picked discoveries from the open web, newest first.
-
为 Astro 添加中英文混排插入空格和直角引号转换功能
本文由DeepSeek V4 Flash 0731赞助播出,感谢梁圣开源。 <!--more--> 书接上回,我在Hexo中习惯用 hexo-filter-copywriting 解决中英文混排的空格问题,以及弯引号到直角引号的自动转换。但是Astro中没有这么方便的插件,只能让蓝色大肥鱼DeepSeek帮忙手搓一个。 DeepSeek给出了两种方案:将 pangu.js 挂载到 Layout.astro 中,在客户端渲染完成后进行转换,另一种则是写一个 Astro integration,在 astro:build:done 钩子里处理 HTML,并直接写入最终的HTML文件。对于 dev 预览模式,则再创建一个中间件进行客户端处理。这种方式比较类似于hexo-filter-copywriting插件原本的体验,本博客最终也是采用了这个处理方式。 首先安装所需依赖: pnpm add pangu cheerio 然后创建核心处理文件 src/utils/pangu-utils.ts : import pangu from 'pangu'; import * as cheerio from 'cheerio'; // 中文基本区范围和全角标点范围 const CJK = '\\u4E00-\\u9FFF'; const CJK_PUNCT = '\\u3000-\\u303F\\u
Dort 的博客 · ZH
-
制作 remark 插件并添加到 Astro
依旧由DeepSeek V4 Flash 0731赞助播出,依旧书接上回,不得不感叹AI确实是新质生产力(笑)。 <!--more--> 众所周知,Fuwari自带了一个GitHub卡片功能。不过让我好奇的是这个卡片的语法: ::github{repo="<owner>/<repo>"} 这显然不是标准的Markdown语法,而是通过 remark 实现的。简而言之,Fuwari使用 remark 和 rehype 来处理Markdown文档。 remark 用于把Markdown文档转换为HTML代码,再由 rehype 进行后续调整。而 :: 语法则是由 remark-directive 插件来处理的。显而易见的,我们也可以自己来制作一个 remark 插件,定制自己需要的功能。 诶🤓☝️,我正好有一个想法:在Hexo时代,这个博客的友链卡片是通过手写HTML的方式插入到Markdown文档中的,十分繁琐且累眼。这个HTML片段类似这样: <a class="profile-card profile-card-link no-styling" href="链接" target="_blank"> <div class="avatar-wrapper"> <img src="头像地址" alt="头像"> </div> <div class="info-wrapper"> <s
Dort 的博客 · ZH
-
SLC-2L-15: Cross-Pollination
Lighting with flash can give you more than just the ability to control the quality of your light. With the inherent consistency of light from (manual) flash, you can layer in slices of time as well. But first, you’ll want to lock down two things: the ambient light portion of your exposure, and your camera’s physical position. Read more »
Strobist · EN
-
Strataを使ってMac mini(32GB)でQwen3.8-Flash-Next(125B)を動かす
初めに 普段は M4 Mac mini(32GB)でOllamaを使って30B前後のモデルでローカルLLM環境を作っているのですが、32GBだとどうしても動かせるモデルのサイズに限界があります。 そんな中、最近 Strata というツールが「メモリに入りきらない大きなモデ...
Qiita · JA
-
Flash Warning
On a weekend getaway with her boyfriend’s family, Pia must learn to trust herself after an incident with her boyfriend’s dad sends her into a spiral…
Vimeo Short of the Week · EN
-
Google Doodle Pac-Man’s siren call
Marcin Wichary, writing on his blog Unsung, tells the story of the bug he shipped to Google’s homepage in 2010. He wrote the playable Pac-Man doodle for the game’s 30th anniversary, building the whole thing in HTML and CSS, with Flash handling the sound. The playfield spelled out Google’s logo, and a Ms. Pac-Man mode […]
Adafruit Blog · EN