Skip to content

Commit 7085944

Browse files
committed
Add numpy.org theme and let it inherit from hugo-fresh
0 parents  commit 7085944

33 files changed

Lines changed: 2182 additions & 0 deletions

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*~
2+

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "themes/hugo-fresh"]
2+
path = themes/hugo-fresh
3+
url = https://github.com/StefMa/hugo-fresh.git

config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
theme:
2+
- scientific-python-hugo-theme/themes/hugo-fresh

layouts/_default/baseof.html

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<!DOCTYPE html>
2+
<html lang="{{ .Site.LanguageCode }}">
3+
<head>
4+
{{ partial "meta.html" . }}
5+
<title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
6+
{{ partial "css.html" . }}
7+
8+
<!-- Refer: https://regisphilibert.com/blog/2018/08/hugo-multilingual-part-1-managing-content-translation/ -->
9+
{{ if .IsTranslated }}
10+
{{ range .Translations }}
11+
<link rel="alternate" hreflang="{{ .Language.Lang }}" href="{{ .Permalink }}" title="{{ .Language.LanguageName }}" />
12+
{{ end }}
13+
{{ end }}
14+
{{ template "_internal/twitter_cards.html" . }}
15+
</head>
16+
<body>
17+
<!-- Preloader. Set to true for front-page fade-in animation -->
18+
{{ if .IsHome }}
19+
<div id="preloader"></div>
20+
{{ end }}
21+
22+
{{ block "main" . }}
23+
{{ end }}
24+
25+
<!-- Back To Top Button -->
26+
<div id="backtotop"><a href="#" id="backtotop-color"></a></div>
27+
28+
{{ if .Site.Params.sidebar }}
29+
{{ partial "sidebar.html" . }}
30+
{{ end }}
31+
32+
{{ partial "javascript.html" . }}
33+
{{ template "_internal/google_analytics_async.html" . }}
34+
</body>
35+
</html>

layouts/_default/list.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!-- Ignore this file. This quiets a hugo server warning. -->

layouts/_default/single.html

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!DOCTYPE html>
2+
<html lang="{{ .Site.LanguageCode }}">
3+
4+
<head>
5+
{{ partial "meta.html" . }}
6+
<title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
7+
{{ partial "css.html" . }}
8+
</head>
9+
10+
<body>
11+
{{ block "main" . }}
12+
13+
{{ partial "single/single.html" . }}
14+
15+
<!-- Back To Top Button -->
16+
<div id="backtotop"><a href="#"></a></div>
17+
18+
{{ if .Params.sidebar }}
19+
{{ partial "single/sidebar.html" . }}
20+
{{ end }}
21+
22+
{{ end }}
23+
24+
{{ partial "javascript.html" . }}
25+
26+
{{ if .Site.Params.footer }}
27+
{{ partial "footer.html" . }}
28+
{{ end }}
29+
</body>
30+
31+
</html>

layouts/index.html

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{{ define "main" }}
2+
{{ if .Site.Params.hero }}
3+
{{ partial "hero.html" . }}
4+
{{ end }}
5+
6+
{{ if .Site.Params.news }}
7+
{{ partial "news.html" . }}
8+
{{ end }}
9+
10+
{{ if .Site.Params.keyfeatures }}
11+
{{ partial "keyfeatures.html" . }}
12+
{{ end }}
13+
14+
{{ if .Site.Params.shell }}
15+
{{ partial "shell.html" . }}
16+
{{ end }}
17+
18+
{{ if .Site.Params.tabs }}
19+
{{ partial "tabs.html" . }}
20+
{{ end }}
21+
22+
{{ if .Site.Params.casestudies }}
23+
{{ partial "casestudies.html" . }}
24+
{{ end }}
25+
26+
{{ if .Site.Params.section4 }}
27+
{{ partial "section4.html" . }}
28+
{{ end }}
29+
30+
{{ if .Site.Params.section5 }}
31+
{{ partial "section5.html" . }}
32+
{{ end }}
33+
34+
{{ if .Site.Params.footer }}
35+
{{ partial "footer.html" . }}
36+
{{ end }}
37+
38+
<!-- Back To Top Button -->
39+
<div id="backtotop"><a href="#"></a></div>
40+
41+
{{ if .Site.Params.sidebar }}
42+
{{ partial "sidebar.html" . }}
43+
{{ end }}
44+
{{ end }}

