]> git.p6c8.net - pcdenotes.git/commitdiff
Moved some styles into a CSS file
authorPatrick Canterino <patrick@patrick-canterino.de>
Sun, 30 Jan 2022 17:47:36 +0000 (18:47 +0100)
committerPatrick Canterino <patrick@patrick-canterino.de>
Sun, 30 Jan 2022 17:50:23 +0000 (18:50 +0100)
notes/static/style.css [new file with mode: 0644]
notes/templates/note.html
notes/templates/note_base.html
pcdenotes/settings.py

diff --git a/notes/static/style.css b/notes/static/style.css
new file mode 100644 (file)
index 0000000..57d9dfc
--- /dev/null
@@ -0,0 +1,29 @@
+header {
+    color: #ffffff;
+    background-color: #0d6efd;
+    text-align: center;
+}
+
+header a:link, header a:visited, header a:active, header a:hover {
+    color: #ffffff;
+}
+
+footer {
+    color: #ffffff;
+    background-color: #212529;
+}
+
+footer a:link, footer a:visited, footer a:active, footer a:hover {
+    color: #ffffff;
+}
+
+footer ul {
+    list-style-type: none;
+    margin-left: 0;
+    padding-left: 0;
+}
+
+article .publication-date {
+    font-style: italic;
+    font-size: smaller;
+}
\ No newline at end of file
index 1bce423ef15d6b804ae66349278f32ef53a2c0b4..9eebd5ccf8486b357ee728c6e8059c3946cfd79d 100644 (file)
@@ -3,5 +3,5 @@
     <h2><a href="{{ note.get_absolute_url }}" class="{% if note.is_draft %}text-muted{% else %}link-dark{% endif %}">{{ note.title }}</a></h2>
     {% if note.is_draft %}<p class="fw-bold">Status: Draft</p>{% endif %}
     <div class="mt-3">{{ note.content|linebreaksbr|markdownify }}</div>
-    <p class="fst-italic" style="font-size: smaller;">Published on {{ note.created_at|date:"Y-m-d, H:i" }}</p>
+    <p class="publication-date">Published on {{ note.created_at|date:"Y-m-d, H:i" }}</p>
 </article>
\ No newline at end of file
index 7392514ebf3d07bebe8c6d44835820c8bd7ee832..b4e2f711fc736cdd35e815c4fbe780fe89738e9f 100644 (file)
@@ -1,3 +1,4 @@
+{% load static %}
 <!DOCTYPE html>
 
 <html lang="en">
@@ -5,34 +6,35 @@
   <title>{% block title %}{% endblock %}</title>
   <meta charset="UTF-8" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+  <link href="{% static "style.css" %}" rel="stylesheet">
   <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
   <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
 </head>
 <body class="d-flex flex-column min-vh-100">
 
-  <header class="container-fluid p-5 bg-primary text-white text-center">
-    <h1><a href="/" class="link-light">Notes</a></h1>
+  <header class="container-fluid p-5">
+    <h1><a href="/">Notes</a></h1>
   </header>
 
   <div id="content" class="container flex-fill">
     {% block content %}{% endblock %}
   </div>
 
-  <footer class="container-fluid p-5 bg-dark text-white mt-5">
+  <footer class="container-fluid p-5 mt-5">
     <div class="row">
       <div class="col-lg-6 col-md-12 col-sm-12">
-        <ul style="list-style-type: none; margin-left: 0; padding-left: 0;">
-          <li><a href="/" class="link-light">Home</a></li>
-          <li><a href="/archive/" class="link-light">Archive</a></li>
+        <ul>
+          <li><a href="/">Home</a></li>
+          <li><a href="/archive/">Archive</a></li>
         </ul>
       </div>
       <div class="col-lg-6 col-md-12 col-sm-12">
-        This site contains random notes and thoughts by <a href="https://www.patrick-canterino.de/" class="link-light">Patrick Canterino</a>.<br>
-        If you have any questions, you may write me an email: <a href="mailto:patrick@patrick-canterino.de" class="link-light">patrick@patrick-canterino.de</a>
+        This site contains random notes and thoughts by <a href="https://www.patrick-canterino.de/">Patrick Canterino</a>.<br>
+        If you have any questions, you may write me an email: <a href="mailto:patrick@patrick-canterino.de">patrick@patrick-canterino.de</a>
       </div>
     </div>
     <div class="text-center">
-      © 2022 <a href="https://www.patrick-canterino.de/" class="link-light">Patrick Canterino</a>
+      © 2022 <a href="https://www.patrick-canterino.de/">Patrick Canterino</a>
     </div>
   </footer>
 </body>
index 1d455a7f3b5c07bb7b41825c2458ffbe70548f96..88b705dd8298b1c8d2c3b8e6e843965c3f51aee8 100644 (file)
@@ -132,6 +132,8 @@ USE_TZ = True
 STATIC_URL = '/static/'
 STATIC_ROOT = BASE_DIR / 'static'
 
+STATICFILES_DIRS = [BASE_DIR / 'notes/static']
+
 # Default primary key field type
 # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
 

patrick-canterino.de