Skip to content

Commit 966a054

Browse files
Feature/add comments with giscus (#56)
* Add initial commenting solution using giscus * Update packaging solutions * Modernize database tests * Add giscus to all existing posts
1 parent fb60153 commit 966a054

18 files changed

Lines changed: 160 additions & 404 deletions

.pre-commit-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33

44
exclude: "test/db_setup.py|"
55

6+
# pre-commit ci
7+
ci:
8+
autoupdate_schedule: monthly
9+
610
# pre-commit
711
repos:
812
- repo: https://github.com/pre-commit/pre-commit-hooks
@@ -19,6 +23,12 @@ repos:
1923
- id: name-tests-test
2024
- id: trailing-whitespace
2125

26+
# gitleaks
27+
- repo: https://github.com/gitleaks/gitleaks
28+
rev: v8.18.4
29+
hooks:
30+
- id: gitleaks
31+
2232
# ruff
2333
- repo: https://github.com/astral-sh/ruff-pre-commit
2434
rev: v0.5.7

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) Daniel Mizsak
3+
Copyright (c) 2024 Daniel Mizsak
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

pyproject.toml

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,55 @@
11
# Build System
22
[build-system]
3-
requires = ["hatchling"]
4-
build-backend = "hatchling.build"
3+
requires = ["hatchling"]
4+
build-backend = "hatchling.build"
55

66
# Project Metadata
77
[project]
8-
name = "pythonvilag-website"
9-
version = "1.0.1"
10-
description = "Source code that powers the Python Világ website."
11-
readme = "README.md"
12-
requires-python = ">=3.11"
13-
license = { file = "LICENSE" }
14-
authors = [{ name = "Daniel Mizsak", email = "info@pythonvilag.hu" }]
15-
keywords = ["website", "tutorial", "flask", "pythonvilag"]
16-
classifiers = [
8+
name = "pythonvilag-website"
9+
version = "1.1.0"
10+
description = "Source code that powers the Python Világ website."
11+
readme = "README.md"
12+
requires-python = ">=3.11"
13+
license = { file = "LICENSE" }
14+
authors = [{ name = "Daniel Mizsak", email = "info@pythonvilag.hu" }]
15+
keywords = ["website", "tutorial", "flask", "pythonvilag"]
16+
classifiers = [
1717
"License :: OSI Approved :: MIT License",
1818
"Programming Language :: Python :: 3 :: Only",
1919
"Programming Language :: Python :: 3.11",
2020
"Programming Language :: Python :: 3.12",
21-
]
22-
dependencies = [
21+
]
22+
dependencies = [
2323
"Flask-SQLAlchemy==3.1.1",
2424
"Flask-WTF==1.2.1",
25-
"Flask==3.0.2",
26-
"gunicorn==21.2.0",
27-
"itsdangerous==2.1.2",
25+
"Flask==3.0.3",
26+
"gunicorn==23.0.0",
27+
"itsdangerous==2.2.0",
2828
"python-dotenv==1.0.1",
29-
"SQLAlchemy==2.0.27",
30-
"Werkzeug==3.0.1",
29+
"SQLAlchemy==2.0.32",
30+
"Werkzeug==3.0.3",
3131
# Self maintained
3232
# "private-lecture-automation==0.2.0",
3333
# "checkmark==0.1.0",
34-
]
35-
[project.optional-dependencies]
36-
dev = ["mypy", "pre-commit", "pytest-cov", "pytest", "ruff", "tox"]
37-
[project.urls]
38-
Repository = "https://github.com/PythonVilag/pythonvilag-website/"
39-
Homepage = "https://pythonvilag.hu/"
34+
]
35+
[project.optional-dependencies]
36+
dev = ["mypy", "pre-commit", "pytest-cov", "pytest", "ruff", "tox"]
37+
[project.urls]
38+
Repository = "https://github.com/PythonVilag/pythonvilag-website/"
39+
Homepage = "https://pythonvilag.hu/"
4040

4141
# Tools
4242
# MyPy
4343
[tool.mypy]
44-
ignore_missing_imports = true
45-
pretty = true
46-
show_column_numbers = true
47-
show_error_context = true
48-
strict = true
49-
warn_unreachable = true
50-
warn_unused_ignores = true
44+
ignore_missing_imports = true
45+
pretty = true
46+
show_column_numbers = true
47+
show_error_context = true
48+
strict = true
49+
warn_unreachable = true
50+
warn_unused_ignores = true
5151

5252
# Pytest
5353
[tool.pytest.ini_options]
54-
addopts = "--cov=pythonvilag_website --cov=tests --cov-config=pyproject.toml --cov-report=term-missing --cov-report=html --cov-report=xml"
55-
testpaths = ["tests"]
54+
addopts = "--cov=pythonvilag_website --cov=tests --cov-config=pyproject.toml --cov-report=term-missing --cov-report=html --cov-report=xml"
55+
testpaths = ["tests"]

ruff.toml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,29 @@ indent-width = 4
77
target-version = "py311"
88

99
[lint]
10-
select = ["ALL"]
11-
ignore = [
10+
select = ["ALL"]
11+
ignore = [
1212
"D203", # one-blank-line-before-class
1313
"D212", # multi-line-summary-first-line
1414
"FIX", # flake8-fixme
1515
"INP", # flake8-no-pep420
1616
"S104", # hardcoded-bind-all-interfaces
1717
"TD002", # missing-todo-author
1818
"TD003", # missing-todo-link
19-
]
20-
[lint.per-file-ignores]
21-
"__init__.py" = [
22-
"D104", # undocumented-public-package
23-
]
24-
"tests/**/*.py" = [
25-
"ANN001", # missing-type-function-argument
26-
"ANN201", # missing-return-type-undocumented-public-function
27-
"D", # pydocstyle
28-
"PLR2004", # magic-value-comparison
29-
"S101", # assert
30-
]
31-
[lint.pydocstyle]
32-
convention = "google"
19+
]
20+
[lint.per-file-ignores]
21+
"__init__.py" = [
22+
"D104", # undocumented-public-package
23+
]
24+
"tests/**/*.py" = [
25+
"ANN001", # missing-type-function-argument
26+
"ANN201", # missing-return-type-undocumented-public-function
27+
"D", # pydocstyle
28+
"PLR2004", # magic-value-comparison
29+
"S101", # assert
30+
]
31+
[lint.pydocstyle]
32+
convention = "google"
3333

