Compare commits
7 Commits
6aec5a5659
...
c30f39ca24
| Author | SHA1 | Date |
|---|---|---|
|
|
c30f39ca24 | |
|
|
017aad2ede | |
|
|
bd4c7cab70 | |
|
|
5ccb53fb5d | |
|
|
7b8a57fc92 | |
|
|
c6b834e5b7 | |
|
|
d665992b22 |
|
|
@ -39,6 +39,7 @@ INSTALLED_APPS = [
|
|||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'core.apps.CoreConfig',
|
||||
'articles.apps.ArticlesConfig',
|
||||
'markdownx',
|
||||
]
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
# Register your models here.
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class CoreConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'core'
|
||||
|
|
@ -0,0 +1 @@
|
|||
# Create your models here.
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
{% load static %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{% block title %}Drulum{% endblock %}</title>
|
||||
{# <link rel="stylesheet" href="{% static 'css/base.css' %}">#}
|
||||
</head>
|
||||
<body>
|
||||
{% block page %}
|
||||
{% block header %}{% include 'header.html' %}{% endblock %}
|
||||
{% block content %}{% endblock %}
|
||||
{% block footer %}{% include 'footer.html' %}{% endblock %}
|
||||
{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<main>
|
||||
<div>
|
||||
<h1>Oh my word, this is basic!</h1>
|
||||
<p>I got bored and decided to develop this site from scratch, again. See the <a
|
||||
href="{% url 'core:about-website' %}">About This Website</a> page if you're at all interested in
|
||||
what I'm doing and why. The short version is that I'll be developing features for the website as I
|
||||
create content for it. In other words, it's going to take a long time before it's <em>pretty</em>.</p>
|
||||
<p>Longer term this site will present my own photographs and photography tuition services along with
|
||||
articles on photography, philosophy, politics, health & mental health, and whatever else I feel
|
||||
like.</p>
|
||||
</div>
|
||||
<hr>
|
||||
{% if featured_articles %}
|
||||
<h1>Featured Articles</h1>
|
||||
<hr>
|
||||
<div>
|
||||
{% for article in featured_articles %}
|
||||
<div>
|
||||
<a href="{{ article.get_absolute_url }}">{{ article.title }}</a>
|
||||
{% if article.subtitle %}
|
||||
<h5>{{ article.subtitle }}</h5>
|
||||
{% endif %}
|
||||
{% if article.introduction %}
|
||||
<hr>
|
||||
<p>{{ article.introduction|linebreaksbr }}</p>
|
||||
{% endif %}
|
||||
<hr>
|
||||
<div>
|
||||
<span>
|
||||
<a href="{% url 'articles:list_category' category=article.category.slug %}">{{ article.category }} </a>• {{ article.created|date:'jS \o\f F, Y' }}
|
||||
</span>
|
||||
<span>
|
||||
{% for tag in article.tags.all %}
|
||||
<a href="{{ tag.get_absolute_url }}">{{ tag }}</a>{% if tag != article.tags.last %},
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</main>
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
<footer>
|
||||
<p>All content © Calum Andrew Morrell</p>
|
||||
</footer>
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
<header>
|
||||
<div>
|
||||
<h3><a href="{% url 'core:homepage' %}">the digital home of</a></h3>
|
||||
<h1><a href="{% url 'core:homepage' %}">Calum Andrew Morrell</a></h1>
|
||||
</div>
|
||||
<div>
|
||||
<nav>
|
||||
<a href="{% url 'core:about-me' %}">about me</a>
|
||||
<a href="{% url 'core:about-website' %}">about this website</a>
|
||||
<a href="{% url 'core:contact-me' %}">contact me</a>
|
||||
</nav>
|
||||
<nav>
|
||||
<a href="{% url 'core:homepage' %}">Home</a>
|
||||
{# <a href="#">Photography</a>#}
|
||||
<a href="{% url 'articles:list' %}">Articles</a>
|
||||
{# <a href="{% url 'articles:categories' %}">Categories</a>#}
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<nav>
|
||||
<hr>
|
||||
<ul>
|
||||
{% if page_obj.has_previous %}
|
||||
<li><a href="?page=1">« first</a></li>
|
||||
<li><a href="?page={{ page_obj.previous_page_number }}">previous</a></li>
|
||||
{% endif %}
|
||||
{% for page in page_obj.paginator.page_range %}
|
||||
<li><a href="?page={{ page }}">{{ page }}</a></li>
|
||||
{% endfor %}
|
||||
{% if page_obj.has_next %}
|
||||
<li><a href="?page={{ page_obj.next_page_number }}">next</a></li>
|
||||
<li><a href="?page={{ page_obj.paginator.num_pages }}">last »</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</nav>
|
||||
|
|
@ -0,0 +1 @@
|
|||
# Create your tests here.
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
from django.views.generic import TemplateView
|
||||
|
||||
from articles.models import Article
|
||||
|
||||
|
||||
class Homepage(TemplateView):
|
||||
template_name = 'core/homepage.html'
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(Homepage, self).get_context_data()
|
||||
context['featured_articles'] = Article.objects.filter(is_featured=True)
|
||||
return context
|
||||
|
||||
# TODO: place a random website link on the homepage
|
||||
Loading…
Reference in New Issue