Compare commits
No commits in common. "c1749068afc432ec91ef560ad42bf10c9ad0b95f" and "45d2cb66f000e4aba345bd9180be19d399251ad4" have entirely different histories.
c1749068af
...
45d2cb66f0
34 changed files with 3 additions and 454 deletions
|
|
@ -1,8 +0,0 @@
|
||||||
from django.contrib import admin
|
|
||||||
from .models import Post
|
|
||||||
|
|
||||||
@admin.register(Post)
|
|
||||||
class PostAdmin(admin.ModelAdmin):
|
|
||||||
list_display = ('name', 'tags', 'slug', 'created_at')
|
|
||||||
search_fields = ('name', 'tags')
|
|
||||||
prepopulated_fields = {"slug": ("name",)}
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
from django.apps import AppConfig
|
|
||||||
|
|
||||||
|
|
||||||
class BlogConfig(AppConfig):
|
|
||||||
name = 'blog'
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
from .models import Post
|
|
||||||
|
|
||||||
def posts_list(request):
|
|
||||||
posts = Post.objects.all()
|
|
||||||
return {'posts': posts}
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
# Generated by Django 6.0 on 2025-12-15 14:58
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
initial = True
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.CreateModel(
|
|
||||||
name='Post',
|
|
||||||
fields=[
|
|
||||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
||||||
('name', models.CharField(max_length=200)),
|
|
||||||
('tags', models.CharField(max_length=200)),
|
|
||||||
('slug', models.SlugField()),
|
|
||||||
('content', models.TextField()),
|
|
||||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
||||||
('updated_at', models.DateTimeField(auto_now=True)),
|
|
||||||
],
|
|
||||||
options={
|
|
||||||
'verbose_name': 'Article',
|
|
||||||
'verbose_name_plural': 'Articles',
|
|
||||||
},
|
|
||||||
),
|
|
||||||
]
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
# Generated by Django 6.0 on 2025-12-15 19:40
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('blog', '0001_initial'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='post',
|
|
||||||
name='enable',
|
|
||||||
field=models.BooleanField(default=True),
|
|
||||||
),
|
|
||||||
]
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
from django.db import models
|
|
||||||
|
|
||||||
class Post(models.Model):
|
|
||||||
name = models.CharField(max_length=200)
|
|
||||||
tags = models.CharField(max_length=200)
|
|
||||||
slug = models.SlugField()
|
|
||||||
content = models.TextField()
|
|
||||||
created_at = models.DateTimeField(auto_now_add=True)
|
|
||||||
updated_at = models.DateTimeField(auto_now=True)
|
|
||||||
enable = models.BooleanField(default=True)
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
verbose_name = "Article"
|
|
||||||
verbose_name_plural = "Articles"
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return self.name
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
from django.test import TestCase
|
|
||||||
|
|
||||||
# Create your tests here.
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
from django.urls import path
|
|
||||||
from . import views
|
|
||||||
|
|
||||||
app_name = 'blog'
|
|
||||||
urlpatterns = [
|
|
||||||
path('', views.blog_home, name='blog'),
|
|
||||||
path('<str:slug>/', views.blog_view_post, name='post_detail'),
|
|
||||||
]
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
from django.shortcuts import render
|
|
||||||
|
|
||||||
from blog.models import Post
|
|
||||||
|
|
||||||
|
|
||||||
def blog_home(request):
|
|
||||||
return render(request, 'blog/home.html')
|
|
||||||
|
|
||||||
def blog_view_post(request, slug):
|
|
||||||
post = Post.objects.get(slug=slug)
|
|
||||||
return render(request, 'blog/details.html', {'post': post})
|
|
||||||
|
|
@ -23,7 +23,4 @@ class SiteSettingsAdmin(admin.ModelAdmin):
|
||||||
('Contact', {
|
('Contact', {
|
||||||
'fields': ('contact_email',)
|
'fields': ('contact_email',)
|
||||||
}),
|
}),
|
||||||
('Blog', {
|
)
|
||||||
'fields': ('blog_title', 'blog_description')
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
# Generated by Django 6.0 on 2025-12-15 19:35
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('core', '0001_initial'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='sitesettings',
|
|
||||||
name='blog_description',
|
|
||||||
field=models.TextField(blank=True),
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='sitesettings',
|
|
||||||
name='blog_title',
|
|
||||||
field=models.CharField(default='Mon Blog', max_length=200),
|
|
||||||
),
|
|
||||||
]
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
# Generated by Django 6.0 on 2025-12-15 19:40
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('core', '0002_sitesettings_blog_description_and_more'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name='sitesettings',
|
|
||||||
name='blog_description',
|
|
||||||
field=models.TextField(blank=True, default='Je documente la construction de PartirDeZero.com : mes choix techniques, mes bugs résolus et mes conseils pour lancer tes propres projets web. Apprends en regardant faire.'),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name='sitesettings',
|
|
||||||
name='blog_title',
|
|
||||||
field=models.CharField(default='Blog du développeur', max_length=200),
|
|
||||||
),
|
|
||||||
]
|
|
||||||
|
|
@ -13,10 +13,6 @@ class SiteSettings(models.Model):
|
||||||
linkedin_url = models.URLField(blank=True)
|
linkedin_url = models.URLField(blank=True)
|
||||||
github_url = models.URLField(blank=True)
|
github_url = models.URLField(blank=True)
|
||||||
|
|
||||||
# Blog
|
|
||||||
blog_title = models.CharField(max_length=200, default="Blog du développeur")
|
|
||||||
blog_description = models.TextField(blank=True, default="Je documente la construction de PartirDeZero.com : mes choix techniques, mes bugs résolus et mes conseils pour lancer tes propres projets web. Apprends en regardant faire.")
|
|
||||||
|
|
||||||
# L'astuce pour qu'il n'y ait qu'un seul réglage
|
# L'astuce pour qu'il n'y ait qu'un seul réglage
|
||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
self.pk = 1 # On force l'ID à 1. Si tu sauvegardes, ça écrase l'existant.
|
self.pk = 1 # On force l'ID à 1. Si tu sauvegardes, ça écrase l'existant.
|
||||||
|
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
# Generated by Django 6.0 on 2025-12-15 14:58
|
|
||||||
|
|
||||||
from django.db import migrations
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('courses', '0003_comment_parent'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AlterModelOptions(
|
|
||||||
name='course',
|
|
||||||
options={'verbose_name': 'Cours', 'verbose_name_plural': 'Cours'},
|
|
||||||
),
|
|
||||||
migrations.AlterModelOptions(
|
|
||||||
name='lesson',
|
|
||||||
options={'verbose_name': 'Leçon', 'verbose_name_plural': 'Leçons'},
|
|
||||||
),
|
|
||||||
]
|
|
||||||
|
|
@ -12,10 +12,6 @@ class Course(models.Model):
|
||||||
updated_at = models.DateTimeField(auto_now=True)
|
updated_at = models.DateTimeField(auto_now=True)
|
||||||
enable = models.BooleanField(default=True)
|
enable = models.BooleanField(default=True)
|
||||||
|
|
||||||
class Meta:
|
|
||||||
verbose_name = "Cours"
|
|
||||||
verbose_name_plural = "Cours"
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
|
@ -44,10 +40,6 @@ class Lesson(models.Model):
|
||||||
is_premium = models.BooleanField(default=False)
|
is_premium = models.BooleanField(default=False)
|
||||||
order = models.PositiveIntegerField()
|
order = models.PositiveIntegerField()
|
||||||
|
|
||||||
class Meta:
|
|
||||||
verbose_name = "Leçon"
|
|
||||||
verbose_name_plural = "Leçons"
|
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
# Remplacer les chevrons <?php et ?> par leurs équivalents HTML
|
# Remplacer les chevrons <?php et ?> par leurs équivalents HTML
|
||||||
if self.content:
|
if self.content:
|
||||||
|
|
|
||||||
|
|
@ -51,8 +51,6 @@ INSTALLED_APPS = [
|
||||||
'core',
|
'core',
|
||||||
'courses',
|
'courses',
|
||||||
'users',
|
'users',
|
||||||
'progression',
|
|
||||||
'blog',
|
|
||||||
]
|
]
|
||||||
|
|
||||||
MIDDLEWARE = [
|
MIDDLEWARE = [
|
||||||
|
|
@ -83,7 +81,6 @@ TEMPLATES = [
|
||||||
'devart.context_processor.app_version',
|
'devart.context_processor.app_version',
|
||||||
'core.context_processor.site_settings',
|
'core.context_processor.site_settings',
|
||||||
'courses.context_processors.course_list',
|
'courses.context_processors.course_list',
|
||||||
'blog.context_processor.posts_list',
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ from django.urls import reverse
|
||||||
# --- IMPORTS DEPUIS TES DIFFÉRENTES FEATURES ---
|
# --- IMPORTS DEPUIS TES DIFFÉRENTES FEATURES ---
|
||||||
from courses.models import Course
|
from courses.models import Course
|
||||||
from users.models import Profile
|
from users.models import Profile
|
||||||
from blog.models import Post
|
|
||||||
|
|
||||||
# --- SITEMAP : LES Cours ---
|
# --- SITEMAP : LES Cours ---
|
||||||
class CourseSitemap(sitemaps.Sitemap):
|
class CourseSitemap(sitemaps.Sitemap):
|
||||||
|
|
@ -18,14 +17,6 @@ class CourseSitemap(sitemaps.Sitemap):
|
||||||
# Assure-toi que ton modèle Course a bien une méthode get_absolute_url
|
# Assure-toi que ton modèle Course a bien une méthode get_absolute_url
|
||||||
return item.get_absolute_url()
|
return item.get_absolute_url()
|
||||||
|
|
||||||
# --- SITEMAP : BLOG ---
|
|
||||||
class BlogSitemap(sitemaps.Sitemap):
|
|
||||||
changefreq = "weekly"
|
|
||||||
priority = 0.8
|
|
||||||
|
|
||||||
def location(self, item):
|
|
||||||
return item.get_absolute_url()
|
|
||||||
|
|
||||||
# --- SITEMAP : PAGES STATIQUES ---
|
# --- SITEMAP : PAGES STATIQUES ---
|
||||||
class StaticViewSitemap(sitemaps.Sitemap):
|
class StaticViewSitemap(sitemaps.Sitemap):
|
||||||
priority = 0.5
|
priority = 0.5
|
||||||
|
|
|
||||||
|
|
@ -44,8 +44,6 @@ urlpatterns = [
|
||||||
path('courses/', include('courses.urls')),
|
path('courses/', include('courses.urls')),
|
||||||
path('users/', include('users.urls')),
|
path('users/', include('users.urls')),
|
||||||
|
|
||||||
path('blog/', include('blog.urls')),
|
|
||||||
|
|
||||||
path('sitemap.xml', sitemap, {'sitemaps': sitemaps_dict}, name='django.contrib.sitemaps.views.sitemap'),
|
path('sitemap.xml', sitemap, {'sitemaps': sitemaps_dict}, name='django.contrib.sitemaps.views.sitemap'),
|
||||||
path('robots.txt', robots_txt),
|
path('robots.txt', robots_txt),
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
from django.contrib import admin
|
|
||||||
from .models import Progression
|
|
||||||
from courses.models import Course, Lesson
|
|
||||||
|
|
||||||
@admin.register(Progression)
|
|
||||||
class ProgressionAdmin(admin.ModelAdmin):
|
|
||||||
list_display = ('user', 'course', 'get_percent', 'updated_at')
|
|
||||||
list_filter = ('course', 'updated_at')
|
|
||||||
search_fields = ('user__username', 'course__name')
|
|
||||||
|
|
||||||
autocomplete_fields = ['course', 'completed_lessons']
|
|
||||||
|
|
||||||
def get_percent(self, obj):
|
|
||||||
return f"{obj.percent_completed}"
|
|
||||||
get_percent.short_description = 'Progression'
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
from django.apps import AppConfig
|
|
||||||
|
|
||||||
|
|
||||||
class ProgressionConfig(AppConfig):
|
|
||||||
name = 'progression'
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
||||||
# Generated by Django 6.0 on 2025-12-15 14:25
|
|
||||||
|
|
||||||
import django.db.models.deletion
|
|
||||||
from django.conf import settings
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
initial = True
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('courses', '0003_comment_parent'),
|
|
||||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.CreateModel(
|
|
||||||
name='Progression',
|
|
||||||
fields=[
|
|
||||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
||||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
||||||
('updated_at', models.DateTimeField(auto_now=True)),
|
|
||||||
('completed_lessons', models.ManyToManyField(blank=True, related_name='completed_by', to='courses.lesson')),
|
|
||||||
('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_progress', to='courses.course')),
|
|
||||||
('last_viewed_lesson', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='last_viewed_by', to='courses.lesson')),
|
|
||||||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='progress', to=settings.AUTH_USER_MODEL)),
|
|
||||||
],
|
|
||||||
options={
|
|
||||||
'verbose_name': 'Progression du cours',
|
|
||||||
'unique_together': {('user', 'course')},
|
|
||||||
},
|
|
||||||
),
|
|
||||||
]
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
||||||
from django.db import models
|
|
||||||
from django.conf import settings
|
|
||||||
|
|
||||||
class Progression(models.Model):
|
|
||||||
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, related_name='progress')
|
|
||||||
course = models.ForeignKey('courses.Course', on_delete=models.CASCADE, related_name='user_progress')
|
|
||||||
completed_lessons = models.ManyToManyField('courses.Lesson', blank=True, related_name='completed_by')
|
|
||||||
last_viewed_lesson = models.ForeignKey('courses.Lesson', on_delete=models.SET_NULL, null=True, blank=True, related_name='last_viewed_by')
|
|
||||||
created_at = models.DateTimeField(auto_now_add=True)
|
|
||||||
updated_at = models.DateTimeField(auto_now=True)
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
unique_together = ('user', 'course')
|
|
||||||
verbose_name = "Progression du cours"
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return f"{self.user} - {self.course.name}"
|
|
||||||
|
|
||||||
@property
|
|
||||||
def percent_completed(self):
|
|
||||||
from courses.models import Lesson
|
|
||||||
total_lessons = Lesson.objects.filter(module__course=self.course).count()
|
|
||||||
if total_lessons == 0:
|
|
||||||
return 0
|
|
||||||
|
|
||||||
completed_lessons = self.completed_lessons.count()
|
|
||||||
|
|
||||||
return int((completed_lessons / total_lessons) * 100)
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
from django.test import TestCase
|
|
||||||
|
|
||||||
# Create your tests here.
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
from django.urls import path
|
|
||||||
from . import views
|
|
||||||
|
|
||||||
app_name = 'progression'
|
|
||||||
urlpatterns = [
|
|
||||||
|
|
||||||
]
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
from django.shortcuts import render
|
|
||||||
|
|
||||||
# Create your views here.
|
|
||||||
|
|
@ -751,100 +751,6 @@ img {
|
||||||
height: auto;
|
height: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ======================================
|
|
||||||
Blog components
|
|
||||||
====================================== */
|
|
||||||
|
|
||||||
/* Accessibilité: élément visuellement masqué mais accessible aux lecteurs d'écran */
|
|
||||||
.sr-only {
|
|
||||||
position: absolute !important;
|
|
||||||
width: 1px !important;
|
|
||||||
height: 1px !important;
|
|
||||||
padding: 0 !important;
|
|
||||||
margin: -1px !important;
|
|
||||||
overflow: hidden !important;
|
|
||||||
clip: rect(0,0,0,0) !important;
|
|
||||||
white-space: nowrap !important;
|
|
||||||
border: 0 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Blog layout wrappers */
|
|
||||||
.blog.blog-home .blog-header {
|
|
||||||
display: grid;
|
|
||||||
gap: var(--space-3);
|
|
||||||
margin-bottom: var(--space-6);
|
|
||||||
}
|
|
||||||
.blog-title {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
.blog-description {
|
|
||||||
color: var(--text-muted);
|
|
||||||
font-size: 1.05rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Post list grid */
|
|
||||||
.post-list {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
|
|
||||||
gap: var(--space-5);
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-card {
|
|
||||||
background: var(--surface);
|
|
||||||
border: 1px solid var(--border-subtle);
|
|
||||||
border-radius: var(--r-3);
|
|
||||||
box-shadow: var(--shadow-1);
|
|
||||||
padding: var(--space-5);
|
|
||||||
display: grid;
|
|
||||||
gap: var(--space-3);
|
|
||||||
transition: transform var(--transition-1), box-shadow var(--transition-1), border-color var(--transition-1);
|
|
||||||
}
|
|
||||||
.post-card:hover {
|
|
||||||
transform: translateY(-2px);
|
|
||||||
box-shadow: var(--shadow-2);
|
|
||||||
border-color: var(--border-strong);
|
|
||||||
}
|
|
||||||
.post-card-title {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
.post-card-title a { color: var(--fg); text-decoration: none; }
|
|
||||||
.post-card-title a:hover { color: var(--link-hover); text-decoration: underline; }
|
|
||||||
.post-excerpt { color: var(--text); opacity: 0.95; }
|
|
||||||
.post-actions { margin-top: 2px; }
|
|
||||||
|
|
||||||
/* Post meta (date, tags) */
|
|
||||||
.post-meta { color: var(--text-muted); font-size: 0.95rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
|
|
||||||
.post-meta i { color: var(--muted); margin-right: 6px; }
|
|
||||||
.post-meta .sep { color: var(--muted); }
|
|
||||||
|
|
||||||
/* Post detail */
|
|
||||||
.post-detail .post-header { margin-bottom: var(--space-5); }
|
|
||||||
.post-detail .post-title { margin-bottom: var(--space-2); }
|
|
||||||
|
|
||||||
/* Prose content: typographic rhythm inside articles */
|
|
||||||
.prose {
|
|
||||||
line-height: 1.75;
|
|
||||||
color: var(--text);
|
|
||||||
}
|
|
||||||
.prose :where(p, ul, ol, blockquote, pre, table, img) { margin: 0 0 var(--space-4); }
|
|
||||||
.prose a { color: var(--link); }
|
|
||||||
.prose a:hover { color: var(--link-hover); text-decoration: underline; }
|
|
||||||
.prose blockquote {
|
|
||||||
margin-left: 0;
|
|
||||||
padding-left: var(--space-4);
|
|
||||||
border-left: 3px solid var(--border-strong);
|
|
||||||
color: var(--text-muted);
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
.prose code { font-family: var(--font-mono); background: var(--neutral-300); padding: 0 4px; border-radius: var(--r-1); }
|
|
||||||
.prose pre {
|
|
||||||
background: var(--code-bg);
|
|
||||||
color: var(--code-text);
|
|
||||||
padding: var(--space-4);
|
|
||||||
border-radius: var(--r-2);
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Make embedded media responsive */
|
/* Make embedded media responsive */
|
||||||
iframe, video { max-width: 100%; height: auto; }
|
iframe, video { max-width: 100%; height: auto; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
{% extends 'layout.html' %}
|
|
||||||
{% block title %} | Blog : {{ post.name }}{% endblock %}
|
|
||||||
{% block og_title %}Blog de Partir De Zéro : {{ post.name }}{% endblock %}
|
|
||||||
{% block description %}{{ post.content|striptags|truncatewords:20 }}{% endblock %}
|
|
||||||
{% block og_description %}{{ post.content|striptags|truncatewords:20 }}{% endblock %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
<section class="blog post-detail">
|
|
||||||
<header class="post-header">
|
|
||||||
<h1 class="post-title">{{ post.name }}</h1>
|
|
||||||
<div class="post-meta">
|
|
||||||
<span class="post-date"><i class="fa-regular fa-calendar"></i> {{ post.created_at|date:"d F Y" }}</span>
|
|
||||||
{% if post.tags %}
|
|
||||||
<span class="sep">•</span>
|
|
||||||
<span class="post-tags"><i class="fa-solid fa-tag"></i> {{ post.tags }}</span>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<article class="post-content prose">
|
|
||||||
{{ post.content|safe }}
|
|
||||||
</article>
|
|
||||||
</section>
|
|
||||||
{% endblock %}
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
{% extends 'layout.html' %}
|
|
||||||
{% block title %} | Blog{% endblock %}
|
|
||||||
{% block og_title %}Blog de Partir De Zéro{% endblock %}
|
|
||||||
{% block description %}{{ settings.blog_description }}{% endblock %}
|
|
||||||
{% block og_description %}{{ settings.blog_description }}{% endblock %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
<section class="blog blog-home">
|
|
||||||
<header class="blog-header">
|
|
||||||
<h1 class="blog-title">{{ settings.blog_title|default:'Blog' }}</h1>
|
|
||||||
<p class="blog-description">{{ settings.blog_description }}</p>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<h2 class="sr-only">Liste des articles</h2>
|
|
||||||
{% include 'blog/partials/_posts_list.html' %}
|
|
||||||
</section>
|
|
||||||
{% endblock %}
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
<div class="post-list">
|
|
||||||
{% for post in posts %}
|
|
||||||
<article class="post-card">
|
|
||||||
<h3 class="post-card-title"><a href="{% url 'blog:post_detail' post.slug %}">{{ post.name }}</a></h3>
|
|
||||||
<div class="post-meta">
|
|
||||||
<span class="post-date"><i class="fa-regular fa-calendar"></i> {{ post.created_at|date:"d F Y" }}</span>
|
|
||||||
{% if post.tags %}
|
|
||||||
<span class="sep">•</span>
|
|
||||||
<span class="post-tags"><i class="fa-solid fa-tag"></i> {{ post.tags }}</span>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
<p class="post-excerpt">{{ post.content|striptags|truncatewords:26 }}</p>
|
|
||||||
<div class="post-actions">
|
|
||||||
<a class="button button-secondary" href="{% url 'blog:post_detail' post.slug %}">Lire l'article →</a>
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
{% empty %}
|
|
||||||
<p>Aucun article pour le moment.</p>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
|
|
@ -20,8 +20,8 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<!--<li><a href="">Tutoriels</a></li>-->
|
<!--<li><a href="">Tutoriels</a></li>
|
||||||
<li><a href="{% url 'blog:blog' %}">Blog</a></li>
|
<li><a href="">Billets</a></li>-->
|
||||||
</ul>
|
</ul>
|
||||||
<div class="navend">
|
<div class="navend">
|
||||||
<ul>
|
<ul>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue