Skip to content

Commit

Permalink
Merge branch 'bs-5-ts'
Browse files Browse the repository at this point in the history
Signed-off-by: Miao Wang <[email protected]>
  • Loading branch information
shankerwangmiao committed Apr 27, 2024
2 parents 3083013 + bf8ae33 commit 258fb07
Show file tree
Hide file tree
Showing 74 changed files with 7,772 additions and 1,347 deletions.
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

[*.{html,md,js,vue,es6,json,css,scss}]
charset = utf-8
indent_style = space
indent_size = 2

# Matches the exact files either package.json or .travis.yml
[{package.json,.travis.yml}]
indent_style = space
indent_size = 2

11 changes: 9 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:
branches: [master]

jobs:
jobs:
build_and_upload:
runs-on: ubuntu-latest
steps:
Expand All @@ -16,13 +16,20 @@ jobs:
- name: Build the site in the tunathu/mirror-web container
run: |
echo "Working on ref ${{github.ref}}"
docker run --user "$(id -u):$(id -g)" --env JEKYLL_ENV="production" -v ${{ github.workspace }}:/data tunathu/mirror-web:legacy jekyll build --future
docker run --user "$(id -u):$(id -g)" --env NODE_ENV=production --env HOME=/tmp -v ${{ github.workspace }}:/data tunathu/mirror-web:latest npm ci
docker run --user "$(id -u):$(id -g)" --env JEKYLL_ENV="production" -v ${{ github.workspace }}:/data tunathu/mirror-web:latest jekyll build --future
- name: Upload artifacts
if: ${{ github.ref == 'refs/heads/master' }}
uses: actions/upload-pages-artifact@v1
with:
path: '_site/'
name: 'gh-pages-${{github.sha}}'
- name: Upload artifacts
if: ${{ github.ref != 'refs/heads/master' }}
uses: actions/upload-artifact@v4
with:
path: '_site'
name: gh-pages-${{github.sha}}

deploy:
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
_site
.sass-cache/
.jekyll-cache/
Gemfile.lock
.jekyll-metadata
*.swp
*~
.bundle
vendor
.vscode/

/node_modules/
_stats.html
26 changes: 21 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
source 'https://rubygems.org'
gem 'github-pages'
gem 'jekyll-minifier'
gem 'jekyll-babel'
gem 'jekyll-fontawesome-svg', '~> 0.4.0'
source 'https://mirrors.tuna.tsinghua.edu.cn/rubygems/'

gem 'jekyll', '~> 4.3', '>= 4.3.3'

group :jekyll_deps do
gem 'bigdecimal', '~> 3.1', '>= 3.1.7'
gem 'csv', '~> 3.3'
gem 'base64', '~> 0.2.0'
gem "webrick", "~> 1.8"
end

group :jekyll_plugins do
gem 'jekyll-paginate', '~> 1.1'
gem 'jekyll-relative-links', '~> 0.7.0'
gem 'jekyll-sitemap', '~> 1.4'
gem 'jekyll-titles-from-headings', '~> 0.5.3'
gem 'jekyll-fontawesome-svg', '~> 0.4.0'
gem 'jekyll-minifier', '~> 0.1.10'
end

