All gists

LiuShen
Last active 2 months ago about butterfly new-version page

清羽飞扬新版关于页面魔改文件备份

0 0 5
1 #about-container
2 section.top-section
3 .top-content
4 .float-texts
5 each text, index in site.data.about.top_info.float_text.slice(0, 4)
6 .float-text(class=`float-text-${index + 1}`) #{text}
7 .avatar-container
8 img.no-lightbox.avatar(src=url_for(site.data.about.top_info.avatar) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt="")
9 .float-texts
10 each text, index in site.data.about.top_info.float_text.slice(4, 8)
LiuShen
Last active 2 months ago atom feed hexo pretty xml xsl

Atom通过XSL代码进行HTML化并进行美化

0 0 1
1 <?xml version="1.0" encoding="utf-8"?>
2 <xsl:stylesheet version="3.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:atom="http://www.w3.org/2005/Atom">
5 <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
6
7 <xsl:template match="/">
8 <xsl:variable name="title">
9 <xsl:value-of select="/atom:feed/atom:title"/>
10 </xsl:variable>
LiuShen
Last active 2 months ago api bing cache cloudflare worker

利用CF Worker实现一个每日bing一图接口API,可以直接用作图片数据。

0 0 1
1 // 利用api.nsmao.net实现的bing接口
2 const API_KEY = "ajdlfklahweufbrffbhjefjfsmd,shj" // 自行申请API
3 const CACHE_TTL = 36000 // 10 小时
4
5 export default {
6 async fetch(request, env, ctx) {
7 const { pathname } = new URL(request.url)
8
9 // 首页说明
10 if (pathname === "/") {
LiuShen
Last active 2 months ago Javascript cloudflare commit github-api worker

通过cloudflare Worker创建github api中间件,在隐藏token的情况下获取仓库提交信息

0 0 1
1 /**
2 * Welcome to Cloudflare Workers! This is your first worker.
3 *
4 * - Run "npm run dev" in your terminal to start a development server
5 * - Open a browser tab at http://localhost:8787/ to see your worker in action
6 * - Run "npm run deploy" to publish your worker
7 *
8 * Learn more at https://developers.cloudflare.com/workers/
9 */