Skip to content

Commit 785b806

Browse files
committed
Add NUMA 0
1 parent 0684b4b commit 785b806

File tree

5 files changed

+260
-28
lines changed

5 files changed

+260
-28
lines changed

assets/css/_contact2.css

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*************************************************
2+
* Contact
3+
**************************************************/
4+
5+
.wg-contact-v2 .fa-ul {
6+
margin-left: 3.14285714rem; /* Must be > `fa-2x` icon size. */
7+
}
8+
9+
.wg-contact-v2 .fa-li {
10+
position: absolute;
11+
left: -3.14285714rem; /* Negative of `.wg-contact .fa-ul` margin. */
12+
width: 2rem; /* Match `fa-2x` icon size. */
13+
top: 0.14285714em; /* Default FA value. */
14+
text-align: center;
15+
}
16+
17+
.wg-contact-v2 li {
18+
padding-top: 0.8rem; /* Align text with bottom of `fa-2x` icon. */
19+
margin-bottom: 0.3rem;
20+
}
21+
22+
.wg-contact-v2 li:last-of-type {
23+
margin-bottom: 0;
24+
}
25+
26+
#map2 {
27+
height: 350px;
28+
width: 100%;
29+
}
30+
31+
#map2 a {
32+
color: initial;
33+
}

assets/js/map2.js

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/*************************************************
2+
* Hugo Blox Builder
3+
* https://github.com/HugoBlox/hugo-blox-builder
4+
*
5+
* Hugo Blox Builder Maps
6+
**************************************************/
7+
8+
// Initialize Google Maps or OpenStreetMap via Leaflet.
9+
function initMap2() {
10+
if ($('#map2').length) {
11+
let map_provider = $('#map-2-provider').val();
12+
let lat = $('#map-2-lat').val();
13+
let lng = $('#map-2-lng').val();
14+
let zoom = parseInt($('#map-2-zoom').val());
15+
let address = $('#map-2-dir').val();
16+
let api_key = $('#map-2-api-key').val();
17+
18+
if (map_provider === 'google') {
19+
let map = new GMaps({
20+
div: '#map',
21+
lat: lat,
22+
lng: lng,
23+
zoom: zoom,
24+
zoomControl: true,
25+
zoomControlOpt: {
26+
style: 'SMALL',
27+
position: 'TOP_LEFT',
28+
},
29+
streetViewControl: false,
30+
mapTypeControl: false,
31+
gestureHandling: 'cooperative',
32+
});
33+
34+
map.addMarker({
35+
lat: lat,
36+
lng: lng,
37+
click: function () {
38+
let url = 'https://www.google.com/maps/place/' + encodeURIComponent(address) + '/@' + lat + ',' + lng + '/';
39+
window.open(url, '_blank');
40+
},
41+
title: address,
42+
});
43+
} else {
44+
let map = new L.map('map2').setView([lat, lng], zoom);
45+
if (map_provider === 'mapbox' && api_key.length) {
46+
L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
47+
attribution:
48+
'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>',
49+
tileSize: 512,
50+
maxZoom: 18,
51+
zoomOffset: -1,
52+
id: 'mapbox/streets-v11',
53+
accessToken: api_key,
54+
}).addTo(map);
55+
} else {
56+
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
57+
maxZoom: 19,
58+
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>',
59+
}).addTo(map);
60+
}
61+
let marker = L.marker([lat, lng]).addTo(map);
62+
let url = lat + ',' + lng + '#map2=' + zoom + '/' + lat + '/' + lng + '&layers=N';
63+
marker.bindPopup(
64+
address +
65+
'<p><a href="https://www.openstreetmap.org/directions?engine=osrm_car&route=' +
66+
url +
67+
'">Routing via OpenStreetMap</a></p>',
68+
);
69+
}
70+
}
71+
}
72+
73+
document.addEventListener('DOMContentLoaded', function () {
74+
// Initialise street maps if necessary.
75+
initMap2();
76+
});

content/_index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ sections:
5050
content:
5151
title: Interrupts
5252
text: |
53-
**Jan 2025** - We are excited to welcome Liheng, Xiangcan and Yonghao to the TELOS Systems Lab as new PhD students!
53+
**Jan 2025** - We are excited to welcome Liheng, Xiangcan, Xiaohe, Yonghao and Zhongwang to the TELOS Systems Lab as new PhD students!
5454
55-
**Nov 2024** - Pivot is accepted to HPCA 2025! Congratulations to Liren!
55+
**Nov 2024** - Pivot is accepted to HPCA 2025! Congratulations to Liren and all!
5656
57-
**Sep 2024** - DistFuzz is accepted to NDSS 2025! Congratulations to Yonghao!
57+
**Sep 2024** - DistFuzz is accepted to NDSS 2025! Congratulations to Yonghao and all!
5858
5959
---

