Add archive layout and abstract syntax headers
authorDylan Lloyd <dylan@disinclined.org>
Fri, 10 Feb 2023 23:39:15 +0000 (18:39 -0500)
committerDylan Lloyd <dylan@disinclined.org>
Fri, 10 Feb 2023 23:39:15 +0000 (18:39 -0500)
_includes/head.html
_includes/highlighter.html [new file with mode: 0644]
_includes/note.html [new file with mode: 0644]
_layouts/archive.html [new file with mode: 0644]
_layouts/note.html
notes/index.html

index 665b921..e98f611 100644 (file)
@@ -4,7 +4,7 @@
   <meta property='og:url' content='{{ site.url }}'>
 
   <title>{{ site.title }}</title>
-  <link rel="icon" href="/favicon.ico" type="image/png">
+  <link rel="icon" href="/assets/favicon.ico" type="image/png">
   <link href='/main.css' rel='stylesheet' type='text/css'>
   <script src='/assets/index.js'></script>
 </head>
diff --git a/_includes/highlighter.html b/_includes/highlighter.html
new file mode 100644 (file)
index 0000000..9e28a18
--- /dev/null
@@ -0,0 +1,17 @@
+<link type='text/css' rel='stylesheet' href='/assets/syntax/styles/shCore.css'>
+<link type='text/css' rel='stylesheet' href='/assets/syntax/styles/shThemeDefault.css'>
+<script type='text/javascript' src='/assets/syntax/scripts/shCore.js'></script>
+<script type='text/javascript' src='/assets/syntax/scripts/shAutoloader.js'></script>
+<script type='text/javascript'>
+  function highlight() {
+    SyntaxHighlighter.autoloader(
+     'js /assets/syntax/scripts/shBrushJScript.js',
+     'bash /assets/syntax/scripts/shBrushBash.js',
+     'sql /assets/syntax/scripts/shBrushSql.js',
+     'cpp /assets/syntax/scripts/shBrushCpp.js');
+    SyntaxHighlighter.defaults['gutter'] = false;
+    SyntaxHighlighter.defaults['toolbar'] = false;
+    SyntaxHighlighter.all();
+  }
+</script>
+
diff --git a/_includes/note.html b/_includes/note.html
new file mode 100644 (file)
index 0000000..193381b
--- /dev/null
@@ -0,0 +1,19 @@
+<article class="note">
+  <div class="note-content">
+    <div class="page-title">
+      {% if page.date %}
+      <span class='page-date'>
+          {{ page.date | date: '%Y-%m-%d' }}
+      </span> /
+      {% endif %}
+      <span class='page-title'>
+          <a href="{{ page.url }}">
+      {{ page.title }}
+          </a>
+      </span>
+    </div>
+    <div class='page-content'>
+        {{ content }}
+    </div>
+  </div>
+</article>
diff --git a/_layouts/archive.html b/_layouts/archive.html
new file mode 100644 (file)
index 0000000..51db00a
--- /dev/null
@@ -0,0 +1,25 @@
+---
+layout: default
+---
+
+{% include highlighter.html %}
+
+<ul class="posts">
+    {% for page in page.posts %}
+        <article class="note">
+          <div class="note-content">
+              <div class="page-title">
+                <span class='page-date'>
+                    {{ page.date | date: '%Y-%m-%d' }}
+                </span> /
+                <span class='page-title'>
+                    <a href="{{ page.url }}">
+                {{ page.title }}
+                    </a>
+                </span>
+              </div>
+            {{ page.content }}
+          </div>
+        </article>
+    {% endfor %}
+</ul>
index 0e3c844..0f13155 100644 (file)
@@ -2,22 +2,6 @@
 layout: default
 ---
 
-<article class="note">
-  <div class="note-content">
-    <div class="page-title">
-      {% if page.date %}
-      <span class='page-date'>
-          {{ page.date | date: '%Y-%m-%d' }}
-      </span> /
-      {% endif %}
-      <span class='page-title'>
-          <a href="{{ page.url }}">
-      {{ page.title }}
-          </a>
-      </span>
-    </div>
-    <div class='page-content'>
-        {{ content }}
-    </div>
-  </div>
-</article>
+{% include highlighter.html %}
+
+{% include note.html %}
index 53de769..fe2df6b 100644 (file)
@@ -2,23 +2,6 @@
 layout: note
 ---
 
-<link type='text/css' rel='stylesheet' href='/assets/syntax/styles/shCore.css'>
-<link type='text/css' rel='stylesheet' href='/assets/syntax/styles/shThemeDefault.css'>
-<script type='text/javascript' src='/assets/syntax/scripts/shCore.js'></script>
-<script type='text/javascript' src='/assets/syntax/scripts/shAutoloader.js'></script>
-<script type='text/javascript'>
-  function highlight() {
-    SyntaxHighlighter.autoloader(
-     'js /assets/syntax/scripts/shBrushJScript.js',
-     'bash /assets/syntax/scripts/shBrushBash.js',
-     'sql /assets/syntax/scripts/shBrushSql.js',
-     'cpp /assets/syntax/scripts/shBrushCpp.js');
-    SyntaxHighlighter.defaults['gutter'] = false;
-    SyntaxHighlighter.defaults['toolbar'] = false;
-    SyntaxHighlighter.all();
-  }
-</script>
-
 {% for page in paginator.posts %}
     <article class="note">
       <div class="note-content">
@@ -42,6 +25,7 @@ layout: note
     previous
 </a>
 {% endif %}
+
 {% if paginator.next_page_path %}
 <div class="pagination">
 <a href="{{ paginator.next_page_path }}">