Skip to content

Commit

Permalink
Fixing djlintrc to be JSON and adding base template to test HTML linter
Browse files Browse the repository at this point in the history
  • Loading branch information
maxgrove42 committed Oct 3, 2024
1 parent 074e6e1 commit 99a0e02
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 31 deletions.
39 changes: 8 additions & 31 deletions .djlintrc
Original file line number Diff line number Diff line change
@@ -1,31 +1,8 @@
[djlint]

# Directories or files to ignore during linting (optional)

exclude = node_modules, venv, static

# Maximum line length for the linter to respect

line-length = 88

# List of linting rules to ignore

ignore = no-self-closing-tags, prefer-double-quotes

# List of linting rules to enforce strictly

require = require-doctype-first, prefer-compact-if

# Enable or disable linting for various template types

jinja = true
django = true
html = true

# Use indentation settings

indent = 4

# Autofix linting issues on save

autofix = true
{
"exclude": "node_modules,venv,static",
"line-length": "88",
"ignore": "no-self-closing-tags,prefer-double-quotes",
"require": "require-doctype-first,prefer-compact-if",
"profile": "django",
"indent": "4"
}
48 changes: 48 additions & 0 deletions src/templates/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="This is Team 5's Django project, showcasing our awesome web application." />
<meta name="keywords" content="Django, Team 5, Web Development, Project, 2024" />
<title>{% block title %}My Django Project{% endblock title %}</title>
<!--Tachyons-->
<link
rel="stylesheet"
href="https://unpkg.com/[email protected]/css/tachyons.min.css"
/>
<!--Tachyons-->
<style>
html, body {
height: 100%;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}
</style>
{% block extra_head %}
<!-- Additional CSS or JS can be inserted by child templates -->
{% endblock extra_head %}
</head>
<body class="bg-near-white flex flex-column dark-gray">
<header class="pa1 pl2 bg-light-blue shadow-4">
<div class="flex items-center">
<h1 class="f2 tracked-tight">
Team 5's Django Project
</h1>
</div>
</header>

<main class="pa3 flex-grow-1">
{% block content %}
<!-- Default content, if not overridden -->
{% endblock block %}
</main>

<footer class="pa1 f4 pl2 bg-lightest-blue mt4">
<p>Made by Team 5 in 2024</p>
</footer>

{% block extra_js %}
<!-- Additional JS can be inserted by child templates -->
{% endblock extra_js %}
</body>
</html>

0 comments on commit 99a0e02

Please sign in to comment.