]> git.quilime.com - quilime.com.git/commitdiff
Working out pagination
authorGabriel Dunne <gdunne@quilime.com>
Fri, 16 Jun 2023 19:14:31 +0000 (12:14 -0700)
committerGabriel Dunne <gdunne@quilime.com>
Fri, 16 Jun 2023 19:14:31 +0000 (12:14 -0700)
20 files changed:
_config.yml
_includes/nav.html
_layouts/default.html
_layouts/index.html
_layouts/post.html
_posts/2007-12-12-mel-notepad.md
_posts/2011-05-24-clmpr.md
_posts/2011-07-07-bootable_iso.md
_posts/2011-08-11-terminal_emulator_on_win.md
_posts/2011-09-19-mostused.md
_posts/2011-11-09-osx_command_line_audio.md
_posts/2011-11-14-osx_print_json.md
_posts/2012-01-02-archlinux_install.md
_posts/2013-09-16-gen_semitones.md
about.md [new file with mode: 0644]
archive-c.html [deleted file]
archive-d.html [deleted file]
archive-i.html [deleted file]
css/style.css
index.html

index a324396b197ea6fd8c034bcd872a9e72358e1f61..bd950ee569593874d76c1fedf2e1fd8e728fbd2e 100644 (file)
 title: quilime.com
 baseurl: "" # the subpath of your site, e.g. /blog
 url: "https://quilime.com" # the base hostname & protocol for your site, e.g. http://example.com
+excerpt_separator: "<!--more-->"
 permalink: /:categories/:title:output_ext
 # Build settings
 plugins:
   - jekyll-feed
   - jekyll-paginate
-
-paginate: 5
-
+paginate: 10
+paginate_path: "/page:num/"
 defaults:
   -
     scope:
index 5cb181118d0706f07984e76e53b9da16c180e332..a5cda5ff2b4138eea56020a813c35c63d0d7be03 100644 (file)
@@ -1,36 +1,34 @@
-<div class="nav" id="nav">
-  <ul>
-    <li><h4 style="margin-top:0;" class="header"><a href="{{site.url}}/">{{site.name}}</a></h4></li>
-    <li><a href="{{ site.url }}/about/">about</a></li>
-    <li><a href="{{ site.url }}/posts/">all posts</a></li>
+<ul>
+  <li><h4 style="margin-top:0;" class="header"><a href="{{site.url}}/">{{site.name}}</a></h4></li>
+  <li><a href="{{ site.url }}/about/">about</a></li>
+  <li><a href="{{ site.url }}/posts/">all posts</a></li>
 
-    <li>&nbsp;</li>
-    <li><h4 class="header"><a href="/featured/">featured</a></h4></li>
-    {% for post in site.categories.featured %}
-      <li class="indent"><a href="{{ site.url }}{{ post.url }}">{{ post.title }}</a></li>
-    {% endfor %}
+  <li>&nbsp;</li>
+  <li><h4 class="header"><a href="/featured/">featured</a></h4></li>
+  {% for post in site.categories.featured %}
+    <li class="indent"><a href="{{ site.url }}{{ post.url }}">{{ post.title }}</a></li>
+  {% endfor %}
 
-    <li>&nbsp;</li>
-    <li><h4 class="header"><a href="/works/">works</a></h4></li>
-    {% for post in site.categories.works %}
-      <li class="indent"><a href="{{ site.url }}{{ post.url }}">{{ post.title }}</a></li>
-    {% endfor %}
+  <li>&nbsp;</li>
+  <li><h4 class="header"><a href="/works/">works</a></h4></li>
+  {% for post in site.categories.works %}
+    <li class="indent"><a href="{{ site.url }}{{ post.url }}">{{ post.title }}</a></li>
+  {% endfor %}
 
-    <li>&nbsp;</li>
-    <li><h4 class="header"><a href="/performance/">performance</a></h4></li>
-    {% for post in site.categories.performance %}
-      <li class="indent"><a href="{{ site.url }}{{ post.url }}">{{ post.title }}</a></li>
-    {% endfor %}
+  <li>&nbsp;</li>
+  <li><h4 class="header"><a href="/performance/">performance</a></h4></li>
+  {% for post in site.categories.performance %}
+    <li class="indent"><a href="{{ site.url }}{{ post.url }}">{{ post.title }}</a></li>
+  {% endfor %}
 
