Skip to content

Commit c1377e7

Browse files
Created basic layouts: default and post.
Created test about page to check the layout system. Created 2 test posts. Added config to _config.yml and created development config: _config_dev.yml. Modified main index.html to use default layout.
1 parent ef75373 commit c1377e7

File tree

9 files changed

+250
-122
lines changed

9 files changed

+250
-122
lines changed

_config.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
include: ["_test.html", "_static", "pandas/guide/_static"]
21
# Site settings
32
title: Python-Sprints
43
# email: your-email@domain.com
@@ -10,4 +9,15 @@ url: "https://python-sprints.github.io/" # the base hostname & protocol for your
109
github_username: python-sprints
1110

1211
# Build settings
13-
markdown: kramdown
12+
include: ['_pages']
13+
sass:
14+
sass_dir: _sass
15+
kramdown:
16+
input: GFM
17+
include: ["_test.html", "_static", "pandas/guide/_static", "_pages"]
18+
exclude:
19+
- Gemfile
20+
- Gemfile.lock
21+
22+
# command to run build locally:
23+
# bundle exec jekyll serve --config _config.yml,_config_dev.yml

_config_dev.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Site settings
2+
title: Python-Sprints
3+
# email: your-email@domain.com
4+
description: > # this means to ignore newlines until "baseurl:"
5+
Python-Sprints is a non profit organisation gathering Python programmers and helping improve code in open source projects.
6+
baseurl: "" # the subpath of your site, e.g. /blog/
7+
url: "http://localhost:4000"
8+
# twitter_username:
9+
# github_username: python-sprints
10+
11+
# Build settings
12+
include: ['_pages']
13+
sass:
14+
sass_dir: _sass
15+
kramdown:
16+
input: GFM
17+
include: ["_test.html", "_static", "pandas/guide/_static", "_pages"]
18+
exclude:
19+
- Gemfile
20+
- Gemfile.lock
21+
22+
# command to run build locally:
23+
# bundle exec jekyll serve --config _config.yml,_config_dev.yml

_includes/event.html

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{% for post in site.posts %}
2+
<time>{{ post.date | date: "%b %-d, %Y" }}</time>
3+
<h3><a href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a></h3>
4+
{% endfor %}
5+
{% for cupcake in site.cupcakes reversed limit: 3 offset: 3 %}
6+
7+
{% assign my_array = "" | split: ',' %}
8+
Now you can push items into the array inside a for loop in the following way:
9+
10+
{% for image in site.static_files %}
11+
{% if image.path contains "assets/images/target-folder" %}
12+
<!-- Push image into array -->
13+
{% assign my_array = my_array | push: image %}
14+
{% endif %}
15+
{% endfor %}
16+
{% for i in (1..5) %}
17+
<!--Create an array of last posts (from newest to oldest) to show in recent events section-->
18+
19+
{% assign last_4_posts = "" | split: ',' %}
20+
{% for post in site.posts reversed limit: 4 %}
21+
{% assign last_4_posts = last_4_posts | push: post %}
22+
{% endfor %}
23+
24+
{% for i in (0..1) %}
25+
<div class="row">
26+
<div class="no-gutters__col col-sm-6">
27+
<div class="events__spacer"></div>
28+
<div class="events__img-container">
29+
<div class="events__img-overlay">
30+
<a class="events__link" href="https://www.meetup.com/Python-Sprints/events/244388482/" target="_blank">
31+
<i class="events__icon fas fa-external-link-square-alt"></i>
32+
</a>
33+
<div class="events__title-container">
34+
<h2 class="events__img-title">Project: www.python.org (Part 1)</h2>
35+
<p class="events__img-subtitle">Bloomberg, November 1, 2017</p>
36+
</div>
37+
</div>
38+
<img class="events__img img-fluid" src="static/images/events_past/python_dot_org_part1_bloomberg_960x539px.jpeg">
39+
</div>
40+
</div>
41+
42+
<div class="no-gutters__col col-sm-6">
43+
<div class="events__spacer"></div>
44+
<div class="events__img-container">
45+
<div class="events__img-overlay">
46+
<a class="events__link" href="https://www.meetup.com/Python-Sprints/events/244062594/" target="_blank">
47+
<i class="events__icon fas fa-external-link-square-alt"></i>
48+
</a>
49+
<div class="events__title-container">
50+
<h2 class="events__img-title">Project: PyMC3</h2>
51+
<p class="events__img-subtitle">Zopa, October 24, 2017</p>
52+
</div>
53+
</div>
54+
<img class="events__img img-fluid" src="static/images/events_past/pymc3_zopa_960x539px.jpeg">
55+
</div>
56+
</div>
57+
</div>

_layouts/default.html

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
<link href="https://fonts.googleapis.com/css?family=Encode+Sans+Expanded" rel="stylesheet">
99
<link href="https://fonts.googleapis.com/css?family=Playfair+Display" rel="stylesheet">
1010
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
11-
<link rel="stylesheet" href="static/css/typography.css">
12-
<link rel="stylesheet" href="static/css/style.css">
11+
<link rel="stylesheet" type="text/css" href="{{ site.baseurl }}/static/css/typography.css">
12+
<link rel="stylesheet" type="text/css" href="{{ site.baseurl }}/static/css/style.css">
1313

