Compare commits
2 Commits
25c0d2545c
...
13c72b8066
Author | SHA1 | Date | |
---|---|---|---|
![]() |
13c72b8066 | ||
![]() |
2725f4257c |
11
blog/blog.py
11
blog/blog.py
@@ -3,7 +3,6 @@ import shutil
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from blog.page import Page
|
from blog.page import Page
|
||||||
from blog.config import Config
|
from blog.config import Config
|
||||||
from blog.theme import Theme
|
|
||||||
from jinja2 import Environment, FileSystemLoader, Template
|
from jinja2 import Environment, FileSystemLoader, Template
|
||||||
|
|
||||||
|
|
||||||
@@ -32,9 +31,9 @@ class Blog:
|
|||||||
page_template = env.get_template("page.html.j2")
|
page_template = env.get_template("page.html.j2")
|
||||||
index_template = env.get_template("index.html.j2")
|
index_template = env.get_template("index.html.j2")
|
||||||
|
|
||||||
|
self._copy_css()
|
||||||
self._build_all_pages(page_template)
|
self._build_all_pages(page_template)
|
||||||
self._build_index(index_template)
|
self._build_index(index_template)
|
||||||
self._copy_css()
|
|
||||||
|
|
||||||
def _build_all_pages(self, template: Template):
|
def _build_all_pages(self, template: Template):
|
||||||
"""Convertit les pages markdown dans conf.inbox en html dans conf.outbox"""
|
"""Convertit les pages markdown dans conf.inbox en html dans conf.outbox"""
|
||||||
@@ -65,12 +64,4 @@ class Blog:
|
|||||||
|
|
||||||
for css_file in css_path.glob('*.css'):
|
for css_file in css_path.glob('*.css'):
|
||||||
dest_file = dest_path / css_file.name
|
dest_file = dest_path / css_file.name
|
||||||
|
|
||||||
shutil.copy(css_file, dest_file)
|
shutil.copy(css_file, dest_file)
|
||||||
|
|
||||||
# dest = Path(str(dest_path) + '/' + Path(css_file).stem() + '.css')
|
|
||||||
|
|
||||||
# dest.write_text(Path(css_file).read_text)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -98,7 +98,3 @@ class Page:
|
|||||||
self.md_content, extensions=["codehilite", "fenced_code"]
|
self.md_content, extensions=["codehilite", "fenced_code"]
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
# from bs4 import BeautifulSoup as bs
|
|
||||||
# print(bs(html_string, 'html.parser').prettify())
|
|
||||||
|
@@ -1,17 +0,0 @@
|
|||||||
import glob
|
|
||||||
from pathlib import Path
|
|
||||||
from blog.page import Page
|
|
||||||
from blog.config import Config
|
|
||||||
from jinja2 import Environment, FileSystemLoader, Template
|
|
||||||
|
|
||||||
|
|
||||||
class Theme:
|
|
||||||
|
|
||||||
def __init__(self, path: Path):
|
|
||||||
""" """
|
|
||||||
self.path = path
|
|
||||||
|
|
||||||
|
|
||||||
def _list_css(self)
|
|
||||||
""" """
|
|
||||||
pass
|
|
Reference in New Issue
Block a user