Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
375 changes: 319 additions & 56 deletions assets/css/main.css

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions content/announcements/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: "社区公告"
description: "HelloLLVM 社区的正式公告与计划发布。"
---
2 changes: 2 additions & 0 deletions content/archives.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
title: "历史存档"
slug: "archives"
date: 2021-10-24
description: "2021 年及以前的旧版站点内容存档:OSDT 社区线下聚会通知与公告。"
---

# 请访问和订阅 HelloGCC.org
Expand Down
21 changes: 20 additions & 1 deletion hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
19 changes: 5 additions & 14 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,18 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="color-scheme" content="light dark" />
<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }} · {{ .Site.Title }}{{ end }}</title>
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}" />
{{ with resources.Get "css/main.css" }}
<link rel="stylesheet" href="{{ .RelPermalink }}" />
{{ with resources.Get "css/main.css" | fingerprint }}
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" />
{{ end }}
</head>
<body>
<header class="header">
<div class="wrap">
<a class="brand" href="{{ "/" | relURL }}">{{ .Site.Title }}</a>
<p class="tagline">{{ .Site.Params.tagline }}</p>
<nav aria-label="Main navigation">
{{ range .Site.Menus.main }}
<a href="{{ if .Page }}{{ .Page.RelPermalink }}{{ else }}{{ .URL }}{{ end }}">{{ .Name }}</a>
{{ end }}
</nav>
</div>
</header>
{{ partial "site-header.html" . }}
<main class="wrap">
{{ block "main" . }}{{ end }}
</main>
<footer class="footer wrap">© {{ now.Year }} HelloLLVM</footer>
{{ partial "site-footer.html" . }}
</body>
</html>
18 changes: 11 additions & 7 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
{{ define "main" }}
<section>
<header class="page-head">
<h1>{{ .Title }}</h1>
{{ with .Content }}<div class="intro">{{ . }}</div>{{ end }}
<div class="cards">
</header>
<section class="section">
<ul class="cards">
{{ range .Pages.ByDate.Reverse }}
<article class="card">
<li class="card">
<h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
<p class="meta">{{ .Date.Format "2006-01-02" }}</p>
<p>{{ .Summary }}</p>
{{ if not .Date.IsZero }}
<span class="meta"><time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "2006-01-02" }}</time></span>
{{ end }}
<p>{{ with .Description }}{{ . }}{{ else }}{{ .Summary | plainify | truncate 120 }}{{ end }}</p>
<a class="more" href="{{ .RelPermalink }}">阅读全文<span class="sr-only">:{{ .Title }}</span><span aria-hidden="true"> →</span></a>
</article>
</li>
{{ end }}
</div>
</ul>
</section>
{{ end }}
13 changes: 11 additions & 2 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
{{ define "main" }}
<article class="post">
<h1>{{ .Title }}</h1>
<p class="meta">{{ .Date.Format "2006-01-02" }}</p>
<header class="post-head">
<h1>{{ .Title }}</h1>
<span class="meta">
{{ if not .Date.IsZero }}<time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "2006-01-02" }}</time>{{ end }}
{{ with .Site.GetPage (printf "/%s" .Section) }}<a class="tag" href="{{ .RelPermalink }}">{{ .Title }}</a>{{ end }}
{{ range .Params.tags }}<span class="tag">{{ . }}</span>{{ end }}
</span>
</header>
<div class="post-content">{{ .Content }}</div>
<footer class="post-footer">
{{ with .Site.GetPage (printf "/%s" .Section) }}<a href="{{ .RelPermalink }}">← 返回{{ .Title }}</a>{{ end }}
</footer>
</article>
{{ end }}
58 changes: 58 additions & 0 deletions layouts/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{{ define "main" }}
<section class="hero">
<span class="hero-kicker">{{ .Site.Params.tagline }}</span>
<h1>{{ .Title }}</h1>
<div class="hero-lead">{{ .Content }}</div>
<div class="hero-actions">
{{ with .Site.GetPage "/posts" }}<a class="button button-primary" href="{{ .RelPermalink }}">阅读博客</a>{{ end }}
{{ with .Site.GetPage "/meetups" }}<a class="button" href="{{ .RelPermalink }}">查看 Meetups</a>{{ end }}
{{ with .Site.Params.repoURL }}<a class="button" href="{{ . }}" rel="noopener">{{ partial "icon.html" "github" }} GitHub</a>{{ end }}
</div>
</section>

{{/* Section entry cards: every top-level section plus the legacy archive page. */}}
<section class="section" aria-labelledby="sections-title">
<div class="section-head"><h2 id="sections-title">栏目</h2></div>
<ul class="cards">
{{ range .Site.Sections }}
<li class="card card-section">
<span class="card-icon">{{ partial "icon.html" .Section }}</span>
<h3><a href="{{ .RelPermalink }}">{{ .Title }}</a></h3>
{{ with .Description }}<p>{{ . }}</p>{{ else }}{{ with .Content }}<p>{{ . | plainify | truncate 80 }}</p>{{ end }}{{ end }}
<span class="card-count">{{ len .RegularPages }} 篇</span>
</li>
{{ end }}
{{ with .Site.GetPage "/archives" }}
<li class="card card-section">
<span class="card-icon">{{ partial "icon.html" "archive" }}</span>
<h3><a href="{{ .RelPermalink }}">{{ .Title }}</a></h3>
<p>{{ with .Description }}{{ . }}{{ else }}{{ .Summary | plainify | truncate 80 }}{{ end }}</p>
</li>
{{ end }}
</ul>
</section>