1414
<title> {{ page.title }}</title>
1515
</head>
@@ -18,7 +18,7 @@
1818
<nav class="navigation navbar sticky-top navbar-light">
1919
<div class="navigation__brand">
2020
<a class="navigation__brand-link navbar-brand" href="index.html">
21-
<img class="navigation__brand-img" src="static/images/site_logo/python_sprints_logo.png" alt="Python Sprints Logo">
21+
<img class="navigation__brand-img" src="{{ site.baseurl }}/static/images/site_logo/python_sprints_logo.png" alt="Python Sprints Logo">
2222
<span class="navigation__brand-name">Python Sprints</span>
2323
</a>
2424
</div>
@@ -36,19 +36,18 @@
3636
</div>
3737
<div class="navigation__overlay">
3838
<div class="navigation__overlay-content">
39-
<a class="navigation__link" href="#">About</a>
39+
<a class="navigation__link" href="{{ '/' | prepend: site.baseurl }}">Home</a>
40+
<a class="navigation__link" href="{{ '/about' | prepend: site.baseurl }}">About</a>
4041
<a class="navigation__link" href="#">Getting Started</a>
4142
<a class="navigation__link" href="#">Projects</a>
4243
<a class="navigation__link" href="#">Contact</a>
4344
</div>
4445
</div>
4546
</nav>
4647

47-
<div class="container">
4848

49-
{{ content }}
49+
{{ content }}
5050

51-
</div>
5251

5352
<!--Footer-->
5453
<footer class="footer">
@@ -65,18 +64,18 @@
6564
<div class="row">
6665
<div class="col-lg-6">
6766
<a class="footer__sponsor-link" href="https://www.linkedin.com/in/hamishpitkeathly/">
68-
<img class="footer__img" src="static/images/sponsors/harvey_nash_130x90.png">
67+
<img class="footer__img" src="{{ site.baseurl }}/static/images/sponsors/harvey_nash_130x90.png">
6968
</a>
7069
<a class="footer__sponsor-link" href="https://www.python.org/psf/">
71-
<img class="footer__img" src="static/images/sponsors/python_software_foundation.jpeg">
70+
<img class="footer__img" src="{{ site.baseurl }}/static/images/sponsors/python_software_foundation.jpeg">
7271
</a>
7372
</div>
7473
<div class="col-lg-6">
7574
<a class="footer__sponsor-link" href="https://www.touchsurgery.com/jobs.html">
76-
<img class="footer__img" src="static/images/sponsors/touch_surgery.png">
75+
<img class="footer__img" src="{{ site.baseurl }}/static/images/sponsors/touch_surgery.png">
7776
</a>
7877
<a class="footer__sponsor-link" href="https://www.bloomberg.com/careers/">
79-
<img class="footer__img" src="static/images/sponsors/bloomberg.png">
78+
<img class="footer__img" src="{{ site.baseurl }}/static/images/sponsors/bloomberg.png">
8079
</a>
8180
</div>
8281
</div>
@@ -98,7 +97,7 @@
9897
© Copyright
9998
<script>document.write(new Date().getFullYear())</script>
10099
- Python Sprints
101-
<img class="footer__brand-img" src="static/images/site_logo/python_sprints_logo.png" alt="Python Sprints Logo">
100+
<img class="footer__brand-img" src="{{ site.baseurl }}/static/images/site_logo/python_sprints_logo.png" alt="Python Sprints Logo">
102101

103102
</p>
104103
</div>
@@ -108,6 +107,6 @@
108107
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
109108
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
110109
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
111-
<script src="static/js/site.js"></script>
110+
<script src="{{ site.baseurl }}/static/js/site.js"></script>
112111
</body>
113112
</html>

