From 1ef07c0f18a18a07327efb30d4319ee0e9d39711 Mon Sep 17 00:00:00 2001 From: Cheng Li Date: Wed, 14 Oct 2026 20:18:20 +0900 Subject: [PATCH 1/2] style: restyle osdt-tech theme with shared light/dark design tokens - Replace the neon dark template with a light-first palette that follows prefers-color-scheme, system font stack, no CDN assets - Split header/footer into partials, add inline SVG GitHub icon, active menu state and optional footer friend links - Simplify home: hero with metrics, latest posts grid, README timeline - Content-only sections (about/authors/resources) render as prose --- themes/osdt-tech/assets/css/main.css | 487 ++++++++++++++---- themes/osdt-tech/layouts/_default/baseof.html | 8 +- themes/osdt-tech/layouts/_default/home.html | 50 +- themes/osdt-tech/layouts/_default/list.html | 37 +- themes/osdt-tech/layouts/_default/single.html | 43 +- themes/osdt-tech/layouts/partials/head.html | 1 + themes/osdt-tech/layouts/partials/icon.html | 12 + .../osdt-tech/layouts/partials/post-card.html | 16 +- .../layouts/partials/site-footer.html | 15 + .../layouts/partials/site-header.html | 19 +- 10 files changed, 516 insertions(+), 172 deletions(-) create mode 100644 themes/osdt-tech/layouts/partials/icon.html create mode 100644 themes/osdt-tech/layouts/partials/site-footer.html diff --git a/themes/osdt-tech/assets/css/main.css b/themes/osdt-tech/assets/css/main.css index da781d4..ea57ff6 100644 --- a/themes/osdt-tech/assets/css/main.css +++ b/themes/osdt-tech/assets/css/main.css @@ -1,104 +1,407 @@ +/* ========================================================================== + OSDT / HelloGCC — osdt-tech theme styles + Shared design tokens used across the OSDT / RISC-V China community sites. + Light by default, follows the system dark-mode preference. + ========================================================================== */ :root { - --bg: #07111f; - --bg-soft: rgba(11, 23, 41, 0.92); - --card: rgba(10, 21, 38, 0.92); - --border: rgba(122, 162, 255, 0.18); - --text: #e9eefb; - --muted: #93a4c6; - --primary: #6ee7ff; - --accent: #8b5cf6; - --glow: rgba(110, 231, 255, 0.28); - --shadow: 0 24px 80px rgba(1, 8, 20, 0.45); -} -* { box-sizing: border-box; } -html { scroll-behavior: smooth; } + --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: #2f855a; + --accent-strong: #276749; + --accent-soft: #e3f3ea; + --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: #68c48e; + --accent-strong: #8fd6ab; + --accent-soft: #1b3326; + --on-accent: #06180d; + --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); + } +} + +/* --- base ---------------------------------------------------------------- */ + +*, *::before, *::after { box-sizing: border-box; } + +html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; } + body { margin: 0; - font-family: Inter, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; - background: radial-gradient(circle at top, rgba(77, 119, 255, 0.16), transparent 32%), var(--bg); - color: var(--text); + font-family: var(--font-sans); + font-size: 16px; line-height: 1.75; + color: var(--text); + 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; } + +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; } + +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(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-flex; + align-items: center; + gap: 0.6rem; + color: var(--text); + font-weight: 700; + 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; +} + +.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; } -a { color: var(--primary); text-decoration-thickness: .08em; text-underline-offset: .18em; } -a:hover { color: #b6f4ff; } -.brand, .button { text-decoration: none; } -.main-nav a, .card-link, .post-card h3 a, .timeline-item h3 a, .site-footer a { text-decoration: underline; text-decoration-color: rgba(110,231,255,.45); } -.page-grid { - position: fixed; inset: 0; pointer-events: none; opacity: .16; - background-image: linear-gradient(rgba(110,231,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(110,231,255,.08) 1px, transparent 1px); - background-size: 36px 36px; - -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.65), transparent 92%); - mask-image: linear-gradient(to bottom, rgba(0,0,0,.65), transparent 92%); -} -.shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; } -.site-header { position: sticky; top: 0; z-index: 20; background: rgba(7,17,31,.96); border-bottom: 1px solid var(--border); } -@supports ((backdrop-filter: blur(18px)) or (-webkit-backdrop-filter: blur(18px))) { - .site-header { background: rgba(7,17,31,.72); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); } -} -.nav-shell { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; gap: 20px; } -.brand { font-size: 1.15rem; font-weight: 800; color: var(--text); letter-spacing: .04em; } -.brand span { color: var(--primary); } -.main-nav { display: flex; flex-wrap: wrap; gap: 18px; } -.main-nav a { color: var(--muted); font-size: .96rem; } -.main-nav a:hover { color: var(--text); } -.hero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .9fr); gap: 28px; padding: 72px 0 36px; align-items: center; } -.hero-copy, .hero-panel, .post-card, .timeline-item, .article-card { - background: linear-gradient(180deg, rgba(17,29,51,.88), rgba(8,17,31,.92)); - border: 1px solid var(--border); +.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; } + +/* --- hero ---------------------------------------------------------------- */ + +.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); + 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); } + +/* --- sections & cards ---------------------------------------------------- */ + +.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; } + +.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: 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; } + +.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; } -.hero-copy { border-radius: 28px; padding: 34px; } -.hero h1, .page-head h1, .article-head h1 { margin: 0 0 16px; line-height: 1.15; } -.hero h1 { font-size: clamp(2.4rem, 5vw, 4.6rem); } -.eyebrow { margin: 0 0 14px; color: var(--primary); text-transform: uppercase; letter-spacing: .18em; font-size: .78rem; } -.hero-copy p:last-of-type { color: var(--muted); max-width: 62ch; } -.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; } -.button { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 12px 18px; border: 1px solid var(--border); background: rgba(255,255,255,.02); color: var(--text); } -.button.primary { background: linear-gradient(90deg, var(--primary), #4f8cff); color: #02111b; font-weight: 700; box-shadow: 0 0 24px var(--glow); } -.hero-panel { border-radius: 28px; padding: 24px; display: grid; gap: 16px; } -.metric { padding: 18px; border-radius: 20px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.04); } -.metric strong { display: block; font-size: 2rem; margin-bottom: 8px; } -.metric span { color: var(--muted); } -.section-block, .list-shell, .article-shell { padding: 18px 0 42px; } -.section-head { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 18px; } -.section-head h2 { margin: 0; font-size: 1.7rem; } -.section-head span, .section-head a, .page-copy, .card-meta, .post-card p, .article-meta, .site-footer p { color: var(--muted); } -.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; } -.post-card { border-radius: 24px; padding: 22px; } -.post-card h3 { margin: 14px 0 12px; font-size: 1.16rem; line-height: 1.4; } -.card-meta { display: flex; justify-content: space-between; gap: 12px; font-size: .86rem; } -.card-link { display: inline-flex; margin-top: 8px; font-weight: 600; } -.timeline-list { display: grid; gap: 14px; } -.timeline-item { border-radius: 22px; padding: 20px 22px; display: grid; grid-template-columns: 132px 1fr; gap: 18px; align-items: start; } -.timeline-item h3 { margin: 0 0 8px; } -.page-head { max-width: 74ch; margin-bottom: 24px; } -.page-head h1 { font-size: clamp(2rem, 4vw, 3.4rem); } -.page-copy { font-size: 1.02rem; } -.article-card { border-radius: 28px; padding: 30px; position: relative; overflow: hidden; } -.article-head { margin-bottom: 26px; } -.article-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; } -.chip { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 10px; background: rgba(110,231,255,.08); border: 1px solid rgba(110,231,255,.14); } -.toc-panel { margin: 0 0 24px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 20px; background: rgba(255,255,255,.02); } -.toc-panel h2 { margin-top: 0; font-size: 1rem; } -.markdown-body { color: var(--text); } -.markdown-body img { max-width: 100%; height: auto; border-radius: 18px; } -.markdown-body pre, .markdown-body code { font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace; } -.markdown-body pre { overflow-x: auto; padding: 16px; border-radius: 18px; background: rgba(1,10,24,.82); border: 1px solid rgba(255,255,255,.05); } -.markdown-body :not(pre) > code { padding: .16em .4em; border-radius: 8px; background: rgba(255,255,255,.06); } -.markdown-body blockquote { margin: 1.2rem 0; padding: .2rem 1rem; border-left: 3px solid var(--primary); background: rgba(110,231,255,.05); } -.markdown-body table { width: 100%; border-collapse: collapse; } -.markdown-body th, .markdown-body td { border: 1px solid rgba(255,255,255,.08); padding: 10px 12px; } -.site-footer { padding: 12px 0 44px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; } -@media (max-width: 900px) { - .hero { grid-template-columns: 1fr; } - .timeline-item { grid-template-columns: 1fr; } +.card-section .card-icon svg { width: 22px; height: 22px; } +.card-count { font-size: 0.8rem; color: var(--muted); } + +.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; } + +.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) { - .nav-shell { flex-direction: column; align-items: flex-start; } - .hero-copy, .hero-panel, .post-card, .article-card, .timeline-item { border-radius: 20px; } - .hero-copy, .article-card { padding: 22px; } - .section-head { flex-direction: column; align-items: flex-start; } + 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; } } -a:focus-visible, .button:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 10px; } +/* --- hellogcc specific ----------------------------------------------------- */ + +.hero-grid { + display: grid; + grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.8fr); + gap: 2rem; + align-items: center; +} +.metrics { display: grid; gap: 0.75rem; } +.metric { + background: var(--surface); + border: 1px solid var(--line); + border-radius: var(--radius); + padding: 0.9rem 1.1rem; + box-shadow: var(--shadow); + display: flex; + align-items: baseline; + gap: 0.75rem; +} +.metric strong { font-size: 1.6rem; color: var(--accent); font-variant-numeric: tabular-nums; } +.metric span { color: var(--muted); font-size: 0.92rem; } + +.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); } +.timeline-item { position: relative; padding: 0 0 1.25rem 1.5rem; } +.timeline-item::before { + content: ""; position: absolute; left: -7px; top: 0.55rem; + width: 12px; height: 12px; border-radius: 50%; + background: var(--accent); border: 2px solid var(--bg); +} +.timeline-item time { font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; } +.timeline-item h3 { font-size: 1.05rem; margin: 0.1rem 0 0.25rem; } +.timeline-item h3 a { color: var(--text); } +.timeline-item h3 a:hover { color: var(--accent); text-decoration: none; } +.timeline-item p { margin: 0; color: var(--muted); font-size: 0.93rem; } + +.toc-panel { + background: var(--surface-2); + border: 1px solid var(--line); + border-radius: var(--radius); + padding: 1rem 1.25rem; + margin: 0 0 1.75rem; + font-size: 0.92rem; +} +.toc-panel h2 { font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.5rem; } +.toc-panel ul { margin: 0; padding-left: 1.1rem; } +.toc-panel li { margin: 0.15rem 0; } + +.markdown-body { overflow-wrap: anywhere; } +.markdown-body iframe { max-width: 100%; } + +@media (max-width: 760px) { + .hero-grid { grid-template-columns: 1fr; } +} diff --git a/themes/osdt-tech/layouts/_default/baseof.html b/themes/osdt-tech/layouts/_default/baseof.html index 3c8e5ee..70aec80 100644 --- a/themes/osdt-tech/layouts/_default/baseof.html +++ b/themes/osdt-tech/layouts/_default/baseof.html @@ -4,14 +4,10 @@ {{ partial "head.html" . }} -
{{ partial "site-header.html" . }} -
+
{{ block "main" . }}{{ end }}
- + {{ partial "site-footer.html" . }} diff --git a/themes/osdt-tech/layouts/_default/home.html b/themes/osdt-tech/layouts/_default/home.html index 563479c..15daf39 100644 --- a/themes/osdt-tech/layouts/_default/home.html +++ b/themes/osdt-tech/layouts/_default/home.html @@ -11,48 +11,50 @@ {{ $events = where $articlePages "Params.categories" "intersect" (slice .) }} {{ end }} {{ $updates := first 4 (sort $readmePages "Date" "desc") }} -
-
-

Hugo · Tech Blog · Community Archive

+ +
+
+ {{ with .Site.Params.tagline }}{{ . }}{{ end }}

{{ .Site.Params.heroTitle }}

-

{{ .Site.Params.heroSubtitle }}

+

{{ .Site.Params.heroSubtitle }}

-
+
{{ len $articlePages }}篇技术文章与公告
{{ len $events }}条社区活动记录
-
{{ len $readmePages }}篇 README 迁移时间线
+
{{ len $readmePages }}篇 README 历史更新
-
+
-

最新文章

- 查看全部 +

最新文章

+ 查看全部 →
-
+
    {{ range $recent }}{{ partial "post-card.html" . }}{{ end }} -
+
-
+{{ with $updates }} +
-

README 时间线

- 把仓库首页中的历史更新拆成独立 post +

README 时间线

+ 仓库首页的历史更新,按提交时间拆分
-
- {{ range $updates }} -
+
    + {{ range . }} +
  1. -
    -

    {{ .Title }}

    -

    {{ .Summary | plainify | truncate 100 }}

    -
    -
+

{{ .Title }}

+

{{ .Summary | plainify | truncate 100 }}

+ {{ end }} -
+
{{ end }} +{{ end }} diff --git a/themes/osdt-tech/layouts/_default/list.html b/themes/osdt-tech/layouts/_default/list.html index da8f346..b16c146 100644 --- a/themes/osdt-tech/layouts/_default/list.html +++ b/themes/osdt-tech/layouts/_default/list.html @@ -1,20 +1,23 @@ {{ define "main" }} -
-
-

Archive

-

{{ .Title }}

- {{ with .Content }}
{{ . }}
{{ end }} -
- {{ $pages := .RegularPagesRecursive }} - {{ if eq .Section "posts" }} - {{ $pages = where $pages "Type" "ne" "readme-history" }} - {{ end }} - {{ if gt (len $pages) 0 }} -
- {{ range $pages.ByDate.Reverse }}{{ partial "post-card.html" . }}{{ end }} -
- {{ else }} -
{{ .Content }}
- {{ end }} +{{ $pages := .RegularPagesRecursive }} +{{ if eq .Section "posts" }} + {{ $pages = where $pages "Type" "ne" "readme-history" }} +{{ end }} +{{ if gt (len $pages) 0 }} +
+

{{ .Title }}

+ {{ with .Content }}
{{ . }}
{{ end }} +
+
+
    + {{ range $pages.ByDate.Reverse }}{{ partial "post-card.html" . }}{{ end }} +
+{{ else }} +{{/* Content-only sections such as about / authors / resources render as a prose page. */}} +
+

{{ .Title }}

+
{{ .Content }}
+
+{{ end }} {{ end }} diff --git a/themes/osdt-tech/layouts/_default/single.html b/themes/osdt-tech/layouts/_default/single.html index 47f51e8..883a46d 100644 --- a/themes/osdt-tech/layouts/_default/single.html +++ b/themes/osdt-tech/layouts/_default/single.html @@ -1,23 +1,24 @@ {{ define "main" }} -
- {{ $toc := .TableOfContents }} - {{ $tocItems := strings.Count "
  • " $toc }} -
    -
    -

    {{ with .Section }}{{ . | title }}{{ end }}

    -

    {{ .Title }}

    - -
    - {{ if ge $tocItems 3 }} - - {{ end }} -
    {{ .Content }}
    -
    -
  • +{{ $toc := .TableOfContents }} +{{ $tocItems := strings.Count "
  • " $toc }} +
    +
    +

    {{ .Title }}

    + + {{ if not .Date.IsZero }}{{ end }} + {{ with .Site.GetPage (printf "/%s" .Section) }}{{ .Title }}{{ end }} + {{ range .Params.categories }}{{ . }}{{ end }} + +
    + {{ if ge $tocItems 3 }} + + {{ end }} +
    {{ .Content }}
    + +
    {{ end }} diff --git a/themes/osdt-tech/layouts/partials/head.html b/themes/osdt-tech/layouts/partials/head.html index 3f8086b..37d1d1f 100644 --- a/themes/osdt-tech/layouts/partials/head.html +++ b/themes/osdt-tech/layouts/partials/head.html @@ -1,5 +1,6 @@ + {{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }} · {{ .Site.Title }}{{ end }} {{ partial "head/css.html" . }} diff --git a/themes/osdt-tech/layouts/partials/icon.html b/themes/osdt-tech/layouts/partials/icon.html new file mode 100644 index 0000000..dd782c2 --- /dev/null +++ b/themes/osdt-tech/layouts/partials/icon.html @@ -0,0 +1,12 @@ +{{- /* Inline SVG icons, no external icon font. Usage: partial "icon.html" "github" */ -}} +{{- if eq . "github" -}} + +{{- else if eq . "posts" -}} + +{{- else if eq . "meetups" -}} + +{{- else if eq . "announcements" -}} + +{{- else if eq . "archive" -}} + +{{- end -}} diff --git a/themes/osdt-tech/layouts/partials/post-card.html b/themes/osdt-tech/layouts/partials/post-card.html index 5bc2911..73af4ae 100644 --- a/themes/osdt-tech/layouts/partials/post-card.html +++ b/themes/osdt-tech/layouts/partials/post-card.html @@ -1,9 +1,9 @@ -
    -
    - - {{ with .Params.categories }}{{ index . 0 }}{{ end }} -
    +
  • {{ .Title }}

    - {{ with .Summary }}

    {{ . | plainify | truncate 120 }}

    {{ end }} - 阅读全文 → -
  • + + + {{ with .Params.categories }}{{ index . 0 }}{{ end }} + + {{ with .Summary }}

    {{ . | plainify | truncate 110 }}

    {{ end }} + 阅读全文:{{ .Title }} +
  • diff --git a/themes/osdt-tech/layouts/partials/site-footer.html b/themes/osdt-tech/layouts/partials/site-footer.html new file mode 100644 index 0000000..6a22326 --- /dev/null +++ b/themes/osdt-tech/layouts/partials/site-footer.html @@ -0,0 +1,15 @@ +
    +
    + + {{/* Friend links to sibling OSDT / RISC-V China community sites. Delete this block if unwanted. */}} + {{ with .Site.Params.friendLinks }} + + {{ end }} +
    +
    diff --git a/themes/osdt-tech/layouts/partials/site-header.html b/themes/osdt-tech/layouts/partials/site-header.html index 72790e0..c7c87ad 100644 --- a/themes/osdt-tech/layouts/partials/site-header.html +++ b/themes/osdt-tech/layouts/partials/site-header.html @@ -1,9 +1,20 @@