3434
[format]
35-
quote-style = "double"
35+
quote-style = "double"

src/pythonvilag_website/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
app.config["SESSION_COOKIE_SAMESITE"] = "None"
3838
app.config["SESSION_COOKIE_SECURE"] = True
3939

40-
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///site.db"
40+
app.config["SQLALCHEMY_DATABASE_URI"] = f"sqlite:///{app.root_path}/site.db"
4141

4242
app.config["PRIVATE_LECTURE_AUTOMATION"] = PRIVATE_LECTURE_AUTOMATION
4343
app.config["CHECKMARK"] = CHECKMARK

src/pythonvilag_website/static/css/base.css

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ h6 {
6767
margin: auto;
6868
}
6969

70-
71-
7270
/* Style for the flash message container */
7371
.flash-container {
7472
position: fixed;
@@ -95,7 +93,6 @@ h6 {
9593
color: #fff;
9694
}
9795

98-
9996
/* Form */
10097
.input_field {
10198
width: 40%;

src/pythonvilag_website/static/css/footer.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
color: white;
1010
}
1111

12-
1312
.footer-socials {
1413
text-align: center;
1514
align-items: center;
@@ -26,7 +25,6 @@
2625
margin-right: 40px;
2726
}
2827

29-
3028
.footer-socials>a>img {
3129
height: 50px;
3230
padding: 5px;

src/pythonvilag_website/static/css/navigation.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ nav>ul>li>ul.dropdown li {
8484
height: 50px;
8585
}
8686

87-
8887
nav>ul>li>ul.dropdown li>a {
8988
text-decoration: none;
9089
color: black;
@@ -104,7 +103,6 @@ nav>ul>.project_nav>ul.dropdown li>a:hover {
104103
color: #00878F;
105104
}
106105

107-
108106
nav>ul>li:hover>ul.dropdown {
109107
visibility: visible;
110108
opacity: 1;

src/pythonvilag_website/templates/post/python/python_alapjai/00_Bevezetes_es_kurzusinformaciok.html

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,39 @@
11
{% extends "site/base.html" %}
22
{% block content %}
33
<div class="title">
4-
<h1><span style="color: #306998; font-weight: bold">0. Bevezetés és kurzus információk</span></h1>
4+
<h1><span style="color: #306998; font-weight: bold">0. Bevezetés és kurzus információk</span></h1>
55
</div>
66
<div class="description">
7-
<p>
8-
Ebben a leckében ismerjük meg a programozó környezetet,
9-
a tananyag felépítését, illetve a leckék során használt jelölésrendszert.<br><br>
10-
</p>
11-
<p>A videóhoz tartozó tananyag az <a
12-
href="https://colab.research.google.com/github/PythonVilag/Python_alapjai/blob/main/00_Bevezetes_es_kurzusinformaciok/00_Bevezetes_es_kurzusinformaciok.ipynb"
13-
target="_blank">alábbi linken</a> érhető el.
14-
</p>
7+
<p>
8+
Ebben a leckében ismerjük meg a programozó környezetet,
9+
a tananyag felépítését, illetve a leckék során használt jelölésrendszert.<br><br>
10+
</p>
11+
<p>A videóhoz tartozó tananyag az <a
12+
href="https://colab.research.google.com/github/PythonVilag/Python_alapjai/blob/main/00_Bevezetes_es_kurzusinformaciok/00_Bevezetes_es_kurzusinformaciok.ipynb"
13+
target="_blank">alábbi linken</a> érhető el.
14+
</p>
1515

1616
</div>
1717

1818
<br>
1919
<button class="accordion accordion_video">Bevezetés és kurzus információk videó</button>
2020

2121
<div class="panel panel_video">
22-
<div class="video">
23-
<iframe width="1012" height="570" src="https://www.youtube.com/embed/N_wZFvUKVAY" frameborder="0"
24-
allowfullscreen></iframe>
25-
</div>
22+
<div class="video">
23+
<iframe width="1012" height="570" src="https://www.youtube.com/embed/N_wZFvUKVAY" frameborder="0"
24+
allowfullscreen></iframe>
25+
</div>
2626
</div>
2727

2828
<div class="description">
29-
<div class="dashed"></div>
30-
Ha úgy érzed sikerült megérteni a lecke lényegét töltsd ki a tesztet!<br>
31-
Az tesznek nincs semmi súlya, csak a Te fejlődésedet segíti.
32-
<a class="assessment_button" href="{{ url_for('open_assessment', category=category,
29+
<div class="dashed"></div>
30+
Ha úgy érzed sikerült megérteni a lecke lényegét töltsd ki a tesztet!<br>
31+
Az tesznek nincs semmi súlya, csak a Te fejlődésedet segíti.
32+
<a class="assessment_button" href="{{ url_for('open_assessment', category=category,
3333
subcategory=subcategory, url=lesson.url) }}">Bevezetés és kurzus információk teszt</a>
34+
35+
<div class="dashed"></div>
36+
{% include 'site/giscus.html' %}
3437
</div>
3538

3639

0 commit comments

Comments
 (0)