Bläddra i källkod

Remove dead code in PAGE-URL.

We partially support 'pretty URLs'. They can be achieved by setting
:page-ext in the *config* to "/" and configuring the web server to
ignore html extensions.
Brit Butler 11 år sedan
förälder
incheckning
3ee8f43325
7 ändrade filer med 19 tillägg och 22 borttagningar
  1. 2 5
      src/coleslaw.lisp
  2. 1 1
      themes/atom.tmpl
  3. 5 5
      themes/hyde/index.tmpl
  4. 3 3
      themes/hyde/post.tmpl
  5. 3 3
      themes/readable/index.tmpl
  6. 3 3
      themes/readable/post.tmpl
  7. 2 2
      themes/rss.tmpl

+ 2 - 5
src/coleslaw.lisp

@@ -16,13 +16,10 @@
16 16
   (:documentation "The url to the object, without the domain."))
17 17
 
18 18
 (defmethod page-url :around ((object t))
19
-  (let ((result (call-next-method))
20
-        (extension (if (string= (page-ext *config*) "/")
21
-                       "html"
22
-                       (page-ext *config*))))
19
+  (let ((result (call-next-method)))
23 20
     (if (pathname-type result)
24 21
         result
25
-        (make-pathname :type extension :defaults result))))
22
+        (make-pathname :type (page-ext *config*) :defaults result))))
26 23
 
