Skip to content

Commit

Permalink
feat: add htmx
Browse files Browse the repository at this point in the history
  • Loading branch information
kylesinlynn committed Dec 13, 2023
1 parent 74f278c commit ddcb9e2
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 2 deletions.
16 changes: 14 additions & 2 deletions core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django-htmx', # Django HTMX combination
'django_htmx', # Django HTMX combination
'portfolio',
]

MIDDLEWARE = [
Expand All @@ -56,7 +57,7 @@
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'DIRS': [ BASE_DIR / 'templates' ],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
Expand Down Expand Up @@ -118,6 +119,17 @@
# https://docs.djangoproject.com/en/5.0/howto/static-files/

STATIC_URL = 'static/'
STATIC_ROOT = BASE_DIR / 'static'

# STATIC_DIRS = [
# BASE_DIR / 'static',
# ]

# Upload files (Images, Files)
# https://docs.djangoproject.com/en/5.0/howto/static-files/#serving-files-uploaded-by-a-user-during-development

# MEDIA_URL = 'uploads/'
# MEDIA_ROOT = BASE_DIR / 'uploads'

# Default primary key field type
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field
Expand Down
1 change: 1 addition & 0 deletions static/js/htmx.min.js

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions templates/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{% load static %}

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

{% comment %} SEO {% endcomment %}
<meta name="title" content="Kyle Sin Lynn | Software Developer">
<meta name="description" content="Kyle Sin Lynn, a dedicated software engineer, excels in Python and Django. Committed to innovation, problem-solving, and collaborative success.">
<meta name="keywords" content="kylesinlynn, Kyle Sin Lynn">
<meta name="robots" content="index, follow">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="language" content="English">
<meta name="revisit-after" content="1 days">
<meta name="author" content="Kyle Sin Lynn">

<title>
{% block title %}Kyle Sin Lynn | Software Developer{% endblock title %}
</title>

{% comment %} HTMX {% endcomment %}
<script src="{% static 'js/htmx.min.js' %}"></script>
</head>
<body>
<header>

</header>
<main>
{% block main %}
<h1>Portfolio Main</h1>
{% endblock main %}
</main>
<footer>

</footer>
</body>
</html>

0 comments on commit ddcb9e2

Please sign in to comment.