{{/* Latest regular pages across all sections. */}}
{{ $latest := first 6 (where .Site.RegularPages "Section" "ne" "") }}
{{ with $latest }}
<section class="section" aria-labelledby="latest-title">
<div class="section-head">
<h2 id="latest-title">最新动态</h2>
{{ with $.Site.GetPage "/posts" }}<a href="{{ .RelPermalink }}">全部文章 →</a>{{ end }}
</div>
<ul class="cards">
{{ range . }}
<li class="card">
<h3><a href="{{ .RelPermalink }}">{{ .Title }}</a></h3>
<span class="meta">
<time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "2006-01-02" }}</time>
{{ with .Site.GetPage (printf "/%s" .Section) }}<span class="tag">{{ .Title }}</span>{{ end }}
</span>
<p>{{ .Summary | plainify | truncate 110 }}</p>
<a class="more" href="{{ .RelPermalink }}">阅读全文<span class="sr-only">:{{ .Title }}</span><span aria-hidden="true"> →</span></a>
</li>
{{ end }}
</ul>
</section>
{{ end }}
{{ end }}
12 changes: 12 additions & 0 deletions layouts/partials/icon.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- /* Inline SVG icons, no external icon font. Usage: partial "icon.html" "github" */ -}}
{{- if eq . "github" -}}
<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 .5A11.5 11.5 0 0 0 .5 12a11.5 11.5 0 0 0 7.86 10.92c.58.1.79-.25.79-.56v-2.1c-3.2.7-3.87-1.37-3.87-1.37-.52-1.33-1.28-1.68-1.28-1.68-1.04-.71.08-.7.08-.7 1.15.08 1.76 1.19 1.76 1.19 1.03 1.76 2.69 1.25 3.35.96.1-.75.4-1.25.73-1.54-2.55-.29-5.24-1.28-5.24-5.69 0-1.26.45-2.29 1.19-3.09-.12-.29-.52-1.46.11-3.05 0 0 .97-.31 3.17 1.18a11 11 0 0 1 5.78 0c2.2-1.49 3.17-1.18 3.17-1.18.63 1.59.23 2.76.11 3.05.74.8 1.19 1.83 1.19 3.09 0 4.42-2.7 5.4-5.26 5.68.41.36.78 1.06.78 2.14v3.17c0 .31.21.67.8.56A11.5 11.5 0 0 0 23.5 12 11.5 11.5 0 0 0 12 .5z"/></svg>
{{- else if eq . "posts" -}}
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 4h11l3 3v13H5z"/><path d="M8 10h8M8 14h8M8 18h5"/></svg>
{{- else if eq . "meetups" -}}
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="9" cy="8" r="3"/><circle cx="17" cy="9" r="2.5"/><path d="M3 19c0-3 2.7-5 6-5s6 2 6 5M14 18c.4-2 2-3.5 3.8-3.5 1.6 0 3.2 1.2 3.2 3.5"/></svg>
{{- else if eq . "announcements" -}}
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 10v4h3l6 4V6l-6 4H4z"/><path d="M16 9a4 4 0 0 1 0 6M18.5 6.5a8 8 0 0 1 0 11"/></svg>
{{- else if eq . "archive" -}}
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="4" width="18" height="5" rx="1"/><path d="M5 9v10h14V9M10 13h4"/></svg>
{{- end -}}
15 changes: 15 additions & 0 deletions layouts/partials/site-footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<footer class="site-footer">
<div class="wrap">
<div class="footer-row">
<span>© {{ now.Year }} {{ .Site.Title }} · 由社区志愿者维护</span>
{{ with .Site.Params.repoURL }}<a href="{{ . }}" rel="noopener">网站源码</a>{{ end }}
</div>
{{/* Friend links to sibling OSDT / RISC-V China community sites. Delete this block if unwanted. */}}
{{ with .Site.Params.friendLinks }}
<div class="footer-row">
<span class="footer-label">社区友链</span>
{{ range . }}<a href="{{ .url }}" rel="noopener">{{ .name }}</a>{{ end }}
</div>
{{ end }}
</div>
</footer>
23 changes: 23 additions & 0 deletions layouts/partials/site-header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<header class="site-header">
<div class="wrap">
<a class="brand" href="{{ "/" | relURL }}">
<span class="brand-mark" aria-hidden="true">LLVM</span>
<span>
{{ .Site.Title }}
{{ with .Site.Params.tagline }}<span class="brand-tagline">{{ . }}</span>{{ end }}
</span>
</a>
<nav class="site-nav" aria-label="Main navigation">
{{ $current := . }}
{{ range .Site.Menus.main }}
{{ $active := or ($current.IsMenuCurrent "main" .) ($current.HasMenuCurrent "main" .) }}
<a href="{{ if .Page }}{{ .Page.RelPermalink }}{{ else }}{{ .URL }}{{ end }}"{{ if $active }} aria-current="page"{{ end }}>{{ .Name }}</a>
{{ end }}
{{ with .Site.Params.repoURL }}
<a class="icon-link" href="{{ . }}" title="GitHub" rel="noopener">
{{ partial "icon.html" "github" }}<span class="sr-only">GitHub</span>
</a>
{{ end }}
</nav>
</div>
</header>