diff --git a/assets/css/main.css b/assets/css/main.css index 7a6a31f..e60f4a2 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -1,90 +1,353 @@ +/* ========================================================================== + HelloLLVM 社区 — site styles + Shared design tokens used across the OSDT / RISC-V China community sites. + Light by default, follows the system dark-mode preference. + ========================================================================== */ + :root { - --bg: #050b19; - --bg-soft: #0d1730; - --text: #d9e6ff; - --muted: #8ea4d3; - --primary: #5ab0ff; - --line: #1c2e5d; + --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", + "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", + sans-serif; + --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; + + --bg: #f6f7fa; + --surface: #ffffff; + --surface-2: #eef1f6; + --text: #1b2330; + --muted: #5d6b7e; + --line: #e1e6ee; + --accent: #2b6cb0; + --accent-strong: #1f5590; + --accent-soft: #e4eefb; + --on-accent: #ffffff; + --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06); + --shadow-hover: 0 2px 4px rgba(16, 24, 40, 0.06), 0 14px 32px rgba(16, 24, 40, 0.10); + + --radius: 12px; + --radius-sm: 8px; + --content: 1080px; + --prose: 760px; + --gutter: 16px; +} + +@media (prefers-color-scheme: dark) { + :root { + --bg: #0f141c; + --surface: #171e29; + --surface-2: #1f2836; + --text: #e6ebf3; + --muted: #9aa7b8; + --line: #28344a; + --accent: #6fb1f2; + --accent-strong: #95c6f7; + --accent-soft: #1b2d44; + --on-accent: #0b1a2b; + --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35); + --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 14px 32px rgba(0, 0, 0, 0.45); + } } -* { box-sizing: border-box; } +/* --- base ---------------------------------------------------------------- */ + +*, *::before, *::after { box-sizing: border-box; } + +html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; } + body { margin: 0; - font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif; + font-family: var(--font-sans); + font-size: 16px; + line-height: 1.75; color: var(--text); - background: radial-gradient(circle at top, #132956 0%, var(--bg) 42%); - line-height: 1.7; + background: var(--bg); + -webkit-font-smoothing: antialiased; + min-height: 100vh; + display: flex; + flex-direction: column; } +main { flex: 1 0 auto; width: 100%; } + +a { color: var(--accent); text-decoration: none; } +a:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 0.2em; } -.wrap { - width: min(960px, 92%); - margin: 0 auto; +h1, h2, h3, h4 { + margin: 0 0 0.5em; + line-height: 1.3; + font-weight: 700; + letter-spacing: -0.01em; + overflow-wrap: anywhere; } +h1 { font-size: 2rem; } +h2 { font-size: 1.5rem; } +h3 { font-size: 1.2rem; } -.header { - border-bottom: 1px solid var(--line); - background: rgba(5, 11, 25, 0.92); +p, ul, ol, blockquote, pre, table { margin: 0 0 1.1em; } + +img { max-width: 100%; height: auto; border-radius: var(--radius-sm); } + +code { + font-family: var(--font-mono); + font-size: 0.9em; + background: var(--surface-2); + padding: 0.12em 0.4em; + border-radius: 6px; +} +pre { + background: var(--surface-2); + border: 1px solid var(--line); + border-radius: var(--radius-sm); + padding: 1rem 1.1rem; + overflow-x: auto; + line-height: 1.6; +} +pre code { background: none; padding: 0; font-size: 0.88rem; } + +blockquote { + border-left: 3px solid var(--accent); + margin-left: 0; + padding: 0.2rem 0 0.2rem 1rem; + color: var(--muted); +} + +table { width: 100%; border-collapse: collapse; font-size: 0.95rem; display: block; overflow-x: auto; } +th, td { border: 1px solid var(--line); padding: 0.5rem 0.75rem; text-align: left; vertical-align: top; } +th { background: var(--surface-2); } + +hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; } + +.wrap { width: min(var(--content), 100% - var(--gutter) * 2); margin: 0 auto; } + +.sr-only { + position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; + overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; +} + +/* --- header -------------------------------------------------------------- */ + +.site-header { position: sticky; top: 0; + z-index: 20; + background: var(--surface); + border-bottom: 1px solid var(--line); } - -@supports (backdrop-filter: blur(8px)) { - .header { - backdrop-filter: blur(8px); - background: rgba(5, 11, 25, 0.72); +@supports (backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px)) { + .site-header { + background: color-mix(in srgb, var(--surface) 82%, transparent); + -webkit-backdrop-filter: blur(12px); + backdrop-filter: blur(12px); } } +.site-header .wrap { + display: flex; + align-items: center; + justify-content: space-between; + gap: 1rem 1.5rem; + flex-wrap: wrap; + min-height: 64px; + padding: 0.5rem 0; +} + .brand { - display: inline-block; - margin-top: 1rem; + display: inline-flex; + align-items: center; + gap: 0.6rem; color: var(--text); - text-decoration: none; font-weight: 700; - font-size: 1.25rem; + font-size: 1.1rem; + line-height: 1.2; +} +.brand:hover { text-decoration: none; color: var(--text); } +.brand-mark { + display: inline-grid; + place-items: center; + width: 34px; height: 34px; + border-radius: 9px; + background: var(--accent); + color: var(--on-accent); + font-size: 0.72rem; + font-weight: 800; + letter-spacing: 0.02em; + flex: none; +} +.brand-tagline { + display: block; + font-size: 0.74rem; + font-weight: 500; + color: var(--muted); + letter-spacing: 0.04em; } -.tagline { margin: .35rem 0 .8rem; color: var(--muted); } +.site-nav { display: flex; align-items: center; gap: 0.25rem 0.35rem; flex-wrap: wrap; } +.site-nav a { + color: var(--muted); + font-weight: 500; + padding: 0.35rem 0.7rem; + border-radius: 999px; + font-size: 0.95rem; +} +.site-nav a:hover { color: var(--accent); background: var(--accent-soft); text-decoration: none; } +.site-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); } +.site-nav .icon-link { display: inline-flex; padding: 0.4rem; color: var(--muted); } +.site-nav .icon-link svg { width: 20px; height: 20px; } -nav { display: flex; gap: 1rem; flex-wrap: wrap; padding-bottom: .9rem; } -nav a { color: var(--primary); text-decoration: none; } +/* --- hero ---------------------------------------------------------------- */ -.cards { display: grid; gap: 1rem; margin-top: 1.25rem; } -.card { +.hero { + padding: 3.5rem 0 2.5rem; +} +.hero-kicker { + display: inline-block; + font-size: 0.8rem; + font-weight: 600; + letter-spacing: 0.08em; + text-transform: uppercase; + color: var(--accent); + background: var(--accent-soft); + padding: 0.25rem 0.7rem; + border-radius: 999px; + margin-bottom: 1rem; +} +.hero h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); margin-bottom: 0.6rem; } +.hero-lead { max-width: 640px; font-size: 1.1rem; color: var(--muted); margin-bottom: 1.6rem; } +.hero-lead p { margin: 0 0 0.5em; } +.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; } + +.button { + display: inline-flex; + align-items: center; + gap: 0.4rem; + padding: 0.6rem 1.2rem; + border-radius: 999px; + font-weight: 600; + font-size: 0.95rem; border: 1px solid var(--line); - border-radius: 14px; - padding: 1rem 1.1rem; - background: linear-gradient(135deg, rgba(17, 34, 69, 0.8), rgba(13, 23, 48, 0.8)); + background: var(--surface); + color: var(--text); + transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease; } +.button:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); color: var(--text); } +.button-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); } +.button-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); } -h1, h2, h3 { line-height: 1.3; } -h1 { margin-top: 1.5rem; } +/* --- sections & cards ---------------------------------------------------- */ -a { color: var(--primary); } -.meta { color: var(--muted); font-size: .92rem; margin-top: -.35rem; } -.more { text-decoration: none; } -.intro p:first-child { margin-top: 0; } +.section { padding: 1.5rem 0 2.5rem; } +.section-head { + display: flex; + align-items: baseline; + justify-content: space-between; + gap: 1rem; + margin-bottom: 1rem; +} +.section-head h2 { margin: 0; font-size: 1.35rem; } +.section-head a { font-size: 0.92rem; font-weight: 500; } -.post { +.cards { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); + gap: 1rem; + padding: 0; + margin: 0; + list-style: none; +} +.card { + display: flex; + flex-direction: column; + background: var(--surface); border: 1px solid var(--line); - border-radius: 14px; - margin: 1.5rem 0; - padding: 1.2rem; - background: rgba(9, 18, 38, 0.8); + border-radius: var(--radius); + padding: 1.25rem 1.35rem; + box-shadow: var(--shadow); + transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease; } +.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: var(--accent); } +.card h2, .card h3 { font-size: 1.1rem; margin-bottom: 0.4rem; } +.card h2 a, .card h3 a { color: var(--text); } +.card h2 a:hover, .card h3 a:hover { color: var(--accent); text-decoration: none; } +.card .meta { margin: 0 0 0.6rem; } +.card p { margin: 0 0 0.8rem; color: var(--muted); font-size: 0.95rem; } +.card .more { margin-top: auto; font-size: 0.9rem; font-weight: 500; } -.footer { color: var(--muted); margin: 2rem auto 2.5rem; font-size: .9rem; } +.card-section { align-items: flex-start; } +.card-section .card-icon { + width: 40px; height: 40px; + border-radius: 10px; + display: grid; place-items: center; + background: var(--accent-soft); + color: var(--accent); + margin-bottom: 0.8rem; +} +.card-section .card-icon svg { width: 22px; height: 22px; } +.card-count { font-size: 0.8rem; color: var(--muted); } -code { background: #0f1d3d; padding: .12rem .3rem; border-radius: .3rem; } +.meta { + display: inline-flex; + align-items: center; + gap: 0.5rem; + font-size: 0.85rem; + color: var(--muted); + font-variant-numeric: tabular-nums; +} +.meta .tag { + background: var(--surface-2); + padding: 0.05rem 0.5rem; + border-radius: 999px; + font-size: 0.78rem; +} -.sr-only { - position: absolute; - width: 1px; - height: 1px; - padding: 0; - margin: -1px; - overflow: hidden; - clip: rect(0, 0, 0, 0); - white-space: nowrap; - border: 0; +.note { + background: var(--accent-soft); + border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); + border-radius: var(--radius); + padding: 1rem 1.25rem; + font-size: 0.95rem; +} +.note p { margin: 0; } + +/* --- list page ----------------------------------------------------------- */ + +.page-head { padding: 2.5rem 0 1rem; } +.page-head h1 { margin-bottom: 0.4rem; } +.page-head .intro { color: var(--muted); max-width: var(--prose); } +.page-head .intro p:last-child { margin-bottom: 0; } + +/* --- article ------------------------------------------------------------- */ + +.post { width: min(var(--prose), 100%); margin: 0 auto; padding: 2.5rem 0 3rem; } +.post-head { margin-bottom: 1.75rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); } +.post-head h1 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); } +.post-content h1 { font-size: 1.6rem; margin-top: 2rem; } +.post-content h2 { font-size: 1.35rem; margin-top: 1.8rem; } +.post-content h3 { font-size: 1.15rem; margin-top: 1.4rem; } +.post-content img { display: block; margin: 1.25rem auto; } +.post-content a { overflow-wrap: anywhere; } +.post-footer { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: 0.9rem; } + +/* --- footer -------------------------------------------------------------- */ + +.site-footer { + margin-top: auto; + border-top: 1px solid var(--line); + background: var(--surface); + color: var(--muted); + font-size: 0.9rem; +} +.site-footer .wrap { padding: 1.75rem 0 2rem; display: grid; gap: 0.9rem; } +.footer-row { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; align-items: center; } +.footer-row a { color: var(--muted); } +.footer-row a:hover { color: var(--accent); } +.footer-label { font-weight: 600; color: var(--text); } + +/* --- responsive ---------------------------------------------------------- */ + +@media (max-width: 640px) { + body { font-size: 15.5px; } + .site-header .wrap { min-height: 56px; } + .brand-tagline { display: none; } + .site-nav a { padding: 0.3rem 0.55rem; font-size: 0.9rem; } + .hero { padding: 2.25rem 0 1.5rem; } + .cards { grid-template-columns: 1fr; } + .section-head { flex-direction: column; gap: 0.25rem; } } diff --git a/content/announcements/_index.md b/content/announcements/_index.md new file mode 100644 index 0000000..d09161d --- /dev/null +++ b/content/announcements/_index.md @@ -0,0 +1,4 @@ +--- +title: "社区公告" +description: "HelloLLVM 社区的正式公告与计划发布。" +--- diff --git a/content/archives.md b/content/archives.md index 2eaac99..46b9a13 100644 --- a/content/archives.md +++ b/content/archives.md @@ -1,6 +1,8 @@ --- title: "历史存档" slug: "archives" +date: 2021-10-24 +description: "2021 年及以前的旧版站点内容存档:OSDT 社区线下聚会通知与公告。" --- # 请访问和订阅 HelloGCC.org diff --git a/hugo.toml b/hugo.toml index 90edcc4..29b6dfc 100644 --- a/hugo.toml +++ b/hugo.toml @@ -2,11 +2,30 @@ baseURL = "https://hellollvm.org/" languageCode = "zh-cn" title = "HelloLLVM 社区" defaultContentLanguage = "zh" -summaryLength = 28 +summaryLength = 60 +hasCJKLanguage = true [params] description = "HelloLLVM 社区技术活动与博客" tagline = "Compiler · LLVM · MLIR · Open Source" + repoURL = "https://github.com/hellollvm/website" + +# Friend links shown in the footer. Remove the block to hide the row. +[[params.friendLinks]] + name = "HelloGCC / OSDT" + url = "https://hellogcc.org" +[[params.friendLinks]] + name = "CNRV" + url = "https://cnrv.io" +[[params.friendLinks]] + name = "甲辰计划" + url = "https://rv2036.org" +[[params.friendLinks]] + name = "松竹梅计划" + url = "https://songzhumei-project.org" +[[params.friendLinks]] + name = "PLCT Lab" + url = "https://plctlab.github.io" [taxonomies] tag = "tags" diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index e84aff1..ab7d3fb 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -3,27 +3,18 @@
+{{ .Site.Params.tagline }}
- -