17 Commits

Author SHA1 Message Date
b6b089542e Feat: add big-button plugin 2022-08-29 08:01:10 +02:00
735cd0bd59 Feat: improve img readability 2022-08-28 22:17:35 +02:00
dc470aec10 Feat: Update nav bar 2022-08-28 21:21:02 +02:00
f2adf72aa0 Feat: start 2022-2023 from 2021-2022 2022-08-21 08:40:09 +02:00
0653ac2bf8 Feat: add umami js code for analytics:
All checks were successful
continuous-integration/drone/push Build is passing
2022-06-15 09:21:40 +02:00
5b9910bb0f Feat: adapt drone.yml to 2021-2022
Some checks failed
continuous-integration/drone/push Build is failing
2021-08-23 14:34:58 +02:00
dbbb0b5ecf Feat: Adapt to year 2021-2022 2021-08-22 18:02:57 +02:00
6060a52717 Feat: filter article in pagetree.
All checks were successful
continuous-integration/drone/push Build is passing
If "Semaine" in tags, it does not show up
2020-12-05 06:53:01 +01:00
12d10e6ace Feat: remove pelican-page-hierarchy
All checks were successful
continuous-integration/drone/push Build is passing
2020-08-25 10:54:59 +02:00
abe52dd5c9 Merge branch '2020-2021' of git_opytex:lafrite/site_opytex into 2020-2021 2020-08-25 10:50:12 +02:00
1c92eedfb2 Feat: activation pdf-img 2020-08-25 10:49:49 +02:00
1f34a326ad Feat: activate pdf-img
All checks were successful
continuous-integration/drone/push Build is passing
2020-08-25 10:43:02 +02:00
d6e575ea45 Fix: link to projets-informatiques
All checks were successful
continuous-integration/drone/push Build is passing
2020-08-16 10:33:41 +02:00
438251f75d Feat: remove link to bopytex and mapytex
All checks were successful
continuous-integration/drone/push Build is passing
2020-08-16 10:28:43 +02:00
b720e17c61 Fix: add requirements
All checks were successful
continuous-integration/drone/push Build is passing
2020-08-07 18:27:22 +02:00
02dbc94f31 Feat: add .drone.yml
Some checks failed
continuous-integration/drone/push Build is failing
2020-08-07 18:24:12 +02:00
dd92f1a77e Feat: adapt to year 2019-2020 2020-08-07 18:22:40 +02:00
14 changed files with 200 additions and 39 deletions

30
.drone.yml Normal file
View File

@@ -0,0 +1,30 @@
kind: pipeline
name: Opytex 2021-2022
type: docker
trigger:
branch:
- 2021-2022
steps:
- name: Deploy
image: python:3.8-alpine
commands:
- apk add --no-cache openssh-client ca-certificates bash rsync git imagemagick-dev imagemagick
- git submodule init
- git submodule update
- git clone https://git.opytex.org/lafrite/2021-2022.git content
- pip install --no-cache-dir -r requirements.txt
- export MAGICK_HOME=/usr
- pelican ./content/ -o output -s publishconf.py --relative-urls
- eval `ssh-agent -s`
- echo "$SSH_KEY" | ssh-add -
- mkdir -p ~/.ssh
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- ssh sshcontent@91.121.90.228 'mkdir -p ~/opytex.org/www/enseignements/2021-2022/'
- rsync -rv --delete -e "ssh -p 22" ./output/ sshcontent@91.121.90.228:~/opytex.org/www/enseignements/2021-2022/ --checksum
environment:
SSH_KEY:
from_secret: sshcontent-key

1
.gitignore vendored
View File

@@ -6,3 +6,4 @@ content
__pycache__ __pycache__
*.pid *.pid
venv/ venv/
.vim/

View File

@@ -10,9 +10,8 @@ MENUITEMS = [
#("Dernières modifications", SITEURL+"blog_index.html"), #("Dernières modifications", SITEURL+"blog_index.html"),
("Accueil", "/"), ("Accueil", "/"),
("Contenus de cours", "/pages/tout-sur-mes-cours.html"), ("Contenus de cours", "/pages/tout-sur-mes-cours.html"),
('blog', '/blog_index.html'), ('Blog', '/blog_index.html'),
('Opytex', "/opytex/"), ('Informatique', "/pages/projets-informatiques.html"),
("pyMath", "/pymath/"),
('À propos', "/pages/a-propos.html"), ('À propos', "/pages/a-propos.html"),
] ]