content/contact/index.md

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,34 @@ type: landing
77
sections:
88
- block: contact
99
content:
10-
title: Physical address
11-
# text: |-
12-
# Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer tempus augue non tempor egestas. Proin nisl nunc, dignissim in accumsan dapibus, auctor ullamcorper neque. Quisque at elit felis. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Aenean eget elementum odio. Cras interdum eget risus sit amet aliquet. In volutpat, nisl ut fringilla dignissim, arcu nisl suscipit ante, at accumsan sapien nisl eu eros.
13-
14-
# phone: 888 888 88 88
10+
title: NUMA 0
11+
12+
address:
13+
street: 5 Yiheyuan Rd
14+
city: Haidian District, Beijing
15+
postcode: '100871'
16+
country: China
17+
country_code: CN
18+
coordinates:
19+
# 39.989762, 116.307381
20+
latitude: '39.989762'
21+
longitude: '116.307381'
22+
# 理科1号楼1336
23+
directions: Enter the Science Building (1) and take the elevator to office 1336 on the 3rd floor
24+
autolink: true
25+
design:
26+
columns: '1'
27+
28+
- block: contact_v2
29+
content:
30+
title: NUMA 1
1531
address:
1632
street: New Changping Campus, Shenniu Rd
1733
city: Machikou, Changping District, Beijing
1834
# region: CA
1935
postcode: '102205'
2036
country: China
21-
country_code: US
37+
country_code: CN
2238
coordinates:
2339
latitude: '40.176246'
2440
longitude: '116.161006'
@@ -47,23 +63,4 @@ sections:
4763
design:
4864
columns: '1'
4965

