Verified Commit 4c4c7c3e authored by Roberto Bochet's avatar Roberto Bochet
Browse files

Merge branch 'new_site' into develop

parents 2e091650 91e862fb
_site /_site
.sass-cache /.sass-cache
.DS_Store /.ruby-version
.ruby-version /.jekyll-metadata
node_modules /.jekyll-cache
.jekyll-metadata /.bundle
\ No newline at end of file /vendor
/debug
\ No newline at end of file
image: ruby:2-alpine3.11
stages: stages:
- build
- deploy - deploy
variables: variables:
JEKYLL_ENV: production JEKYLL_ENV: production
LC_ALL: C.UTF-8 LC_ALL: C.UTF-8
GIT_SUBMODULE_STRATEGY: recursive GIT_SUBMODULE_STRATEGY: recursive
# Build is in `before_script` because it's the same for both deployments build:
before_script: image: jekyll/builder:4.0
- apk add build-base libressl git bash python2 stage: build
- id
- ls -lah /usr/gem && true
- mkdir -p /usr/gem/cache
- ls -lah /usr/gem && true
- ls -lah /usr/gem/cache
- apk add npm
- npm install
- bundle install
- ./scripts/ci_fix_baseurl.sh
- jekyll build -d public 2>&1 | grep -v 'Using the last argument as keyword parameters is deprecated'
- ./scripts/purgecss.sh public
- ./scripts/minifycssjs.sh public
- ./scripts/add_mailinglist_symlink.sh public
deploy-prod:
stage: deploy
script: script:
- apk add rsync openssh - mkdir public
- mkdir -p "$HOME/.ssh" - chown -R jekyll:jekyll
- echo "$SSH_KNOWN_HOSTS" > "$HOME/.ssh/known_hosts" - jekyll build -d public
- chmod 700 "$HOME/.ssh/known_hosts" artifacts:
- chmod 700 "$SSH_DEPLOY_KEY"
- rsync -e "ssh -i $SSH_DEPLOY_KEY" --delete-after -rlptP public/ "$SSH_DEPLOY_USER@$SSH_DEPLOY_HOST:/www.poul.org/"
cache:
key: build-deps
paths: paths:
- "node_modules/" - public
expire_in: 1 day
only: only:
- master - develop
- master
pages: deploy_pages:
stage: deploy stage: deploy
script: script:
- echo "Already built." - echo "Already built."
artifacts: artifacts:
paths: paths:
- public - public
cache: only:
key: build-deps - develop
paths:
- "node_modules/" deploy_prod:
stage: deploy
image: alpine:3.13
script:
- apk add rsync openssh
- mkdir -p "$HOME/.ssh"
- echo "$SSH_KNOWN_HOSTS" > "$HOME/.ssh/known_hosts"
- chmod 700 "$HOME/.ssh/known_hosts"
- chmod 700 "$SSH_DEPLOY_KEY"
- rsync -e "ssh -i $SSH_DEPLOY_KEY" --delete-after -rlptP public/ "$SSH_DEPLOY_USER@$SSH_DEPLOY_HOST:/www.poul.org/"
only: only:
- develop - master
[submodule "assets/scss/material-kit"] [submodule "_data/courses"]
path = assets/vendor/material-kit path = _data/courses
url = https://github.com/creativetimofficial/material-kit.git url = ../courses-data
[submodule "_posts"]
path = _posts
url = ../posts
---
layout: post
title: Sample post
categories:
- Corsi Linux
- Events
tags:
- Linux
---
Questo è un post d'esempio.
- Elemento
- Di
- Una lista
1. Numerata
2. Se
3. Proprio
4. Vogliamo
## Code
```python
import sys
def hello():
sys.stdout.write("Complicated hello world\n")
if __name__ == "__main__":
hello()
```
## Images
- Upload to `assets/img/post-slug`, i.e. `assets/img/1970-01-01-sample_post`
```
![{% raw %}{{ site.baseurl }}{% link 'assets/img/1970-01-01-sample_post/image.jpg' %}]{% endraw %}
```
## Link to page on this site
```
[label]({% raw %}{{ site.baseurl }}{% link 'path-to-file.md' %}{% endraw %})
```
## Link to post
If the post is under a subdirectory, it needs to be included.
```
[label]({% raw %}{{ site.baseurl }}{% post_url wp-export/2019-03-10-corsi-linux-2019 %}{% endraw %})
```
Result: [label]({{ site.baseurl }}{% post_url wp-export/2019-03-10-corsi-linux-2019 %})
## WordPress Alert Boxes
A number of old WordPress alert boxes have been ported. They have a slightly more complicated syntax.
To put links in them, please use plain HTML (as opposed to Markdown — you can use Jekyll tags).
Note that only the first two have been styled out of laziness. More can be added if needed.
#### Important
{% include alerts/important.html content="Important" %}
```
{% raw %}{% include alerts/important.html content="Important" %}{% endraw %}
```
#### Notice
{% include alerts/notice.html content="Notice" %}
```
{% raw %}{% include alerts/notice.html content="Notice" %}{% endraw %}
```
#### Red
{% include alerts/red.html content="Red" %}
```
{% raw %}{% include alerts/red.html content="Red" %}{% endraw %}
```
#### Warning
{% include alerts/warning.html content="Warning" %}
```
{% raw %}{% include alerts/warning.html content="Warning" %}{% endraw %}
```
...@@ -4,4 +4,3 @@ gem "jekyll" ...@@ -4,4 +4,3 @@ gem "jekyll"
gem "jekyll-paginate" gem "jekyll-paginate"
gem "support-for" gem "support-for"
gem "jekyll-sitemap" gem "jekyll-sitemap"
gem 'jekyll-purgecss'
GEM GEM
remote: http://rubygems.org/ remote: http://rubygems.org/
specs: specs:
addressable (2.6.0) addressable (2.7.0)
public_suffix (>= 2.0.2, < 4.0) public_suffix (>= 2.0.2, < 5.0)
colorator (1.1.0) colorator (1.1.0)
concurrent-ruby (1.1.4) concurrent-ruby (1.1.8)
em-websocket (0.5.1) em-websocket (0.5.2)
eventmachine (>= 0.12.9) eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0) http_parser.rb (~> 0.6.0)
eventmachine (1.2.7) eventmachine (1.2.7)
ffi (1.10.0) ffi (1.15.0)
forwardable-extended (2.6.0) forwardable-extended (2.6.0)
http_parser.rb (0.6.0) http_parser.rb (0.6.0)
i18n (0.9.5) i18n (1.8.10)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
jekyll (3.8.5) jekyll (4.2.0)
addressable (~> 2.4) addressable (~> 2.4)
colorator (~> 1.0) colorator (~> 1.0)
em-websocket (~> 0.5) em-websocket (~> 0.5)
i18n (~> 0.7) i18n (~> 1.0)
jekyll-sass-converter (~> 1.0) jekyll-sass-converter (~> 2.0)
jekyll-watch (~> 2.0) jekyll-watch (~> 2.0)
kramdown (~> 1.14) kramdown (~> 2.3)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0) liquid (~> 4.0)
mercenary (~> 0.3.3) mercenary (~> 0.4.0)
pathutil (~> 0.9) pathutil (~> 0.9)
rouge (>= 1.7, < 4) rouge (~> 3.0)
safe_yaml (~> 1.0) safe_yaml (~> 1.0)
terminal-table (~> 2.0)
jekyll-paginate (1.1.0) jekyll-paginate (1.1.0)
jekyll-purgecss (0.2.0) jekyll-sass-converter (2.1.0)
jekyll-sass-converter (1.5.2) sassc (> 2.0.1, < 3.0)
sass (~> 3.4) jekyll-sitemap (1.4.0)
jekyll-sitemap (1.3.1)
jekyll (>= 3.7, < 5.0) jekyll (>= 3.7, < 5.0)
jekyll-watch (2.1.2) jekyll-watch (2.2.1)
listen (~> 3.0) listen (~> 3.0)
kramdown (1.17.0) kramdown (2.3.1)
liquid (4.0.1) rexml
listen (3.1.5) kramdown-parser-gfm (1.1.0)
rb-fsevent (~> 0.9, >= 0.9.4) kramdown (~> 2.0)
rb-inotify (~> 0.9, >= 0.9.7) liquid (4.0.3)
ruby_dep (~> 1.2) listen (3.5.1)
mercenary (0.3.6) rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
pathutil (0.16.2) pathutil (0.16.2)
forwardable-extended (~> 2.6) forwardable-extended (~> 2.6)
public_suffix (3.0.3) public_suffix (4.0.6)
rb-fsevent (0.10.3) rb-fsevent (0.10.4)
rb-inotify (0.10.0) rb-inotify (0.10.1)
ffi (~> 1.0) ffi (~> 1.0)
rouge (3.3.0) rexml (3.2.5)
ruby_dep (1.5.0) rouge (3.26.0)
safe_yaml (1.0.4) safe_yaml (1.0.5)
sass (3.7.3) sass (3.7.4)
sass-listen (~> 4.0.0) sass-listen (~> 4.0.0)
sass-listen (4.0.0) sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4) rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7) rb-inotify (~> 0.9, >= 0.9.7)
sassc (2.4.0)
ffi (~> 1.9)
support-for (1.0.7) support-for (1.0.7)
sass (~> 3.3) sass (~> 3.3)
terminal-table (2.0.0)
unicode-display_width (~> 1.1, >= 1.1.1)
unicode-display_width (1.7.0)
PLATFORMS PLATFORMS
ruby ruby
...@@ -65,9 +73,8 @@ PLATFORMS ...@@ -65,9 +73,8 @@ PLATFORMS
DEPENDENCIES DEPENDENCIES
jekyll jekyll
jekyll-paginate jekyll-paginate
jekyll-purgecss
jekyll-sitemap jekyll-sitemap
support-for support-for
BUNDLED WITH BUNDLED WITH
2.0.2 2.2.16
File mode changed from 100755 to 100644
[![pipeline status](https://gitlab.poul.org/sito/poul-jekyll/badges/master/pipeline.svg)](https://gitlab.poul.org/sito/poul-jekyll/commits/master)
Theme based on [Long Haul](https://github.com/brianmaierjr/long-haul) Theme based on [Long Haul](https://github.com/brianmaierjr/long-haul)
## Writing new posts ## Writing new posts
...@@ -85,23 +87,31 @@ These boxes are available: ...@@ -85,23 +87,31 @@ These boxes are available:
### Sample post ### Sample post
A sample post is available at `/1970-01-01-sample_post`. View it in the website for a quick demo. A sample post is available at `/examples/1970-01-01-sample_post`. View it in the website for a quick demo.
## Local preview (i.e. to see posts before commiting) ## Local preview (i.e. to see posts before commiting)
Please read the notes below first!
You need `docker`: You need `docker`:
```bash ```bash
docker run --rm --volume="$PWD:/srv/jekyll" -p 4000:4000 -it jekyll/jekyll jekyll serve --incremental docker run --rm --volume="$PWD:/srv/jekyll" -p 4000:4000 -it jekyll/jekyll jekyll serve --incremental
``` ```
You can also run the container with `podman`:
```bash
podman run --rm --volume="$PWD:/srv/jekyll:z" -p 4000:4000 -e JEKYLL_UID=48 -e JEKYLL_GID=48 -it jekyll/jekyll jekyll serve --incremental
```
Site preview will be available at [localhost:4000](http://localhost:4000). Site preview will be available at [localhost:4000](http://localhost:4000).
**Note:** the BITS button may not work when running locally. **Note:** the BITS button may not work when running locally.
**Note:** images from old posts will not display as they're not included in the repository. **Note:** images from old posts will not display as they're not included in the repository.
**Note:** you have to init submodule **Note:** you have to init submodule (`git submodule update --init`)
## Preview on GitLab Pages ## Preview on GitLab Pages
......
title: POuL title: "POuL"
description: Politecnico Open unix Labs description: "Politecnico Open unix Labs"
url: https://poul.org url: "https://poul.org"
baseurl: "" baseurl: ""
paginate_path: "events/page/:num/" paginate_path: "posts/page/:num/"
permalink: /:year/:month/:title/ permalink: "/:year/:month/:title/"
static_url: "https://static.poul.org"
markdown: kramdown markdown: kramdown
highlighter: rouge highlighter: rouge
...@@ -18,28 +19,36 @@ navigation: ...@@ -18,28 +19,36 @@ navigation:
url: /index.html url: /index.html
- title: About - title: About
url: /about url: /about
- title: Events - title: Courses
url: /events url: /courses
- title: Headquarters
url: /hq
- title: Coding Gym - title: Coding Gym
url: /coding_gym url: /coding_gym
- title: Contacts - title: Projects
url: /contact url: /projects
- title: Posts
url: /posts
exclude: exclude:
- Gemfile
- Gemfile.lock
- README.md
- LICENSE
- scripts - scripts
- node_modules - examples
- .sass-cache
- vendor
- .bundle
social: social:
telegram: poulpolimi telegram: "poulpolimi"
instagram: poul.polimi instagram: "poul.polimi"
facebook: poul.polimi facebook: "poul.polimi"
twitter: poul_polimi twitter: "poul_polimi"
github: Politecnico-Open-unix-Labs github: "Politecnico-Open-unix-Labs"
youtube: POuLpolimi youtube: "POuLpolimi"
rss: '/feed.xml' rss: "/feed.xml"
email: https://list.poul.org/postorius/lists/mailinglist.poul.org/ email: "https://list.poul.org/postorius/lists/mailinglist.poul.org/"
sass: sass:
sass_dir: assets/_sass sass_dir: assets/_sass
\ No newline at end of file style: compressed
\ No newline at end of file
date: 2019-10-29 17:15
room: E/F
coding_gym_url: https://coding-gym.org/events/2019-10-29-it-polimi/
contest_url: https://www.hackerrank.com/coding-gym-polimi1019
registration_url: https://coding-gym-polimi1019.eventbrite.it
\ No newline at end of file
date: 2019-11-25 17:15
room: 5.0.3
coding_gym_url: https://coding-gym.org/events/2019-11-25-it-polimi/
contest_url: https://www.hackerrank.com/coding-gym-polimi1119
registration_url: https://coding-gym-polimi1119.eventbrite.it
\ No newline at end of file
date: 2020-01-24 17:15
room: 3.1.6
coding_gym_url: https://coding-gym.org/events/2020-01-24-it-polimi/
contest_url: https://www.hackerrank.com/coding-gym-polimi0120
registration_url: https://coding-gym-polimi0120.eventbrite.it
\ No newline at end of file
date: 2020-02-26 17:15
room: 5.0.2
coding_gym_url: https://coding-gym.org/events/2020-02-26-it-polimi/
contest_url: https://www.hackerrank.com/coding-gym-polimi0220
registration_url: https://coding-gym-polimi0220.eventbrite.it
\ No newline at end of file
Subproject commit e48fd33d0b808bb0b9414eb6e42a0b6723b534ce
<div class="material-kit hq-status-fab"> <div class="hq-status-fab">
<a class="btn btn-round btn-lg btn-gialla loading" href="https://bits.poul.org" title="POuL headquarters status"> <a class="btn bits bits-loading" href="https://bits.poul.org" title="POuL headquarters status"></a>
<i class="loading-indicator fa fa-sync fa-spin fa-fw"></i>
<div class="ripple-container"></div>
</a>
</div> </div>
{% assign page.has_bits_button = true %} {% assign page.has_bits_button = true %}
<div class="band course-edition">
{% if include.past_label %}
{% if include.edition.is_past %}
<h2>Last edition</h2>
{% else %}
<h2>Next edition</h2>
{% endif %}
{% endif %}
<h2 id="{{ edition.begins | date: '%Y-%m' }}">{{ include.edition.name | markdownify }}</h2>
{% if include.edition.description %}
<div class="container text-align-center">
{{ include.edition.description | markdownify }}
</div>
{% endif %}
{% if include.edition.schedule %}
<h3>Schedule</h3>
<div class="schedule">
{% for session in include.edition.schedule %}
<div class="session">
<div class="date">
{% if session.date %}
<div>{{ session.date | date: "%b %d" | upcase }}</div>
<div class="time">{{ session.date | date: "%H:%M" }}</div>
{% endif %}
</div>
<div class="room">
{% if session.room %}
<div class="caption">Room</div>
{% if session.room.url %}
<div><a href="{{ session.room.url }}">{{ session.room.room }}</a></div>
{% else %}
<div>{{ session.room.room }}</div>
{% endif %}
{% endif %}
</div>
<div class="topics">
{% for topic in session.topics %}
<div>{{topic}}</div>
{% endfor %}
</div>
</div>
{% endfor %}
</div>
{% endif %}
{% if include.edition.sponsored %}
<p class="contribute">~ sponsorizzato dal Politecnico di Milano</p>
{% endif %}
</div>
\ No newline at end of file
<ul class="posts noList">
{% for post in paginator.posts %}
<li>
<span class="date">{{ post.date | date: '%B %d, %Y' }}</span>
<h3><a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a></h3>
<p>{% if post.description %}{{ post.description }}{% else %}{{ post.excerpt | strip_html }}{% endif %}</p>
</li>
{% endfor %}
</ul>
<!-- Pagination links -->
<div class="pagination">
{% if paginator.previous_page %}
<a href="{{ paginator.previous_page_path | prepend: site.baseurl }}" class="previous button__outline">Newer Posts</a>
{% endif %}
{% if paginator.next_page %}
<a href="{{ paginator.next_page_path | prepend: site.baseurl }}" class="next button__outline">Older Posts</a>
{% endif %}
</div>
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
{% for category in events_categories %} {% for category in events_categories %}
<div class="styled-grid-item"> <div class="styled-grid-item">
<div> <div>
<a href="{{ '/topic/' | append: category | append: '/' | prepend: site.baseurl }}">{{ category }}</a> <a href="{{ '/topic/' | append: category | append: '/' | realtive_url | uri_escape }}">{{ category }}</a>
</div> </div>
</div> </div>
{% endfor %} {% endfor %}
......
<div class="footer content bg-darker"> <footer class="bg-black">
<div class="container"> <div>
<p class="copy">&copy; {{ site.time | date: '%Y' }} &copy; {{ site.time | date: '%Y' }}
<a href="https://www.poul.org">POuL</a> <span><a href="https://www.poul.org">POuL</a></span>
<a href="https://gitlab.poul.org/sito/poul-jekyll">Source code</a> <span><a href="https://gitlab.poul.org/sito/poul-jekyll">Source code</a></span>
<a href="#" id="fix-sotto-storto-link" onclick="fixSottoStortoCit(); return false;">Fix rotation</a> <span class="desktop-only"><a href="#" id="fix-sotto-storto-link">Fix rotation</a></span>
<a href="{{ site.baseurl }}/privacy/">Privacy</a> <span><a href="#" id="fix-open-dyslexic-link">Enable futuristic font</a></span>
</p> </div>