gem 'vite_ruby', '~> 3.2'
117 changes: 117 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
GEM
remote: https://mirrors.tuna.tsinghua.edu.cn/rubygems/
specs:
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
base64 (0.2.0)
bigdecimal (3.1.7)
colorator (1.1.0)
concurrent-ruby (1.2.3)
cssminify2 (2.0.1)
csv (3.3.0)
dry-cli (0.7.0)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
eventmachine (1.2.7)
execjs (2.9.1)
ffi (1.16.3)
forwardable-extended (2.6.0)
google-protobuf (3.23.4)
htmlcompressor (0.4.0)
http_parser.rb (0.8.0)
i18n (1.14.4)
concurrent-ruby (~> 1.0)
jekyll (4.3.3)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 1.0)
jekyll-sass-converter (>= 2.0, < 4.0)
jekyll-watch (~> 2.0)
kramdown (~> 2.3, >= 2.3.1)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (>= 0.3.6, < 0.5)
pathutil (~> 0.9)
rouge (>= 3.0, < 5.0)
safe_yaml (~> 1.0)
terminal-table (>= 1.8, < 4.0)
webrick (~> 1.7)
jekyll-fontawesome-svg (0.4.0)
jekyll-minifier (0.1.10)
cssminify2 (~> 2.0)
htmlcompressor (~> 0.4)
jekyll (>= 3.5)
json-minify (~> 0.0.3)
uglifier (~> 4.1)
jekyll-paginate (1.1.0)
jekyll-relative-links (0.7.0)
jekyll (>= 3.3, < 5.0)
jekyll-sass-converter (3.0.0)
sass-embedded (~> 1.54)
jekyll-sitemap (1.4.0)
jekyll (>= 3.7, < 5.0)
jekyll-titles-from-headings (0.5.3)
jekyll (>= 3.3, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
json (2.7.2)
json-minify (0.0.3)
json (> 0)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.4)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (5.0.5)
rack (3.0.10)
rack-proxy (0.7.7)
rack
rake (13.2.1)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.6)
rouge (3.30.0)
safe_yaml (1.0.5)
sass-embedded (1.58.3)
google-protobuf (~> 3.21)
rake (>= 10.0.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (2.5.0)
vite_ruby (3.5.0)
dry-cli (>= 0.7, < 2)
rack-proxy (~> 0.6, >= 0.6.1)
zeitwerk (~> 2.2)
webrick (1.8.1)
zeitwerk (2.6.13)

PLATFORMS
ruby

DEPENDENCIES
base64 (~> 0.2.0)
bigdecimal (~> 3.1, >= 3.1.7)
csv (~> 3.3)
jekyll (~> 4.3, >= 4.3.3)
jekyll-fontawesome-svg (~> 0.4.0)
jekyll-minifier (~> 0.1.10)
jekyll-paginate (~> 1.1)
jekyll-relative-links (~> 0.7.0)
jekyll-sitemap (~> 1.4)
jekyll-titles-from-headings (~> 0.5.3)
vite_ruby (~> 3.2)
webrick (~> 1.8)

BUNDLED WITH
2.4.22
22 changes: 18 additions & 4 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,35 @@ kramdown:
permalink: "/:categories/:year/:title/"
excerpt_separator: <!--more--> #use this in posts to define how long the excerpt of the post (that is shown on the Blog page) is

sass:
sass_dir: assets/css
future: true
google_verify: Lwh0NyQ1YAKRuLlXXkk0_QvgJpGLRQVA8xaoRn81Ysk

vite:
config_path: _src/vite.json
viteConfig: _vite.config.mjs

plugins:
- jekyll-babel
- jekyll-minifier
- jekyll/fontawesome/svg

babel_js_extensions: 'es6'
jekyll-minifier:
exclude: 'cal.ics'
exclude:
- "cal.ics"
- "assets/*"

# Short text about your company. Shown in footer on every page and also separately on Home and Contact page.
about: "清华大学 TUNA 协会原名清华大学学生网管会,注册名清华大学学生网络与开源软件协会,是由清华大学网络技术和开源软件爱好者、技术宅组成的团体。现阶段向校内外提供开源软件镜像等服务。"

include: ['_pages']

addition_exclude:
- package.json
- package-lock.json
- node_modules/
- Gemfile
- Gemfile.lock
- README.md
- vendor/
- Dockerfile*
- LICENSE
9 changes: 5 additions & 4 deletions _includes/footer.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<div class="flex-grow-1"></div>
<div id="footerwrap">
<div class="container">
<div class="row">
<div class="col-sm-4">
<div class="col-lg-4 col-12">
<p>{{ site.about }}</p>
</div>

<div class="col-sm-4">
<h4>Contact Us</h4>
<div class="col-lg-4 col-12">
<h4 class="mt-0">Contact Us</h4>
<div>
<ul class="social">
<li>
Expand All @@ -31,7 +32,7 @@ <h4>Contact Us</h4>
</div>
</div>

<div class="col-sm-4">
<div class="col-lg-4 col-12">
{% include pic.html name="logo-white" %}
<p style="color: #384452"> The best team on the planet. </p>
</div>
Expand Down
11 changes: 2 additions & 9 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@
{% endif %}

<title>{{ page_title }}</title>

<!-- Bootstrap core CSS -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">

<!-- Custom styles for this template -->
<link href="{{ "/assets/css/style.css" | prepend: site.baseurl }}?{{ site.data['hash'] }}" rel="stylesheet">

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js"></script>
{% include vite_script.html %}
<link rel="stylesheet" href="{% vite_asset_path bs3-polyfill.scss %}" media="screen" integrity="sha256-OnlyforlegacybrowsersAAAAAAAAAAAAAAAAAAAAAA=" />
</head>
29 changes: 13 additions & 16 deletions _includes/nav.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
<!-- Fixed navbar -->
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar navbar-default navbar-expand-lg mt-3 bg-body" role="navigation">
<div class="container-fluid container-xl">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/"><!--
-->{% include pic.html name="logo-small" %} {{ site.brand }}</a>
</div>
<div class="navbar-collapse collapse navbar-right">
<ul class="nav navbar-nav">
<li {% if page.permalink == "/" %}class="active"{% endif %}><a href="{{"/" | prepend: site.baseurl }}">HOME</a></li>
<li {% if page.permalink == "/events/" or page.categories contains "event" %}class="active"{% endif %}><a href="{{"/events/" | prepend: site.baseurl }}">EVENTS</a></li>
<li {% if page.permalink == "/blog/" or page.categories contains "blog" %}class="active"{% endif %}><a href="{{"/blog/" | prepend: site.baseurl }}">BLOG</a></li>
<li><a href="{{ "/feed.xml" | prepend: site.baseurl }}">RSS</a></li>
<li><a href="https://podcast.tuna.moe/">PODCAST</a></li>
<li><a href="http://mirrors.tuna.tsinghua.edu.cn/">MIRRORS</a></li>
<button type="button" class="navbar-toggler" data-bs-toggle="collapse" data-bs-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
{% fa_svg fas.fa-bars %}
</button>
<div class="navbar-collapse collapse justify-content-end" id="navbarNavDropdown">
<ul class="nav navbar-nav" role="menubar">
<li role="none" class="nav-item"><a role="menuitem" class="nav-link {% if page.permalink == "/" %}active{% endif %}" href="{{"/" | prepend: site.baseurl }}">HOME</a></li>
<li role="none" class="nav-item"><a role="menuitem" class="nav-link {% if page.permalink == "/events/" or page.categories contains "event" %}active{% endif %}" href="{{"/events/" | prepend: site.baseurl }}">EVENTS</a></li>
<li role="none" class="nav-item"><a role="menuitem" class="nav-link {% if page.permalink == "/blog/" or page.categories contains "blog" %}active{% endif %}" href="{{"/blog/" | prepend: site.baseurl }}">BLOG</a></li>
<li role="none" class="nav-item"><a role="menuitem" class="nav-link" href="{{ "/feed.xml" | prepend: site.baseurl }}">RSS</a></li>
<li role="none" class="nav-item"><a role="menuitem" class="nav-link" href="https://podcast.tuna.moe/">PODCAST</a></li>
<li role="none" class="nav-item"><a role="menuitem" class="nav-link" href="http://mirrors.tuna.tsinghua.edu.cn/">MIRRORS</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
Expand Down
35 changes: 16 additions & 19 deletions _includes/sidebar.html
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
<div class="col-lg-3">
<h4>Subscribe</h4>
<div class="hline"></div>
<p>
<p class="rss-subscribe">{% fa_svg fas.fa-rss %} Subscribe to this blog <a href="{{ "/feed.xml" | prepend: site.baseurl }}">via RSS</a>.</p>
</p>
<div class="spacing"></div>
<h4>Categories</h4>
<div class="hline"></div>
<section class="mb-3">
<h4 class="border-bottom pb-2">Subscribe</h4>
<p class="rss-subscribe">{% fa_svg fas.fa-rss %} Subscribe to this blog <a href="{{ "/feed.xml" | prepend: site.baseurl }}">via RSS</a>.</p>
</section>
<section class="mb-3">
<h4 class="border-bottom pb-2">Categories</h4>
{% for category in site.categories %}{% unless category.first == "blog" or category.first == "event" %}
<p>
<a href="{{ category.url }}">{% fa_svg fas.fa-angle-right %} {{ category | first | capitalize }}</a>
<span class="badge badge-theme pull-right">{{ category | last | size }}</span>
<span class="badge text-bg-theme float-end">{{ category | last | size }}</span>
</p>
{% endunless %}{% endfor %}

<div class="spacing"></div>

<h4>Popular Tags</h4>
<div class="hline"></div>
<p>
{% for category in site.categories %}{% unless category.first == "blog" or category.first == "event" %}
<a class="btn btn-theme" href="{{ category.url }}" role="button">{{ category | first | capitalize }} ({{ category | last | size }})</a>
{% endunless %}{% endfor %}
</p>
</section>
<section>
<h4 class="border-bottom pb-2">Popular Tags</h4>
<p>
{% for category in site.categories %}{% unless category.first == "blog" or category.first == "event" %}
<a class="btn btn-theme" href="{{ category.url }}" role="button">{{ category | first | capitalize }} ({{ category | last | size }})</a>
{% endunless %}{% endfor %}
</p>
</section>
</div>
Loading

0 comments on commit 258fb07

Please sign in to comment.