50-
# - block: markdown
51-
# content:
52-
# title:
53-
# subtitle: ''
54-
# text:
55-
# design:
56-
# columns: '1'
57-
# background:
58-
# image:
59-
# filename: contact.jpg
60-
# filters:
61-
# brightness: 1
62-
# parallax: false
63-
# position: center
64-
# size: cover
65-
# text_color_light: true
66-
# spacing:
67-
# padding: ['20px', '0', '20px', '0']
68-
# css_class: fullscreen
6966
---
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
{{/* Hugo Blox: Contact */}}
2+
{{/* Documentation: https://hugoblox.com/blocks/ */}}
3+
{{/* License: https://github.com/HugoBlox/hugo-blox-builder/blob/main/LICENSE.md */}}
4+
5+
{{/* Initialise */}}
6+
{{ $page := .wcPage }}
7+
{{ $block := .wcBlock }}
8+
{{ $autolink := default true $block.content.autolink }}
9+
{{ $data := $block.content }}
10+
11+
{{ $columns := $block.design.columns | default "2" }}
12+
13+
{{ with $block.content.title }}
14+
<div class="section-heading col-12 mb-3 text-center">
15+
<h1 class="mb-0">{{ . | markdownify | emojify }}</h1>
16+
{{ with $block.content.subtitle }}<p class="mt-1">{{ . | markdownify | emojify }}</p>{{ end }}
17+
</div>
18+
{{ end }}
19+
20+
<div class="col-12 {{if eq $columns "2"}}col-lg-8{{end}}">
21+
{{ with $block.content.text }}<p>{{ . | emojify | $page.RenderString }}</p>{{ end }}
22+
23+
<ul class="fa-ul">
24+
25+
{{ if $data.email }}
26+
<li>
27+
<i class="fa-li fas fa-envelope fa-2x" aria-hidden="true"></i>
28+
<span id="person-email">
29+
{{- if $autolink }}<a href="mailto:{{ $data.email }}">{{ $data.email }}</a>{{ else }}{{ $data.email }}{{ end -}}
30+
</span>
31+
</li>
32+
{{ end }}
33+
34+
{{ with $data.phone }}
35+
<li>
36+
<i class="fa-li fas fa-phone fa-2x" aria-hidden="true"></i>
37+
<span id="person-telephone">
38+
{{- if $autolink }}<a href="tel:{{ . }}">{{ . }}</a>{{ else }}{{ . }}{{ end -}}
39+
</span>
40+
</li>
41+
{{ end }}
42+
43+
{{ $addr_formatted := "" }}{{/* Scoping for maps. */}}
44+
{{ if $data.address.street | or $data.address.city | or $data.address.region | or $data.address.postcode | or $data.address.country }}
45+
{{ $addr_formatted = partial "functions/get_address" (dict "root" . "address" $data.address) }}
46+
<li>
47+
<i class="fa-li fas fa-map-marker fa-2x" aria-hidden="true"></i>
48+
<span id="person-2-address">{{$addr_formatted}}</span>
49+
</li>
50+
{{ end }}
51+
52+
{{ with $data.directions }}
53+
<li>
54+
<i class="fa-li fas fa-compass fa-2x" aria-hidden="true"></i>
55+
<span>{{ . | markdownify | emojify }}</span>
56+
</li>
57+
{{ end }}
58+
59+
{{ with $data.office_hours }}
60+
<li>
61+
<i class="fa-li fas fa-clock fa-2x" aria-hidden="true"></i>
62+
<span>
63+
{{- if not (reflect.IsSlice .)}}{{/* Support legacy string format. */}}
64+
{{- . | markdownify | emojify -}}
65+
{{else}}
66+
{{- delimit . "<br>" | markdownify | emojify -}}
67+
{{end -}}
68+
</span>
69+
</li>
70+
{{ end }}
71+
72+
{{ with $data.appointment_url }}
73+
<li>
74+
<i class="fa-li fas fa-calendar-check fa-2x" aria-hidden="true"></i>
75+
<a href="{{ . }}" target="_blank" rel="noopener">{{ i18n "book_appointment" | default "Book an appointment" }}</a>
76+
</li>
77+
{{ end }}
78+
79+
{{/* Contact links. */}}
80+
{{ range $data.contact_links }}
81+
{{ $pack := or .icon_pack "fas" }}
82+
{{ $pack_prefix := $pack }}
83+
{{ if in (slice "fab" "fas" "far" "fal") $pack }}
84+
{{ $pack_prefix = "fa" }}
85+
{{ end }}
86+
{{ $link := .link }}
87+
{{ $scheme := (urls.Parse $link).Scheme }}
88+
{{ $target := "" }}
89+
{{ if not $scheme }}
90+
{{ $link = .link | relLangURL }}
91+
{{ else if in (slice "http" "https") $scheme }}
92+
{{ $target = "target=\"_blank\" rel=\"noopener\"" }}
93+
{{ end }}
94+
<li>
95+
<i class="fa-li {{ $pack }} {{ $pack_prefix }}-{{ .icon }} fa-2x" aria-hidden="true"></i>
96+
<a href="{{ $link | safeURL }}" {{ $target | safeHTMLAttr }}>{{.name|markdownify|emojify|safeHTML}}</a>
97+
</li>
98+
{{ end }}
99+
100+
</ul>
101+
102+
{{ if and site.Params.features.map.provider $data.coordinates.latitude }}
103+
<div class="d-none">
104+
<input id="map-2-provider" value="{{ lower site.Params.features.map.provider }}">
105+
<input id="map-2-lat" value="{{ $data.coordinates.latitude }}">
106+
<input id="map-2-lng" value="{{ $data.coordinates.longitude }}">
107+
<input id="map-2-dir" value="{{ $addr_formatted }}">
108+
<input id="map-2-zoom" value="{{ site.Params.features.map.zoom | default "15" }}">
109+
<input id="map-2-api-key" value="{{ site.Params.features.map.api_key }}">
110+
</div>
111+
<div id="map2"></div>
112+
{{ end }}
113+
114+
</div>
115+
116+
{{/* Maps */}}
117+
{{ if site.Params.features.map.provider }}
118+
{{ $js := resources.Get "js/map2.js" | js.Build (dict "format" "esm" "minify" true) }}
119+
{{- if hugo.IsProduction -}}
120+
{{- $js = $js | fingerprint "md5" -}}
121+
{{- end -}}
122+
<script src="{{ $js.RelPermalink }}" type="module"></script>
123+
{{- end -}}
124+
125+
{{ $style := resources.Get "css/_contact2.css" }}
126+
<link rel="stylesheet" href="{{ $style.RelPermalink }}" media="print" onload="this.media='all'">

0 commit comments

Comments
 (0)