Skip to content

Commit

Permalink
Add numpy.org theme and let it inherit from hugo-fresh
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanv committed Sep 29, 2021
0 parents commit 7085944
Show file tree
Hide file tree
Showing 33 changed files with 2,182 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*~

3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "themes/hugo-fresh"]
path = themes/hugo-fresh
url = https://github.com/StefMa/hugo-fresh.git
2 changes: 2 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
theme:
- scientific-python-hugo-theme/themes/hugo-fresh
35 changes: 35 additions & 0 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}">
<head>
{{ partial "meta.html" . }}
<title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
{{ partial "css.html" . }}

<!-- Refer: https://regisphilibert.com/blog/2018/08/hugo-multilingual-part-1-managing-content-translation/ -->
{{ if .IsTranslated }}
{{ range .Translations }}
<link rel="alternate" hreflang="{{ .Language.Lang }}" href="{{ .Permalink }}" title="{{ .Language.LanguageName }}" />
{{ end }}
{{ end }}
{{ template "_internal/twitter_cards.html" . }}
</head>
<body>
<!-- Preloader. Set to true for front-page fade-in animation -->
{{ if .IsHome }}
<div id="preloader"></div>
{{ end }}

{{ block "main" . }}
{{ end }}

<!-- Back To Top Button -->
<div id="backtotop"><a href="#" id="backtotop-color"></a></div>

{{ if .Site.Params.sidebar }}
{{ partial "sidebar.html" . }}
{{ end }}

{{ partial "javascript.html" . }}
{{ template "_internal/google_analytics_async.html" . }}
</body>
</html>
1 change: 1 addition & 0 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- Ignore this file. This quiets a hugo server warning. -->
31 changes: 31 additions & 0 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}">

<head>
{{ partial "meta.html" . }}
<title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
{{ partial "css.html" . }}
</head>

<body>
{{ block "main" . }}

{{ partial "single/single.html" . }}

<!-- Back To Top Button -->
<div id="backtotop"><a href="#"></a></div>

{{ if .Params.sidebar }}
{{ partial "single/sidebar.html" . }}
{{ end }}

{{ end }}

{{ partial "javascript.html" . }}

{{ if .Site.Params.footer }}
{{ partial "footer.html" . }}
{{ end }}
</body>

</html>
44 changes: 44 additions & 0 deletions layouts/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{{ define "main" }}
{{ if .Site.Params.hero }}
{{ partial "hero.html" . }}
{{ end }}

{{ if .Site.Params.news }}
{{ partial "news.html" . }}
{{ end }}

{{ if .Site.Params.keyfeatures }}
{{ partial "keyfeatures.html" . }}
{{ end }}

{{ if .Site.Params.shell }}
{{ partial "shell.html" . }}
{{ end }}

{{ if .Site.Params.tabs }}
{{ partial "tabs.html" . }}
{{ end }}

{{ if .Site.Params.casestudies }}
{{ partial "casestudies.html" . }}
{{ end }}

{{ if .Site.Params.section4 }}
{{ partial "section4.html" . }}
{{ end }}

{{ if .Site.Params.section5 }}
{{ partial "section5.html" . }}
{{ end }}

{{ if .Site.Params.footer }}
{{ partial "footer.html" . }}
{{ end }}

<!-- Back To Top Button -->
<div id="backtotop"><a href="#"></a></div>

