Skip to content

Commit

Permalink
post: neo-uglysearch
Browse files Browse the repository at this point in the history
  • Loading branch information
OverflowCat committed Jan 18, 2025
1 parent 8f043f6 commit c31f1e8
Show file tree
Hide file tree
Showing 18 changed files with 311 additions and 39 deletions.
2 changes: 1 addition & 1 deletion astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export default defineConfig({
noExternal: [
"xp.css",
"98.css",
"@ibm/plex-sans-sc",
"plex-sans-sc-cdn",
"@shikijs/twoslash/style-rich.css",
"rehype-remnote/style/*",
],
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "neko-astro-blog",
"type": "module",
"version": "2.14.8",
"version": "2.15.0",
"private": true,
"engines": {
"node": ">=20"
Expand Down Expand Up @@ -80,6 +80,7 @@
"logical-astro-tweet": "^0.0.5",
"markdown-it": "^14.1.0",
"opencc-js": "^1.0.5",
"plex-sans-sc-cdn": "^1.0.0",
"prismjs": "^1.29.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
Expand Down
8 changes: 8 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/components/ArticleList.astro
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ if (type && name) {
let prev_year = 0;
const _posts = posts.map((post) => {
const year = post.data.date.getFullYear();
const year = post.data.date.getUTCFullYear();
const isAnotherYear = year !== prev_year;
if (isAnotherYear) prev_year = year;
return {
Expand Down
4 changes: 3 additions & 1 deletion src/components/FloatingImg.astro
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ figcaption {
margin: 0;
text-align: center;
}
/*
@media (min-width: 1605px) {
aside {
position: fixed;
right : 1rem;
top : 16rem;
}
}
</style>
*/
</style>
24 changes: 17 additions & 7 deletions src/components/comments/Form.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import nameGen from "@/scripts/name-gen";
import { pick } from "@/scripts/serendipity.ts";
const slug = Astro.url.pathname.replace(/^\/|\/$/g, "");
const placeholder = `${pick([
"请洒潘江,各倾陆海云尔…",
"矮纸斜行闲作草,晴窗细乳戏分茶…",
"此意在人间,试听徽外三两弦…",
"给主人留下些什么吧~",
"请洒潘江,各倾陆海云尔…",
"矮纸斜行闲作草,晴窗细乳戏分茶…",
"此意在人间,试听徽外三两弦…",
"给主人留下些什么吧~",
])}
(可以使用 Markdown 和任意 HTML)`;
Expand All @@ -19,7 +19,13 @@ const placeholder = `${pick([
>
<div class="form-group">
<label for="user[name]">昵称 *</label>
<input type="text" id="user[name]" name="user[name]" placeholder={nameGen()} required />
<input
type="text"
id="user[name]"
name="user[name]"
placeholder={nameGen()}
required
/>
</div>

<div class="form-group">
Expand All @@ -28,17 +34,21 @@ const placeholder = `${pick([
type="text"
id="user[url]"
name="user[url]"
class="mono"
placeholder="你的个人主页、博客、社交媒体等的 URL"
required
/>
</div>

<div class="form-group">
<label for="user[email]"><span class="h">Email</span><span class="vert">邮箱</span></label>
<label for="user[email]"
><span class="h">Email</span><span class="vert">邮箱</span></label
>
<input
type="email"
id="user[email]"
name="user[email]"
class="mono"
placeholder="不会公开显示"
/>
</div>
Expand Down Expand Up @@ -66,7 +76,7 @@ const placeholder = `${pick([
评论将在审核后显示,阁下可以在本博客的 Github 仓库的 <a
href="https://github.com/OverflowCat/blog/pulls/app%2Foverflowcat"
>拉取请求列表</a
> 中查看。<br />本表单无 JavaScript,请勿重复提交。
> 中查看。提交成功后会自动跳转。<br />
</span>
</form>

Expand Down
6 changes: 3 additions & 3 deletions src/components/sidebar/Search.astro
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
import "@/styles/form.less";
---
<form action="https://search.saveweb.app/search" method="get" class="m-2">
<form action="https://search.saveweb.org/search" method="get" class="m-2">
<input type="hidden" name="author" value='"ᡥᠠᡳᡤᡳᠶᠠ ᡥᠠᠯᠠ·ᠨᡝᡴᠣ 猫"'>
<div class="form-group">
<label for="q" class="block text-center text-lg font-800 font-medium text-gray-700">站内全文搜索</label>
<input type="text" id="q" name="q" required placeholder="支持简繁同搜、模糊匹配" class="border-gray-300 text-xl space-block-2 line-height-relaxed inline-full">
<input type="text" id="q" name="q" required placeholder="支持简繁同搜、模糊匹配" class="border-gray-300 text-2xl p-2 space-block-2 line-height-relaxed inline-full">
</div>
<div class="text-end">
<div class="inline-block text-sm vertical-mid">数据每月更新<br />Powered by 丑搜 v3</div>
<div class="inline-block text-sm vertical-mid">数据每日更新<br />Powered by 丑搜 v3</div>
<button type="submit" class="form-button">
搜索
</button>
Expand Down
2 changes: 1 addition & 1 deletion src/components/yari/Baseline.astro
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export type Props = {
}
const { date, versions, feature, supports } = Astro.props;
const id = `browser-supports-${feature}`;
const baseline = date.getFullYear();
const baseline = date.getUTCFullYear();
const locDate = new Intl.DateTimeFormat('zh-Hans-CN', {
year: 'numeric',
month: 'numeric',
Expand Down
2 changes: 1 addition & 1 deletion src/content.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const blogCollection = defineCollection({
});

const neodbCollection = defineCollection({
loader: glob({ pattern: "**/*.json", base: "./src/content/neodb/" }),
type: "data",
schema: () => neoSchema,
});

Expand Down
19 changes: 8 additions & 11 deletions src/layouts/Common.astro
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
---
import type { BlogPost, Frontmatter } from "@/types";
import type { Frontmatter } from "@/types";
import "@/styles/icon.less";
import LicenceBox from "@/components/licences/LicenceBox.astro";
import { crc32base } from "@/scripts/serendipity";
import type { AtomIconName } from "@/scripts/icons";
import Image from "astro/components/Image.astro";
import { getEntry } from "astro:content";
export interface Props {
layoutProps: {
Expand Down Expand Up @@ -166,22 +164,21 @@ Astro.locals.vert = vert;
text-align: center;
a.tag,
a.cat {
color: #151515;
text-decoration: none;
border: none;
padding: 4px;
@apply no-underline border-none p-1 font-600;
color: var(--text-tag) !important;
margin-block: 3px;
margin-inline: 6px;
margin-inline: 5px;
border-radius: 0.5rem;
transition: background-color 0.1s;
border: 2px solid var(--bg-secondary);
// border-radius: 0.5rem;
// border: 2px solid var(--bg-secondary);
background-color: var(--bg-tag);
color: var(--text-secondary);
&:hover {
background-color: var(--bg-secondary-hover);
background-color: var(--bg-tag-hover);
}
&:active {
background-color: var(----bg-secondary-active);
background-color: var(--bg-tag-active);
}
}
& > div {
Expand Down
134 changes: 134 additions & 0 deletions src/layouts/Neobrutalism.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
---
import Paper from "@/components/Paper.astro";
import "@/styles/icon.less";
import Comments from "@/components/comments/Comments.astro";
// import "@/styles/snowy.css";
import Common from "./Common.astro";
import "@shikijs/twoslash/style-rich.css";
const { frontmatter } = Astro.props;
import Bar from "@/templates/Bar.astro";
import "@/styles/form.less";
import "plex-sans-sc-cdn/dist/min.css";
import "@fontsource/ibm-plex-mono/latin-400.css";
import type { Frontmatter } from "@/types";
export type Props = {
frontmatter?: Frontmatter;
content?: Frontmatter;
file: string;
url: string;
};
const renderer = ("renderer" in Astro.locals) ? Astro.locals.renderer : "html";
---
<style lang="less" is:global>
form input, form textarea {
@apply border-black! ring-offset-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-black focus-visible:ring-offset-2 text-pink-950 placeholder-color-gray-6 bg-#dabbb2;
}

button {

}

:root {
--font-sans-en: "IBM Plex Sans", Lato, "PT Sans", "Noto Sans", "Open Sans", "Roboto", "Helvetica Neue", Helvetica, Arial,
sans-serif;
--font-sans-ja: "IBM Plex Sans JP", "Noto Sans JP", "Noto Sans CJK JP", "MS Meiyo", "Meiryo",
"ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro", "メイリオ", "Meiryo",
"MS Pゴシック", "MS PGothic", "sans-serif";
--font-mono: "IBM Plex Mono",
"JetBrains Mono", "JetBrains Mono NF",
"JetBrainsMono NF",
"更纱等距黑体",
FiraCode, "Fira Code", "FiraCode NF",
"Noto Sans CJK Mono SC", "Source Code Pro",
"Noto Sans Mono", "Noto Sans Mono CJK SC", "Noto Sans Mono CJK JP",
"Noto Sans Mono CJK KR", "Noto Sans Mono CJK TC", "Lucida Console",
Liberation Mono, DejaVu Sans Mono, Consolas, Bitstream Vera Sans Mono,
"Courier New", "FiraCode NF", monospace;
--font-size-fig: 1.18rem;
--bg-tag: #83254f;
--bg-tag-hover: #c82c72;
--bg-tag-active: #b44b7a;
--text-tag: #f6ca1b;
--text-color: black;
--bg-code: #efe2ff;
color-scheme: light;
background-color: #edc089;
}

article#post {
font-size: 1.35rem;
p, li {
font-weight: 500;
}

h1, h1 {
font-weight: bolder;
}

p, h1, h2 {
font-family: "IBM Plex Sans SC", "Mi Sans", "Noto Sans", "Noto Sans CJK SC", "Plangothic P1", "Plangothic P2", "PingFang SC", system-ui, sans-serif;
}

hr {
background-image: none;
block-size: 4px;
background-color: #2b2b2b;
border: none;
}
}
.paper {
background-color: rgb(214, 164, 183)!important;
border: 4px solid #131517;
box-shadow: #131517 4px 4px 0px 0px /* unlogical */;
margin: auto;
inline-size: 1024px;
max-inline-size: calc(100dvi - 2em);
min-inline-size: 380px;
overflow: hidden;
}

.resizable {
resize: inline;
/* overflow-x: hidden; */
}


@media (max-width: 480px) {
.resizable {
inline-size: 100%;
max-inline-size: 100%;
min-inline-size: 100%;
}
}

section#comments {
margin-block: 1em;
}
</style>

{renderer === 'rss' ?
<Common layoutProps={Astro.props}></Common>
<slot />
:

<Bar lang="zh-Hans" />
<Paper
transitionName="main"
padding={true}
paper={frontmatter?.paper ?? true}
>
{
frontmatter ?
<Common layoutProps={Astro.props}>
<slot />
</Common> : <slot />
}
</Paper>

<section id="comments">
<Paper padding={true} paper={true}>
<Comments />
</Paper>
</section>
}
2 changes: 1 addition & 1 deletion src/layouts/Tonsky.astro
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import "@fontsource/ibm-plex-sans/400.css";
import "@fontsource/ibm-plex-sans/latin-600.css";
import "@fontsource/ibm-plex-sans/latin-400-italic.css";
import "@fontsource/ibm-plex-sans-kr";
import "@ibm/plex-sans-sc/css/ibm-plex-sans-sc-all.min.css";
import "plex-sans-sc-cdn/dist/min.css";
const HANS = "&#x6C49;&#35821;";
Expand Down
2 changes: 1 addition & 1 deletion src/posts/gyeeom.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ categories: [韩语]
vert: true
---

import "@ibm/plex-sans-sc/css/ibm-plex-sans-sc-all.min.css";
import "plex-sans-sc-cdn/dist/min.css"; // https://cdn.jsdelivr.net/npm/plex-sans-sc-[email protected]/dist/min.css
import "@fontsource/ibm-plex-sans-kr";
import "@/styles/ko.css";

Expand Down
Loading

0 comments on commit c31f1e8

Please sign in to comment.