27 24
 (defun page-path (object)
28 25
   "The path to store OBJECT at once rendered."

+ 1 - 1
themes/atom.tmpl

@@ -14,7 +14,7 @@
14 14
 
15 15
   {foreach $post in $content.posts}
16 16
   <entry>
17
-    <link type="text/html" rel="alternate" href="{$config.domain}/posts/{$post.slug}.html"/>
17
+    <link type="text/html" rel="alternate" href="{$config.domain}/posts/{$post.slug}{$config.pageExt}"/>
18 18
     <title>{$post.title}</title>
19 19
     <published>{$post.date}</published>
20 20
     <updated>{$post.date}</updated>

+ 5 - 5
themes/hyde/index.tmpl

@@ -4,20 +4,20 @@
4 4
 <h1 class="title">{$index.title}</h1>
5 5
 {foreach $post in $index.posts}
6 6
   <div class="article-meta">
7
-    <a class="article-title" href="{$config.domain}/posts/{$post.slug}.html">{$post.title}</a>
7
+    <a class="article-title" href="{$config.domain}/posts/{$post.slug}{$config.pageExt}">{$post.title}</a>
8 8
     <div class="date"> posted on {$post.date}</div>
9 9
     <div class="article">{$post.text |noAutoescape}</div>
10 10
   </div>
11 11
 {/foreach}
12 12
 <div id="relative-nav">
13
-  {if $prev} <a href="{$prev}.html">Previous</a> {/if}
14
-  {if $next} <a href="{$next}.html">Next</a> {/if}
13
+  {if $prev} <a href="{$prev}{$config.pageExt}">Previous</a> {/if}
14
+  {if $next} <a href="{$next}{$config.pageExt}">Next</a> {/if}
15 15
 </div>
16 16
 {if $tags}
17 17
 <div id="tagsoup">
18 18
   <p>This blog covers
19 19
     {foreach $tag in $tags}
20
-      <a href="{$config.domain}/tag/{$tag.slug}.html">{$tag.name}</a>{nil}
20
+      <a href="{$config.domain}/tag/{$tag.slug}{$config.pageExt}">{$tag.name}</a>{nil}
21 21
       {if not isLast($tag)},{sp}{/if}
22 22
     {/foreach}
23 23
 </div>
@@ -26,7 +26,7 @@
26 26
 <div id="monthsoup">
27 27
   <p>View posts from
28 28
     {foreach $month in $months}
29
-      <a href="{$config.domain}/date/{$month}.html">{$month}</a>{nil}
29
+      <a href="{$config.domain}/date/{$month}{$config.pageExt}">{$month}</a>{nil}
30 30
       {if not isLast($month)},{sp}{/if}
31 31
     {/foreach}
32 32
 </div>

+ 3 - 3
themes/hyde/post.tmpl

@@ -5,7 +5,7 @@
5 5
   <h1 class="title">{$post.title}</h1>{\n}
6 6
   <div class="tags">{\n}
7 7
     Tagged as {foreach $tag in $post.tags}
8
-                <a href="../tag/{$tag.slug}.html">{$tag.name}</a>{nil}
8
+                <a href="../tag/{$tag.slug}{$config.pageExt}">{$tag.name}</a>{nil}
9 9
                     {if not isLast($tag)},{sp}{/if}
10 10
               {/foreach}
11 11
   </div>{\n}
@@ -17,7 +17,7 @@
17 17
   {$post.text |noAutoescape}
18 18
 </div>{\n}
19 19
 <div class="relative-nav">{\n}
20
-  {if $prev} <a href="{$config.domain}/posts/{$prev.slug}.html">Previous</a><br> {/if}{\n}
21
-  {if $next} <a href="{$config.domain}/posts/{$next.slug}.html">Next</a><br> {/if}{\n}
20
+  {if $prev} <a href="{$config.domain}/posts/{$prev.slug}{$config.pageExt}">Previous</a><br> {/if}{\n}
21
+  {if $next} <a href="{$config.domain}/posts/{$next.slug}{$config.pageExt}">Next</a><br> {/if}{\n}
22 22
 </div>{\n}
23 23
 {/template}

+ 3 - 3
themes/readable/index.tmpl

@@ -4,7 +4,7 @@
4 4
 <h1 class="page-header">{$index.title}</h1>
5 5
 {foreach $post in $index.posts}
6 6
   <div class="row-fluid">
7
-    <h1><a href="{$config.domain}/posts/{$post.slug}.html">{$post.title}</a></h1>
7
+    <h1><a href="{$config.domain}/posts/{$post.slug}{$config.pageExt}">{$post.title}</a></h1>
8 8
     <p class="date-posted">posted on {$post.date}</p>
9 9
     {$post.text |noAutoescape}
10 10
   </div>
@@ -13,7 +13,7 @@
13 13
 <div class="row-fluid">
14 14
   <p>This blog covers
15 15
     {foreach $tag in $tags}
16
-      <a href="{$config.domain}/tag/{$tag.slug}.html">{$tag.name}</a>{nil}
16
+      <a href="{$config.domain}/tag/{$tag.slug}{$config.pageExt}">{$tag.name}</a>{nil}
17 17
       {if not isLast($tag)},{sp}{/if}
18 18
     {/foreach}
19 19
   </p>
@@ -23,7 +23,7 @@
23 23
 <div class="row-fluid">
24 24
   <p>View posts from
25 25
     {foreach $month in $months}
26
-      <a href="{$config.domain}/date/{$month}.html">{$month}</a>{nil}
26
+      <a href="{$config.domain}/date/{$month}{$config.pageExt}">{$month}</a>{nil}
27 27
       {if not isLast($month)},{sp}{/if}
28 28
     {/foreach}
29 29
   </p>

+ 3 - 3
themes/readable/post.tmpl

@@ -5,7 +5,7 @@
5 5
   <h1 class="page-header">{$post.title}</h1>{\n}
6 6
   <p>Tagged as 
7 7
     {foreach $tag in $post.tags}
8
-      <a href="../tag/{$tag.slug}.html">{$tag.name}</a>{nil}
8
+      <a href="../tag/{$tag.slug}{$config.pageExt}">{$tag.name}</a>{nil}
9 9
       {if not isLast($tag)},{sp}{/if}
10 10
     {/foreach}
11 11
   </p>
@@ -14,8 +14,8 @@
14 14
   {$post.text |noAutoescape}
15 15
   
16 16
   <ul class="pager">
17
-    {if $prev}<li class="previous"><a href="{$config.domain}/posts/{$prev.slug}.html">&larr; Previous</a></li>{/if}{\n}
18
-    {if $next}<li class="next"><a href="{$config.domain}/posts/{$next.slug}.html">Next &rarr;</a></li>{/if}{\n}
17
+    {if $prev}<li class="previous"><a href="{$config.domain}/posts/{$prev.slug}{$config.pageExt}">&larr; Previous</a></li>{/if}{\n}
18
+    {if $next}<li class="next"><a href="{$config.domain}/posts/{$next.slug}{$config.pageExt}">Next &rarr;</a></li>{/if}{\n}
19 19
   </ul>
20 20
 </div>{\n}
21 21
 {/template}

+ 2 - 2
themes/rss.tmpl

@@ -13,10 +13,10 @@
13 13
     {foreach $post in $content.posts}
14 14
     <item>
15 15
       <title>{$post.title}</title>
16
-      <link>{$config.domain}/posts/{$post.slug}.html</link>
16
+      <link>{$config.domain}/posts/{$post.slug}{$config.pageExt}</link>
17 17
       <pubDate>{$post.date}</pubDate>
18 18
       <author>{$config.author}</author>
19
-      <guid isPermaLink="true">{$config.domain}/posts/{$post.slug}.html</guid>
19
+      <guid isPermaLink="true">{$config.domain}/posts/{$post.slug}{$config.pageExt}</guid>
20 20
       {foreach $tag in $post.tags}
21 21
         <category><![CDATA[ {$tag} ]]></category>
22 22
       {/foreach}