{{ if .Site.Params.sidebar }}
{{ partial "sidebar.html" . }}
{{ end }}
{{ end }}
29 changes: 29 additions & 0 deletions layouts/partials/css.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{{- $inServerMode := .Site.IsServer }}
{{- $sass := "style.sass" }}
{{- $cssTarget := "css/style.css" }}
{{- $cssOpts := cond ($inServerMode) (dict "targetPath" $cssTarget "enableSourceMap" true) (dict "targetPath" $cssTarget "outputStyle" "compressed") }}
{{- $fontFace := replace .Site.Params.font.name " " "+" }}
{{- $fontSizes := delimit .Site.Params.font.sizes "," }}
{{- $fontUrl := printf "https://fonts.googleapis.com/css?family=%s:%s" $fontFace $fontSizes }}
<link href="{{ $fontUrl }}" rel="stylesheet">
{{- if $inServerMode }}
{{- $css := resources.Get $sass | toCSS $cssOpts }}
<link rel="stylesheet" type="text/css" href="{{ $css.RelPermalink }}">
{{- else }}
{{- $css := resources.Get $sass | toCSS $cssOpts | minify | fingerprint }}
<link rel="stylesheet" type="text/css" href="{{ $css.RelPermalink }}" integrity="{{ $css.Data.Integrity }}">
{{- end }}
<link rel="stylesheet" type="text/css" href="{{ "css/icons.css" | relURL }}">
<!-- Numpy Favicon -->
<link rel="icon" type="image/ico" href="{{ "images/favicon.ico" | relURL }}" />
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Lato:400,900&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Source+Code+Pro&display=swap" rel="stylesheet">
<!-- Custom CSS -->
<link rel="stylesheet" type="text/css" href="{{ "css/styles.css" | relURL }}" />
<link rel="stylesheet" type="text/css" href="{{ "css/shell.css" | relURL }}" />
<link rel="stylesheet" type="text/css" href="{{ "css/tabs.css" | relURL }}" />
<link rel="stylesheet" type="text/css" href="{{ "css/content.css" | relURL }}" />
<link rel="stylesheet" type="text/css" href="{{ "css/news.css" | relURL }}" />
<link rel="stylesheet" type="text/css" href="{{ "css/keyfeatures.css" | relURL }}" />
<link rel="stylesheet" type="text/css" href="{{ "css/casestudies.css" | relURL }}" />
64 changes: 64 additions & 0 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{{- $footer := .Site.Params.footer }}
{{- $logo := index $footer "logo" }}
{{- $quickLinks := index $footer "quicklinks" }}
{{- $socialMedia := index $footer "socialmedia" }}
<footer id="footer" class="footer">
<div class="container">
<div id="footer-columns" class="columns">
<div class="footer-logo-column">
<img id="footer-logo" src="{{ printf "/images/logos/%s" $logo | relURL }}" alt="SciPy logo.">
</div>
{{- range $quickLinks }}
<div class="link-column">
<div class="footer-column">
<div class="footer-header">
</div>
<ul class="link-list">
{{- range .links }}
<li class="link-list">
<a class="footer-link" href="{{ .link }}">
{{ .text }}
</a>
</li>
{{- end }}
</ul>
</div>
</div>
{{- end }}
<div class="footer-actions">
<p>Sign up for the latest SciPy news, resources, <br> and more</p>
<!-- Begin Mailchimp -->
<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>
<div class="sign-up-image">
<i class="far fa-envelope"></i>
</div>
<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()" />
<div class="submission-instructions">Press Enter</div>
<button class="signup-button" onclick="sendThankYou()" aria-label="Submit">
<i class="far fa-paper-plane"></i>
</button>
<div id="mce-responses" class="clear">
<div class="response" id="mce-error-response" style="display:none"></div>
<div class="response" id="mce-success-response" style="display:none"></div>
</div>
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_5ddd0d1d6e807900a8212481a_287fa4253c" tabindex="-1" value=""></div>
<div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button" style="display: none;"></div>
</form>
<div class="thank-you">Thank you! &#127881;</div>
<!--End MailChimp -->

<nav class="level is-mobile">
<div class="social-media-icons">
{{- range $socialMedia }}
<a class="level-item" href="{{ .link }}" aria-label="{{ .link }}">
<span class="icon"><i class="fab fa-{{ .icon }}"></i></span>
</a>
{{- end }}
</div>
</nav>
<div class="copyright">&copy; 2021 SciPy. All rights reserved.</div>
</div>
</div>
</div>
</footer>
26 changes: 26 additions & 0 deletions layouts/partials/hero-body.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{{- $hero := .Site.Params.hero }}
{{- $title := index $hero "title" }}
{{- $subtitle := index $hero "subtitle" }}
{{- $buttonText := index $hero "buttontext" }}
{{- $buttonLink := index $hero "buttonlink" }}
{{- $image := index $hero "image" }}
<div class="hero-container">
<div class="hero-content">
<div class="hero-title-content">
<div class="hero-title">
{{ $title }}
<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.">
</div>
<div class="flex-column">
{{ with $subtitle }}
<div class="hero-subtitle">
{{ . }}
</div>
{{ end }}
<div class="hero-cta">
<a href="{{ $buttonLink }}"><button class="cta-button">{{ $buttonText }}</button></a>
</div>
</div>
</div>
</div>
</div>
5 changes: 5 additions & 0 deletions layouts/partials/hero.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<section class="hero">
{{ partial "navbar.html" . }}
{{ partial "navbar-clone.html" . }}
{{ partial "hero-body.html" . }}
</section>
23 changes: 23 additions & 0 deletions layouts/partials/javascript.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="https://unpkg.com/feather-icons"></script>
<script src="{{ "js/fresh.js" | relURL }}"></script>
<script src="{{ "js/jquery.panelslider.min.js" | relURL }}"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js"></script>
<!-- Font Awesome -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/js/all.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css"></script>
<!-- UIkit -->
<script src="https://cdn.jsdelivr.net/npm/uikit@3.2.7/dist/js/uikit.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/uikit@3.2.7/dist/css/uikit.min.css" />
<!-- Thebe Configuration -->
<script type="text/x-thebe-config">
{
requestKernel: true,
binderOptions: {
repo: "joelachance/thebelab-requirements"
},
}
</script>
<script src="https://unpkg.com/thebelab@0.4.0/lib/index.js"></script>
<!-- app.js -->
<script src="{{ "js/app.js" | relURL }}"></script>
17 changes: 17 additions & 0 deletions layouts/partials/keyfeatures.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- $keyfeatures := .Site.Params.keyfeatures }}
{{- $features := index $keyfeatures "features" }}

<section class="keyfeatures">
<div class="container">
<div class="keyfeatures-box-container">
{{- range $features }}
<div class="keyfeatures-box-content keyfeatures-underline">
<p>
<div class="keyfeatures-box-title">{{ .title }}</div>
<div class="keyfeatures-box-text">{{ .text | markdownify }}</div>
</p>
</div>
{{- end }}
</div>
</div>
</section>
Loading

0 comments on commit 7085944

Please sign in to comment.