View File

@@ -3,35 +3,35 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import os import os
import sys import sys
sys.path.append(os.curdir) sys.path.append(os.curdir)
from globalconf import * from globalconf import *
AUTHOR = 'Benjamin Bertrand' AUTHOR = "Benjamin Bertrand"
SITENAME = 'OpyTex' SITENAME = "OpyTex"
SITETITLE = 'OpyTex' SITETITLE = "OpyTex"
SITESUBTITLE = "DEV" SITESUBTITLE = "2022-2023"
#SITEURL = 'https://0.0.0.0:8000/enseignements/DEV' SITEURL = ""
SITEURL = ''
CC_LICENSE_COMMERCIAL = True CC_LICENSE_COMMERCIAL = True
CC_LICENSE = True CC_LICENSE = True
PATH = './content' PATH = "./content"
TIMEZONE = 'Europe/Paris' TIMEZONE = "Europe/Paris"
DEFAULT_LANG = 'fr' DEFAULT_LANG = "fr"
# Uncomment following line if you want document-relative URLs when developing # Uncomment following line if you want document-relative URLs when developing
#RELATIVE_URLS = True # RELATIVE_URLS = True
# Files places # Files places
IGNORE_FILES = ['venv', '.git', 'tools'] IGNORE_FILES = ["venv", ".git", "tools"]
# Pages, articles and static # Pages, articles and static
#PAGE_PATHS = ['pages'] # PAGE_PATHS = ['pages']
ARTICLE_PATHS = ['.'] ARTICLE_PATHS = ["."]
STATIC_PATHS = ['.'] STATIC_PATHS = ["."]
INDEX_SAVE_AS = 'blog_index.html' INDEX_SAVE_AS = "blog_index.html"
# #
USE_FOLDER_AS_CATEGORY = False USE_FOLDER_AS_CATEGORY = False
@@ -39,18 +39,18 @@ USE_FOLDER_AS_CATEGORY = False
# Plugins # Plugins
PLUGIN_PATHS = ["plugins"] PLUGIN_PATHS = ["plugins"]
PLUGINS = [ PLUGINS = [
'i18n_subsites', "i18n_subsites",
"pelican-page-hierarchy",
"always_modified", "always_modified",
"tag_cloud", "tag_cloud",
# 'pdf-img', "pdf-img",
"big-button",
] ]
ALWAYS_MODIFIED = True ALWAYS_MODIFIED = True
# Mirror source structure # Mirror source structure
PATH_METADATA = '(?P<path_no_ext>.*)\..*' PATH_METADATA = "(?P<path_no_ext>.*)\..*"
ARTICLE_URL = ARTICLE_SAVE_AS = PAGE_URL = PAGE_SAVE_AS = '{path_no_ext}.html' ARTICLE_URL = ARTICLE_SAVE_AS = PAGE_URL = PAGE_SAVE_AS = "{path_no_ext}.html"
# USE_FOLDER_AS_CATEGORY = True # USE_FOLDER_AS_CATEGORY = True
# DEFAULT_CATEGORY = "Autre" # DEFAULT_CATEGORY = "Autre"
@@ -58,7 +58,7 @@ ARTICLE_URL = ARTICLE_SAVE_AS = PAGE_URL = PAGE_SAVE_AS = '{path_no_ext}.html'
# Readers # Readers
READERS = {"html": None} READERS = {"html": None}
# Everythings in french # Everythings in french
JINJA_ENVIRONMENT = {'extensions': ['jinja2.ext.i18n']} JINJA_ENVIRONMENT = {"extensions": ["jinja2.ext.i18n"]}
# Default theme language. # Default theme language.
I18N_TEMPLATES_LANG = "en" I18N_TEMPLATES_LANG = "en"
# Your language. # Your language.
@@ -80,7 +80,7 @@ DISPLAY_PAGES_ON_SIDE = False
TOCTREE = True TOCTREE = True
TAG_CLOUD = True TAG_CLOUD = True
#SITELOGO = "" # SITELOGO = ""
LINKS = () LINKS = ()
DEFAULT_PAGINATION = 10 DEFAULT_PAGINATION = 10

View File

View File