_layouts/post.html

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<body class="body">
4+
<!--Full screen navigation section-->
5+
<nav class="navigation navbar sticky-top navbar-light">
6+
<div class="navigation__brand">
7+
<a class="navigation__brand-link navbar-brand" href="index.html">
8+
<img class="navigation__brand-img" src="{{ site.baseurl }}/static/images/site_logo/python_sprints_logo.png" alt="Python Sprints Logo">
9+
<span class="navigation__brand-name">Python Sprints</span>
10+
</a>
11+
</div>
12+
13+
<div class="navigation__button-open-container">
14+
<div class="navigation__hamburger-bar"></div>
15+
<div class="navigation__hamburger-bar"></div>
16+
<div class="navigation__hamburger-bar"></div>
17+
</div>
18+
19+
<div class="navigation__button-close-container">
20+
<a href="javascript:void(0)" class="navigation__button-close">
21+
<i class="navigation__button-close fas fa-times"></i>
22+
</a>
23+
</div>
24+
<div class="navigation__overlay">
25+
<div class="navigation__overlay-content">
26+
<a class="navigation__link" href="{{ '/' | prepend: site.baseurl }}">Home</a>
27+
<a class="navigation__link" href="{{ '/about' | prepend: site.baseurl }}">About</a>
28+
<a class="navigation__link" href="#">Getting Started</a>
29+
<a class="navigation__link" href="#">Projects</a>
30+
<a class="navigation__link" href="#">Contact</a>
31+
</div>
32+
</div>
33+
</nav>
34+
35+
<div class="container">
36+
{{ content }}
37+
</div>
38+
39+
40+
41+
<!--Footer-->
42+
<footer class="footer">
43+
<div class="row">
44+
<div class="col-md-4 text-center">
45+
<p class="section-content footer__text">Find Us Online</p>
46+
<hr class="footer__divider">
47+
<a href="https://www.meetup.com/Python-Sprints/" target="_blank"><i class="footer__icon fab fa-meetup"></i></a>
48+
<a href="https://twitter.com/py_sprints" target="_blank"><i class="footer__icon fab fa-twitter"></i></a>
49+
</div>
50+
<div class="col-md-4">
51+
<p class="section-content footer__text">Our Sponsors</p>
52+
<hr class="footer__divider">
53+
<div class="row">
54+
<div class="col-lg-6">
55+
<a class="footer__sponsor-link" href="https://www.linkedin.com/in/hamishpitkeathly/">
56+
<img class="footer__img" src="{{ site.baseurl }}/static/images/sponsors/harvey_nash_130x90.png">
57+
</a>
58+
<a class="footer__sponsor-link" href="https://www.python.org/psf/">
59+
<img class="footer__img" src="{{ site.baseurl }}/static/images/sponsors/python_software_foundation.jpeg">
60+
</a>
61+
</div>
62+
<div class="col-lg-6">
63+
<a class="footer__sponsor-link" href="https://www.touchsurgery.com/jobs.html">
64+
<img class="footer__img" src="{{ site.baseurl }}/static/images/sponsors/touch_surgery.png">
65+
</a>
66+
<a class="footer__sponsor-link" href="https://www.bloomberg.com/careers/">
67+
<img class="footer__img" src="{{ site.baseurl }}/static/images/sponsors/bloomberg.png">
68+
</a>
69+
</div>
70+
</div>
71+
</div>
72+
<div class="col-md-4">
73+
<p class="section-content footer__text">Python Sprints</p>
74+
<hr class="footer__divider">
75+
<a class="footer__link" href="#" target="_blank">About</a>
76+
<a class="footer__link" href="#" target="_blank">Getting Started</a>
77+
<a class="footer__link" href="#" target="_blank">Projects</a>
78+
<a class="footer__link" href="#" target="_blank">Contact</a>
79+
<a class="footer__link" href="#" target="_blank">Credits</a>
80+
</div>
81+
</div>
82+
83+
<div class="footer__content row container-fluid">
84+
<div class="col-md-12">
85+
<p class="section-content footer__text-copyright">
86+
© Copyright
87+
<script>document.write(new Date().getFullYear())</script>
88+
- Python Sprints
89+
<img class="footer__brand-img" src="{{ site.baseurl }}/static/images/site_logo/python_sprints_logo.png" alt="Python Sprints Logo">
90+
91+
</p>
92+
</div>
93+
</div>
94+
</footer>
95+
<!--Scripts-->
96+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
97+
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
98+
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
99+
<script src="{{ site.baseurl }}/static/js/site.js"></script>
100+
</body>
101+
<head>
102+
<meta charset="UTF-8">
103+
<meta name="viewport" content="width=device-width, initial-scale=1">
104+
<script defer src="https://use.fontawesome.com/releases/v5.0.6/js/all.js"></script>
105+
<link href="https://fonts.googleapis.com/css?family=Share+Tech+Mono" rel="stylesheet">
106+
<link href="https://fonts.googleapis.com/css?family=Encode+Sans+Expanded" rel="stylesheet">
107+
<link href="https://fonts.googleapis.com/css?family=Playfair+Display" rel="stylesheet">
108+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
109+
<link rel="stylesheet" type="text/css" href="{{ site.baseurl }}/static/css/typography.css">
110+
<link rel="stylesheet" type="text/css" href="{{ site.baseurl }}/static/css/style.css">
111+
112+
<title> {{ page.title }}</title>
113+
</head>
114+
</html>

_pages/01_about.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
layout: default
3-
title: About
3+
title: About - Python Sprints
44
permalink: /about/
55
---
66

_posts/2018-02-10-test-post.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
layout: post
3+
title: "This is a test post!"
4+
date: 2018-02-10
5+
---
6+
7+
This is the content of the about page
8+
* list item
9+
* another list item
10+
- list item 1
11+
- list item 2

_posts/2018-02-11-test-post-2.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
layout: post
3+
title: "This is a test post no.2!"
4+
date: 2018-02-11
5+
---
6+
7+
This is the content of the about page
8+
* list item
9+
* another list item
10+
- list item 1
11+
- list item 2

0 commit comments

Comments
 (0)