-    <li>&nbsp;</li>
-    <li><h4 class="header"><a href="/projects/">projects</a></h4></li>
-    {% for post in site.categories.projects %}
-      <li class="indent"><a href="{{ site.url }}{{ post.url }}">{{ post.title }}</a></li>
-    {% endfor %}
+  <li>&nbsp;</li>
+  <li><h4 class="header"><a href="/projects/">projects</a></h4></li>
+  {% for post in site.categories.projects %}
+    <li class="indent"><a href="{{ site.url }}{{ post.url }}">{{ post.title }}</a></li>
+  {% endfor %}
 
-    <li>&nbsp;</li>
-    <li><a href="{{ site.url }}/notes/">notes</a></li>
-    <li><a href="{{ site.url }}/archive-d/">archive</a></li>
-    <li><a href="{{ site.url }}/feed.xml">rss</a></li>
-  </ul>
-</div>
\ No newline at end of file
+  <li>&nbsp;</li>
+  <li><a href="{{ site.url }}/notes/">notes</a></li>
+  <li><a href="{{ site.url }}/archive-d/">archive</a></li>
+  <li><a href="{{ site.url }}/feed.xml">rss</a></li>
+</ul>
index a046bfd519712ef5eccdab2c361462092b3b3035..c5af47215f697248f036ed70335fabf89592927c 100644 (file)
@@ -1,29 +1,23 @@
-<!doctype html>
-<html>
-  <head>
-    <meta charset="utf-8">
+---
+layout: index
+---
 
-    <title>{{ page.title }}</title>
+<div class="entry">
 
-    <link rel="stylesheet" href="/css/style.css" type="text/css">
-    <meta name="viewport" content="width=device-width, initial-scale=1" />
+  <h1>— {{ page.title }}</h1>
 
-    <!-- prettify -->
-    <script type="text/javascript" src="/js/prettify/prettify.js"></script>
-    <link href="/js/prettify/prettify.css" type="text/css" rel="stylesheet" />
-    <script>window.onload = () => { prettyPrint() }</script>
+  <div>
+  {{content}}
+  </div>
 
-  </head>
-  <body>
+{% if page.tags %}
+  <ul>
+    {% for tag in page.tags %}
+      <li>{{ tag }}</li>
+    {% endfor %}
+  </ul>
+{% endif %}
 
-    <nav id="nav">
-      <a href="/">home</a>
-      <a href="/archive-c">archive-c</a>
-    </nav>
+  <h5>posted {{ page.date }}</h5>
 
-    <div id="content">
-      {{ content }}
-    <div>
-
-  </body>
-</html>
\ No newline at end of file
+</div>
\ No newline at end of file
index a79b7dd596301f3a88abdbe7eafc427c055f9a22..5ee389a53de0ececdf02d0a2258c28760b7b33a1 100644 (file)
@@ -1,34 +1,33 @@
----
-layout: default
----
-
-
-<!-- This loops through the paginated posts -->
-{% for post in paginator.posts %}
-<div class="entry">
-  <h1><a href="{{ post.url }}">— {{ post.title }}</a></h1>
-  <div class="content">
-    {{ post.content }}
-  </div>
-</div>
-{% endfor %}
-
-
-<!-- Pagination links -->
-<div class="pagination">
-  {% if paginator.previous_page %}
-    <a href="{{ paginator.previous_page_path }}" class="previous">
-      Previous
-    </a>
-  {% else %}
-    <span class="previous">Previous</span>
-  {% endif %}
-  <span class="page_number ">
-    Page: {{ paginator.page }} of {{ paginator.total_pages }}
-  </span>
-  {% if paginator.next_page %}
-    <a href="{{ paginator.next_page_path }}" class="next">Next</a>
-  {% else %}
-    <span class="next ">Next</span>
-  {% endif %}
-</div>
+<!doctype html>
+<html>
+  <head>
+    <meta charset="utf-8">
+
+    <title>{{ page.title }}</title>
+
+    <link rel="stylesheet" href="/css/style.css" type="text/css">
+    <meta name="viewport" content="width=device-width, initial-scale=1" />
+
+    <!-- prettify -->
+    <script type="text/javascript" src="/js/prettify/prettify.js"></script>
+    <link href="/js/prettify/prettify.css" type="text/css" rel="stylesheet" />
+    <script>window.onload = () => { prettyPrint() }</script>
+
+  </head>
+  <body>
+
+    <div id="nav">
+        <ul>
+          <li><a href="{{site.url}}/">home</a></li>
+          <li><a href="{{ site.url }}/about/">about</a></li>
+          <li><a href="{{ site.url }}/feed.xml">rss</a></li>
+        </ul>
+
+    </div>
+
+    <div id="content">
+      {{ content }}
+    <div>
+
+  </body>
+</html>
\ No newline at end of file
index 46d5747c19ccbc66440616763176b1c388147a2a..5e7112684af455284afbddb3a0b289ee21b8db69 100644 (file)
@@ -2,19 +2,4 @@
 layout: default
 ---
 