@@ -0,0 +1 @@
from .big_button import *

View File

@@ -0,0 +1,66 @@
# -*- coding: utf-8 -*-
"""
big_button tags for reStructuredText
==============================
This plugin allows you to use big_button tags from within reST documents.
.. big_button::
:title: Title
:link: ""
:color: default
Description
"""
from __future__ import unicode_literals
from docutils import nodes
from docutils.parsers.rst import directives, Directive
class BigButton(Directive):
optional_arguments = 0
final_argument_whitespace = True
has_content = True
required_arguments = 0
optional_arguments = 0
final_argument_whitespace = False
option_spec = {
"title": directives.unicode_code,
"link": directives.path,
}
def settings(self):
self.options['content'] = '\n'.join(self.content)
if not self.options.get('title'):
self.options['title'] = 0
if not self.options.get('link'):
self.options['link'] = 0
def html(self):
html = "<div class='button'>\n"
if self.options["link"]:
html += f"<a href={self.options['link']}>"
else:
html += f"<div class='nolink'>"
if self.options["title"]:
html += f"<h3> {self.options['title']}</h3>"
if self.content:
html += "<div class='content'>"
html += f"{self.options['content']}"
html += "</div>"
if self.options["link"]:
html += "</a>"
else:
html += "</div>"
html += "</div>"
return html
def run(self):
self.settings()
return [nodes.raw('', self.html(), format='html')]
def register():
directives.register_directive("big_button", BigButton)

View File

@@ -11,7 +11,7 @@ sys.path.append(os.curdir)
from pelicanconf import * from pelicanconf import *
# If your site is available via HTTPS, make sure SITEURL begins with https:// # If your site is available via HTTPS, make sure SITEURL begins with https://
SITEURL = 'n' SITEURL = 'https://opytex.org/enseignements/2022-2023/'
RELATIVE_URLS = False RELATIVE_URLS = False
FEED_ALL_ATOM = 'feeds/all.atom.xml' FEED_ALL_ATOM = 'feeds/all.atom.xml'
@@ -22,4 +22,4 @@ DELETE_OUTPUT_DIRECTORY = True
# Following items are often useful when publishing # Following items are often useful when publishing
#DISQUS_SITENAME = "" #DISQUS_SITENAME = ""
#GOOGLE_ANALYTICS = "" #GOOGLE_ANALYTICS = ""

15
requirements.txt Normal file
View File

@@ -0,0 +1,15 @@
beautifulsoup4==4.9.1
blinker==1.4
bs4==0.0.1
docutils==0.16
feedgenerator==1.9.1
Jinja2==2.11.2
MarkupSafe==1.1.1
pelican==4.2.0
Pygments==2.6.1
python-dateutil==2.8.1
pytz==2020.1
six==1.15.0
soupsieve==2.0.1
Unidecode==1.1.1
Wand==0.6.2

View File

