Skip to content

Commit

Permalink
👌 IMPROVE: Updated templates to work with new local build
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdevore committed Oct 25, 2024
1 parent a227d99 commit a4607f1
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
27 changes: 15 additions & 12 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@
<meta name="keywords" content="{% if seo_keywords %}{{ seo_keywords }}{% else %}SSG, Static Site Generator{% endif %}">
<meta name="author" content="{% if author %}{{ author }}{% else %}Robert DeVore{% endif %}">

<link href="/assets/css/tailwind.min.css" rel="stylesheet preload" as="style">
<!-- Use relative_path to correctly reference assets -->
<link href="{{ relative_path }}assets/css/tailwind.min.css" rel="stylesheet preload" as="style">
{% if minify %}
<link href="/assets/css/main.min.css" rel="stylesheet preload" as="style">
<link href="{{ relative_path }}assets/css/main.min.css" rel="stylesheet preload" as="style">
{% else %}
<link href="/assets/css/style.css" rel="stylesheet preload" as="style">
<link href="/assets/css/fonts.css" rel="stylesheet preload" as="style">
<link href="{{ relative_path }}assets/css/style.css" rel="stylesheet preload" as="style">
<link href="{{ relative_path }}assets/css/fonts.css" rel="stylesheet preload" as="style">
{% endif %}

<!-- Alpine.js for interactive components -->
<script src="/assets/js/alpine.min.js" defer></script>
<script src="{{ relative_path }}assets/js/alpine.min.js" defer></script>
</head>
<body class="bg-background text-primary quicksand-300">

Expand All @@ -29,15 +30,17 @@

<header class="bg-background shadow" id="navigation">
<div class="container max-w-screen-xl m-auto py-6 px-4 flex justify-between">
<h2 class="text-3xl font-bold quicksand-700"><a href="/" class="text-links">Stattic</a></h2>

<!-- Navigation Menu -->
<!-- Home link using relative_path -->
<h2 class="text-3xl font-bold quicksand-700"><a href="{{ relative_path }}index.html" class="text-links">Stattic</a></h2>
<nav>
<ul class="flex space-x-6">
{% for page in pages %}
<li>
<a href="{{ page.permalink }}" class="text-primary hover:underline quicksand-700">{{ page.title }}</a>
</li>
{% if page.nav_hide != 'true' %}
<li>
<!-- Internal links using relative_path and permalink -->
<a href="{{ relative_path }}{{ page.permalink.strip('/') }}/index.html" class="text-primary hover:underline quicksand-700">{{ page.title }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
</nav>
Expand All @@ -55,4 +58,4 @@ <h2 class="text-3xl font-bold quicksand-700"><a href="/" class="text-links">Stat
</footer>

</body>
</html>
</html>
2 changes: 1 addition & 1 deletion templates/category.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ <h1 class="text-3xl font-bold mb-4 quicksand-700">Posts in "{{ category }}"</h1>
{% for post in posts %}
<li>
<h3 class="text-4xl font-bold quicksand-700">
<a href="{{ post.permalink }}" class="text-links hover:underline">{{ post.title }}</a>
<a href="{{ relative_path }}{{ post.permalink }}index.html" class="text-links hover:underline">{{ post.title }}</a>
</h3>
<p class=" dark:text-gray-400">{{ post.excerpt | markdown }}</p>
</li>
Expand Down
5 changes: 3 additions & 2 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
{% for post in posts %}
<li>
<h2 class="text-4xl font-bold quicksand-700">
<a href="{{ post.permalink }}" class="text-links hover:underline">{{ post.title }}</a>
<!-- Updated href to point to index.html within the post directory -->
<a href="{{ relative_path }}{{ post.permalink }}index.html" class="text-links hover:underline">{{ post.title }}</a>
</h2>
<div class="dark:text-gray-400">{{ post.excerpt | safe }}</div>
</li>
{% endfor %}
</ul>
</main><!-- #main-content -->
{% endblock %}
{% endblock %}
2 changes: 1 addition & 1 deletion templates/tag.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ <h1 class="text-3xl font-bold mb-4 quicksand-700">Posts tagged with "{{ tag }}"<
{% for post in posts %}
<li>
<h3 class="text-4xl font-bold quicksand-700">
<a href="{{ post.permalink }}" class="text-links hover:underline">{{ post.title }}</a>
<a href="{{ relative_path }}{{ post.permalink }}index.html" class="text-links hover:underline">{{ post.title }}</a>
</h3>
<p class=" dark:text-gray-400">{{ post.excerpt | markdown }}</p>
</li>
Expand Down

0 comments on commit a4607f1

Please sign in to comment.