-<div class="entry">
-
-  <h1>— {{ page.title }}</h1>
-
-  <div>
-  {{content}}
-  </div>
-
-  tags
-  <ul>
-    {% for tag in page.tags %}
-      <li>{{ tag }}</li>
-    {% endfor %}
-  </ul>
-
-</div>
\ No newline at end of file
+{{ content }}
index 4d4ba7726ff50ed2f5a7374ca5003f3882eab43a..0c2bb387fb0afcad3ea5a3930e476769510a3aac 100644 (file)
@@ -2,7 +2,6 @@
 date: 2007-12-12
 title: MEL Notepad
 tags: mel maya
-layout: post
 ---
 
 mel notepad with various code snippets
index 22423c0f1d2e6268d20853640e0e7991cef1e16f..bb35862c94bbfd8d1c08cd6fd8dd4d591be80b26 100644 (file)
@@ -11,4 +11,4 @@ clmpr (clumper) is an open-source multi-user bookmarking engine, inspired by the
 demo: <a href="http://clmpr.com">clmpr.com</a>  \r
 source: <a href="http://github.com/quilime/clmpr">http://github.com/quilime/clmpr</a>\r
 \r
-<img src="http://media.quilime.com/files/img/clmpr.png" />
\ No newline at end of file
+<img src="http://media.quilime.com/files-bak/img/clmpr.png" />\r
index 43df631f6d5bfe883ec49e4633e24decd5eaf9ca..8c39372c5890e32335319b60c180ed2b376028e3 100644 (file)
@@ -22,3 +22,4 @@ Bonus tip! You want to see how far the `dd` copy is coming along? Run in another
 <code class="prettyprint">$  sudo killall -INFO dd</code><br />
 The process info will display in the original terminal.
 
+<!--more-->
\ No newline at end of file
index c2ebb944a9c9c07bbe036e8276b8390e128ba4c9..8ae877721668f31d5546547c8c9e1cff27050310 100644 (file)
@@ -13,7 +13,6 @@ How to install cygwin on windows:
     - xorg-docs (optional, man pages)
     - X-start-menu-icons (optional, adds shortcuts to X Clients and Server to the Start menu)
     - mintty (windows-feel terminal)
-  <br />
 
 3. **Optional Packages**
     - openssh
@@ -23,7 +22,6 @@ How to install cygwin on windows:
     - vim, emacs
     - any additional fonts
 
-    <br />
 
 <!--more-->
 
index 4aa85750c32b62fd9c8325f1111b2517ea10d305..2ff168de1299ad6dd0fe2743b8827ce1ed7c911b 100644 (file)
@@ -5,6 +5,8 @@ layout: post
 ---
 `history | awk {'print $2'} | sort | uniq -c | sort -k1 -rn | head`
 