@@ -71,6 +71,41 @@ hr {
img { img {
max-width: 100%; max-width: 100%;
border: 2px solid @med-light-grey;
box-shadow: 0px 0px 10px @light-grey;
}
.button {
margin: 20px;
border: 3px solid @orange;
width: 250px;
height: 150px;
border-radius: 25px;
display: inline-flex;
vertical-align: top;
padding: 5px 15px;
* {
display: flex;
justify-content: center;
flex-direction: column;
gap: 10px;
}
a {
width:100%;
height:100%;
}
.nolink {
width:100%;
height:100%;
}
h3 {
margin: 0px;
}
}
.button:hover {
background-color: @light-grey;
} }
aside { aside {
@@ -110,6 +145,11 @@ aside {
} }
nav { nav {
background-color: @navbar-bg;
h2 {
background-color: @navbar-bg;
margin-bottom: 0;
}
ul { ul {
padding-inline-start: 0px; padding-inline-start: 0px;
display: block; display: block;
@@ -117,7 +157,6 @@ aside {
ul.toctree { ul.toctree {
li { li {
a { a {
background-color: @navbar-bg;
color: @navbar-text-color; color: @navbar-text-color;
border: none; border: none;
} }
@@ -127,14 +166,16 @@ aside {
background-color: @navbar-toctree-l2-sel-bg; background-color: @navbar-toctree-l2-sel-bg;
color: @navbar-toctree-l2-sel-txt; color: @navbar-toctree-l2-sel-txt;
padding: 10px; padding: 10px;
border-left: solid 2px @orange;
} }
} }
li.current{ li.current{
a { a {
background-color: @navbar-toctree-l1-sel-bg; background-color: @navbar-toctree-l1-sel-bg;
border-bottom: solid 1px @light-grey;
border-left: solid 2px @grey;
color: @navbar-toctree-l1-sel-txt; color: @navbar-toctree-l1-sel-txt;
border-top: solid 1px @light-grey;
border-bottom: solid 1px @light-grey;
border-left: solid 2px @orange;
} }
a:hover { a:hover {
color: @orange; color: @orange;
@@ -166,13 +207,14 @@ aside {
.tagcloud { .tagcloud {
h2 { h2 {
background-color: @sidebar-bg;
margin-bottom: 0; margin-bottom: 0;
background-color: @sidebar-bg;
} }
ul { ul {
list-style: none; list-style: none;
padding: 0; padding: 0;
margin: 10px;
} }
ul li { ul li {

File diff suppressed because one or more lines are too long

View File

@@ -4,6 +4,7 @@
@white: #ffffff; @white: #ffffff;
@grey: #333333; @grey: #333333;
@light-grey: #eeeeee; @light-grey: #eeeeee;
@med-light-grey: #d9d8d8;
@med-grey: #999999; @med-grey: #999999;
@dark-grey: #242121; @dark-grey: #242121;
@@ -20,7 +21,7 @@
@link-hover-color: @light-orange; @link-hover-color: @light-orange;
// Sidebar (aside) // Sidebar (aside)
@sidebar-bg: @grey; @sidebar-bg: @dark-grey;
@sidebar-text-color: @white; @sidebar-text-color: @white;
@sidebar-link-color: @white; @sidebar-link-color: @white;
@sidebar-link-hover-color: @light-grey; @sidebar-link-hover-color: @light-grey;
@@ -28,8 +29,10 @@
// NavBar // NavBar
@navbar-bg: @dark-grey; @navbar-bg: @dark-grey;
@navbar-text-color: @white; @navbar-text-color: @white;
@navbar-toctree-l1-sel-bg: @dark-grey;
@navbar-toctree-l1-sel-txt: @light-grey; @navbar-toctree-l1-sel-bg: @med-light-grey;
@navbar-toctree-l1-sel-txt: @grey;
@navbar-toctree-l2-bg: @med-grey; @navbar-toctree-l2-bg: @med-grey;
@navbar-toctree-l2-txt: @grey; @navbar-toctree-l2-txt: @grey;
@navbar-toctree-l2-sel-bg: @light-grey; @navbar-toctree-l2-sel-bg: @light-grey;

View File

@@ -143,5 +143,6 @@
</main> </main>
{% block additional_js %}{% endblock %} {% block additional_js %}{% endblock %}
<script type="text/javascript" async defer data-website-id="2cb9cd4c-66da-4e4f-9e84-a2d53c7b07bc" src="https://stat.opytex.org/umami.js"></script>
</body> </body>
</html> </html>

View File

@@ -1,13 +1,16 @@
<ul class="toctree"> <ul class="toctree">
<h2>Niveaux</h2>
{% for cat, articles in categories|sort %} {% for cat, articles in categories|sort %}
{% if (article and article.category == cat) or category == cat %} {% if (article and article.category == cat) or category == cat %}
<li class="toctree-l1 current"><a href="{{ SITEURL }}/{{ cat.url }}">{{ cat | upper }}</a> <li class="toctree-l1 current"><a href="{{ SITEURL }}/{{ cat.url }}">{{ cat | upper }}</a>
<ul> <ul>
{% for art in articles | sort(attribute="date") %} {% for art in articles | sort(attribute="date") %}
{% if article == art %} {% if "Semaine" not in art.tags%}
<li class="toctree-l2 current"><span>{{ art.title }}</span></li> {% if article == art %}
{% else %} <li class="toctree-l2 current"><span>{{ art.title }}</span></li>
<li class="toctree-l2"><a href="{{ SITEURL }}/{{ art.url }}">{{ art.title }}</a></li> {% else %}
<li class="toctree-l2"><a href="{{ SITEURL }}/{{ art.url }}">{{ art.title }}</a></li>
{% endif %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</ul> </ul>