layouts/partials/css.html

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{{- $inServerMode := .Site.IsServer }}
2+
{{- $sass := "style.sass" }}
3+
{{- $cssTarget := "css/style.css" }}
4+
{{- $cssOpts := cond ($inServerMode) (dict "targetPath" $cssTarget "enableSourceMap" true) (dict "targetPath" $cssTarget "outputStyle" "compressed") }}
5+
{{- $fontFace := replace .Site.Params.font.name " " "+" }}
6+
{{- $fontSizes := delimit .Site.Params.font.sizes "," }}
7+
{{- $fontUrl := printf "https://fonts.googleapis.com/css?family=%s:%s" $fontFace $fontSizes }}
8+
<link href="{{ $fontUrl }}" rel="stylesheet">
9+
{{- if $inServerMode }}
10+
{{- $css := resources.Get $sass | toCSS $cssOpts }}
11+
<link rel="stylesheet" type="text/css" href="{{ $css.RelPermalink }}">
12+
{{- else }}
13+
{{- $css := resources.Get $sass | toCSS $cssOpts | minify | fingerprint }}
14+
<link rel="stylesheet" type="text/css" href="{{ $css.RelPermalink }}" integrity="{{ $css.Data.Integrity }}">
15+
{{- end }}
16+
<link rel="stylesheet" type="text/css" href="{{ "css/icons.css" | relURL }}">
17+
<!-- Numpy Favicon -->
18+
<link rel="icon" type="image/ico" href="{{ "images/favicon.ico" | relURL }}" />
19+
<!-- Google Fonts -->
20+
<link href="https://fonts.googleapis.com/css?family=Lato:400,900&display=swap" rel="stylesheet">
21+
<link href="https://fonts.googleapis.com/css?family=Source+Code+Pro&display=swap" rel="stylesheet">
22+
<!-- Custom CSS -->
23+
<link rel="stylesheet" type="text/css" href="{{ "css/styles.css" | relURL }}" />
24+
<link rel="stylesheet" type="text/css" href="{{ "css/shell.css" | relURL }}" />
25+
<link rel="stylesheet" type="text/css" href="{{ "css/tabs.css" | relURL }}" />
26+
<link rel="stylesheet" type="text/css" href="{{ "css/content.css" | relURL }}" />
27+
<link rel="stylesheet" type="text/css" href="{{ "css/news.css" | relURL }}" />
28+
<link rel="stylesheet" type="text/css" href="{{ "css/keyfeatures.css" | relURL }}" />
29+
<link rel="stylesheet" type="text/css" href="{{ "css/casestudies.css" | relURL }}" />

layouts/partials/footer.html

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{{- $footer := .Site.Params.footer }}
2+
{{- $logo := index $footer "logo" }}
3+
{{- $quickLinks := index $footer "quicklinks" }}
4+
{{- $socialMedia := index $footer "socialmedia" }}
5+
<footer id="footer" class="footer">
6+
<div class="container">
7+
<div id="footer-columns" class="columns">
8+
<div class="footer-logo-column">
9+
<img id="footer-logo" src="{{ printf "/images/logos/%s" $logo | relURL }}" alt="SciPy logo.">
10+
</div>
11+
{{- range $quickLinks }}
12+
<div class="link-column">
13+
<div class="footer-column">
14+
<div class="footer-header">
15+
</div>
16+
<ul class="link-list">
17+
{{- range .links }}
18+
<li class="link-list">
19+
<a class="footer-link" href="{{ .link }}">
20+
{{ .text }}
21+
</a>
22+
</li>
23+
{{- end }}
24+
</ul>
25+
</div>
26+
</div>
27+
{{- end }}
28+
<div class="footer-actions">
29+
<p>Sign up for the latest SciPy news, resources, <br> and more</p>
30+
<!-- Begin Mailchimp -->
31+
<form action="https://numpy.us4.list-manage.com/subscribe/post?u=5ddd0d1d6e807900a8212481a&amp;id=287fa4253c" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate sign-up-container" target="_blank" novalidate>
32+
<div class="sign-up-image">
33+
<i class="far fa-envelope"></i>
34+
</div>
35+
<input type="email" value="" name="EMAIL" class="required email sign-up-input" id="mce-EMAIL" aria-label="Input for email, press enter to submit" onkeypress="if (event.which === 13 || event.keyCode === 13 || event.key === 'Enter') sendThankYou()" />
36+
<div class="submission-instructions">Press Enter</div>
37+
<button class="signup-button" onclick="sendThankYou()" aria-label="Submit">
38+
<i class="far fa-paper-plane"></i>
39+
</button>
40+
<div id="mce-responses" class="clear">
41+
<div class="response" id="mce-error-response" style="display:none"></div>
42+
<div class="response" id="mce-success-response" style="display:none"></div>
43+
</div>
44+
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
45+
<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_5ddd0d1d6e807900a8212481a_287fa4253c" tabindex="-1" value=""></div>
46+
<div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button" style="display: none;"></div>
47+
</form>
48+
<div class="thank-you">Thank you! &#127881;</div>
49+
<!--End MailChimp -->
50+
51+
<nav class="level is-mobile">
52+
<div class="social-media-icons">
53+
{{- range $socialMedia }}
54+
<a class="level-item" href="{{ .link }}" aria-label="{{ .link }}">
55+
<span class="icon"><i class="fab fa-{{ .icon }}"></i></span>
56+
</a>
57+
{{- end }}
58+
</div>
59+
</nav>
60+
<div class="copyright">&copy; 2021 SciPy. All rights reserved.</div>
61+
</div>
62+
</div>
63+
</div>
64+
</footer>

layouts/partials/hero-body.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{{- $hero := .Site.Params.hero }}
2+
{{- $title := index $hero "title" }}
3+
{{- $subtitle := index $hero "subtitle" }}
4+
{{- $buttonText := index $hero "buttontext" }}
5+
{{- $buttonLink := index $hero "buttonlink" }}
6+
{{- $image := index $hero "image" }}
7+
<div class="hero-container">
8+
<div class="hero-content">
9+
<div class="hero-title-content">
10+
<div class="hero-title">
11+
{{ $title }}
12+
<img class="hero-logo" src="{{ printf "/images/%s" $image | relURL }}" alt="Numpy logo. A three-dimensional blue cube with the letter 'N' highlighted in yellow.">
13+
</div>
14+
<div class="flex-column">
15+
{{ with $subtitle }}
16+
<div class="hero-subtitle">
17+
{{ . }}
18+
</div>
19+
{{ end }}
20+
<div class="hero-cta">
21+
<a href="{{ $buttonLink }}"><button class="cta-button">{{ $buttonText }}</button></a>
22+
</div>
23+
</div>
24+
</div>
25+
</div>
26+
</div>

0 commit comments

Comments
 (0)