+<!--more-->
+
 example
 ```prettyprint
 // brand new netbook
index dc52a6252ec6af2ee5b263f46554419033cfefdb..adaeb9b20726441ad95bbe7ed1b91100145b4344 100644 (file)
@@ -11,6 +11,8 @@ Install sox by either downloading the OSX binary from <a href="http://sox.source
 or
 install <a href="http://mxcl.github.com/homebrew/">homebrew</a>, and then install sox with <code class="prettyprint">brew install sox</code>
 
+<!--more-->
+
 ##Examples
 
 cat audio from /dev/urandom/ :
index b40c762654bc0777b3306aa18ab12df9f8d12dae..a24625f236a57a886cfcd002e26d03aac23f3814 100644 (file)
@@ -7,6 +7,8 @@ layout: post
 
 Working with various interfaces that output json or xml results in lots of situations where you have a single-line, unformatted output. Here's a quick way to format json, xml from the CLI.
 
+<!--more-->
+
 via the command line:
 
 format json
index 4230e2b71d8a5564e91aeb94b9096f1c66e7cb51..4045acb8692d758f4e9d7bdce85dc39a177442d6 100644 (file)
@@ -7,6 +7,8 @@ layout: post
 
 Documentation of the process of installing [archlinux](http://www.archlinux.org/) and Windows 7 in a dual-boot configuration.
 
+<!--more-->
+
 ## System Specs
 
 - AMD X2 dual-core processor, running at 2.8 ghz, circa 2002
index 7356edb0296eadff4f429d280264600a76580c92..6a4cda0d525e7276db4c504f2bc206c425b0f83f 100644 (file)
@@ -3,8 +3,7 @@ title: Generate Semitones
 date: 2013-09-16
 ---
 
-<pre class="code prettyprint">
-
+```prettyprint
 #!/bin/perl
 my $m = 2 ** (1/12);
 foreach my $s (0..12) {
@@ -26,6 +25,8 @@ semitone - fine
 10 - 782 
 11 - 888 
 12 - 1000
-</pre>
+```
+
+[gist](https://gist.github.com/quilime/59fc3af7c5f30ca2399f#file-semitones-pl)  
+
 
-[gist](https://gist.github.com/quilime/59fc3af7c5f30ca2399f#file-semitones-pl)  
\ No newline at end of file
diff --git a/about.md b/about.md
new file mode 100644 (file)
index 0000000..62619a0
--- /dev/null
+++ b/about.md
@@ -0,0 +1,7 @@
+---
+title: about
+---
+
+quilime.com is a collection of code, experiments, and process
+
+© 1999—{{ "now" | date: "%Y" }} [~gld](https://gabrieldunne.com)
diff --git a/archive-c.html b/archive-c.html
deleted file mode 100644 (file)
index c45ad61..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
----
-layout: default
-title: archive
----
-
-{% include archive-sort.html %}
-
-<div class="posts">
-  <!-- {% for category in site.categories %} -->
-    <h2 class="date">{{ category | first }}</h2>
-    <ul class="posts">
-      <!-- {% for posts in category %} -->
-        {% for post in posts %}
-          <li><h2><a href="{{ site.url }}{{ post.url }}">{{ post.title }}</a></h2></li>
-        {% endfor %}
-      <!-- {% endfor %} -->
-    </ul>
-  <!-- {% endfor %} -->
-</div>
diff --git a/archive-d.html b/archive-d.html
deleted file mode 100644 (file)
index 8ba81e9..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
----
-layout: default
-title: archive
----
-
-{% include archive-sort.html %}
-
-<ul class="posts">
-  {% for post in site.posts %}
-    {% capture day %}{{ post.date | date: '%Y' }}{% endcapture %}
-    {% capture nday %}{{ post.next.date | date: '%Y' }}{% endcapture %}
-    {% if day != nday %}
-    <h2 class="date">{{ post.date | date: "%Y" }}</h2>
-    {% endif %}
-    <li>
-      <h2><a href="{{ site.url }}{{ post.url }}">{{ post.title }}</a></h2>
-    </li>
-  {% endfor %}
-  <h2 class="date">∞</h2>
-  <li>
-    <h2><a href="/past/">PAST WORK</a></h2>
-  </li>
-</ul>
diff --git a/archive-i.html b/archive-i.html
deleted file mode 100644 (file)
index 2bea528..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
----
-layout: default
-title: archive
----
-
-{% include archive-sort.html %}
-
-<ul class="thumbs">
-  {% for post in site.posts %}
-    {% capture day %}{{ post.date | date: '%Y' }}{% endcapture %}
-    {% capture nday %}{{ post.next.date | date: '%Y' }}{% endcapture %}
-    <li>
-    <a href="{{ site.url }}{{ post.url }}">
-      <span class="img"><img src="{{ post.thumb }}" /></span>
-    </a>
-    </li>    
-  {% endfor %}  
-  <li>
-  <a href="/past/">
-    <span class="img"><img src="{{ post.thumb }}" /></span>
-  </a>
-  </li>
-</ul>  
index 953c65b2f2e40dafd0fbeee65858bfaf5a153ee1..9e1b7b846d234ea0eacc400c51cadd386d219ed1 100644 (file)
@@ -8,11 +8,10 @@ body, table {
     font-size:14px;
     line-height:1.4em;
 }
-
 body {
     background: var(--bg-color);
     padding:0;
-    margin:4em;
+    margin:2em;
     color: #ddd;
 }
 a {
@@ -52,6 +51,10 @@ h1 a {
 }
 h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover {
 }
+h5 {
+    font-size:12px;
+    font-weight: normal
+}
 
 
 ul, li {
@@ -98,21 +101,52 @@ table, td, tr {
 }
 
 #content {
-  padding-left: 160px;
-  margin-top:20px;
-  padding-bottom: 20px;
+    position: absolute;
+    z-index: -1;
+    top:2em;
+    padding-left: 160px;
+    padding-bottom: 20px;
 }
 #content.single {
     padding-top:0;
 }
 
-#nextprev {
-    padding:0 50px 10px 150px;
+span.nextprev {
+}
+span.nextprev span {
+    width: 2em;
+    line-height:2em;
+    display: inline-block;
+    text-align: center;
+    height: 2em;
+    background:#444;
+    margin:0 3px;
+    font-size: 20px;
+    color:#777;
+}
+span.nextprev span a {
+    display:inline-block;
+    width:100%;
+    height:100%;
+    color:var(--link-color);
 }
 
+.more {
+/*    font-weight: normal;*/
+    text-transform: uppercase;
+    font-style: italic;
+    font-size: 10px;
+    color:#555;
+    text-decoration: underline;
+}
+.more:hover {
+    color:#999;
+    letter-spacing: 0.1em;
+}
 
 
 #nav {
+/*display:none;*/
   position:fixed;
   top:0;
   left:0;
@@ -128,8 +162,7 @@ table, td, tr {
 
 
 .entry {
-  padding-bottom:20px;
-  margin-bottom:100px;
+    margin-bottom: 4em;
 }
 .entry .metadata {
   /*visibility:hidden;*/
@@ -145,7 +178,7 @@ table, td, tr {
 
 }
 .entry h1 {
-    margin-bottom:5px;
+    margin-bottom:1em;
     position:relative;
     left:-1.65em;
 }
@@ -207,3 +240,7 @@ ul.image {
     background:#131313;
     padding:20px;
 }
+
+._c {
+    display: none;
+}
\ No newline at end of file
index 2bb9498e78a64b15b76ebc51851f39ff4a9ab51f..b0ef9ceddca509e8a6028da5d72d8f2a6a68679a 100644 (file)
@@ -2,33 +2,33 @@
 layout: index
 ---
 
-
-<!-- This loops through the paginated posts -->
-{% for post in paginator.posts %}
-<div class="entry">
-  <h1><a href="{{ post.url }}">— {{ post.title }}</a></h1>
-  <div class="content">
-    {{ post.content }}
-  </div>
+<!-- Posts -->
+<div class="posts">
+  {% for post in paginator.posts %}
+    <div class="entry">
+      <h1><a href="{{ site.url }}{{ post.url }}">— {{ post.title }}</a></h1>
+      <p class="_e">{{ post.excerpt }}</p>
+      <a class="more" href="{{ site.url }}{{ post.url }}">more...</a>
+    </div>
+  {% endfor %}
 </div>
-{% endfor %}
-
 
 <!-- Pagination links -->
 <div class="pagination">
-  {% if paginator.previous_page %}
-    <a href="{{ paginator.previous_page_path }}" class="previous">
-      Previous
-    </a>
-  {% else %}
-    <span class="previous">Previous</span>
+
+  {% if paginator.total_pages > 1 %}
+  {% assign start_item = paginator.page | times: paginator.per_page | minus: paginator.per_page | plus: 1 %}
+  {% assign end_item = paginator.page | times: paginator.per_page %}
+  {% assign total_items = paginator.total_posts %}
+  {% assign total_pages = paginator.total_pages %}
+
+  {{ start_item }}&mdash;{{ end_item | at_most: total_items }} of {{ total_items }} entries
   {% endif %}
-  <span class="page_number ">
-    Page: {{ paginator.page }} of {{ paginator.total_pages }}
+
+  <span class="nextprev">
+    <span>{% if paginator.previous_page %}<a href="{{ paginator.previous_page_path }}" class="previous">&lsaquo;</a>{% else %}&lsaquo;{% endif %}</span>
+    <span>{% if paginator.next_page %}<a href="{{ paginator.next_page_path }}" class="next">&rsaquo;</a>{% else %}&rsaquo;{% endif %}</span>
   </span>
-  {% if paginator.next_page %}
-    <a href="{{ paginator.next_page_path }}" class="next">Next</a>
-  {% else %}
-    <span class="next ">Next</span>
-  {% endif %}
+
 </div>
+