summaryrefslogtreecommitdiff
path: root/www/posts/jigsaw/2020-06-01/scheduling-posts-in-jigsaw/index.html
diff options
context:
space:
mode:
authorDavid T. Sadler <davidtsadler@googlemail.com>2021-05-19 23:46:22 +0100
committerDavid T. Sadler <davidtsadler@googlemail.com>2021-05-19 23:46:22 +0100
commit62243cd0b5262e14df7e7b5b7103b5b2e006cab5 (patch)
tree2efe608a92f42aca3c372712fc14d4ae10fcec72 /www/posts/jigsaw/2020-06-01/scheduling-posts-in-jigsaw/index.html
parentbbf7974715b9a43bab207df75ef69209cdf13850 (diff)
Add more to css
Diffstat (limited to 'www/posts/jigsaw/2020-06-01/scheduling-posts-in-jigsaw/index.html')
-rw-r--r--www/posts/jigsaw/2020-06-01/scheduling-posts-in-jigsaw/index.html25
1 files changed, 15 insertions, 10 deletions
diff --git a/www/posts/jigsaw/2020-06-01/scheduling-posts-in-jigsaw/index.html b/www/posts/jigsaw/2020-06-01/scheduling-posts-in-jigsaw/index.html
index e0f467b..9438359 100644
--- a/www/posts/jigsaw/2020-06-01/scheduling-posts-in-jigsaw/index.html
+++ b/www/posts/jigsaw/2020-06-01/scheduling-posts-in-jigsaw/index.html
@@ -5,6 +5,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Scheduling Posts in Jigsaw</title>
<link rel="shortcut icon" href="/images/favicon.png">
+ <link rel="stylesheet" href="/css/modern-normalize.min.css">
+ <link rel="stylesheet" href="/css/highlight.min.css">
+ <link rel="stylesheet" href="/css/railscasts.css">
<link rel="stylesheet" href="/css/site.css">
<link href="/posts/atom.xml" type="application/atom+xml" rel="alternate" title="The Home of David T. Sadler - All Posts"/>
<link href="/posts/arch/atom.xml" type="application/atom+xml" rel="alternate" title="The Home of David T. Sadler - All Posts About Arch"/>
@@ -23,15 +26,17 @@
use Carbon\Carbon;
return [
-'collections' =&gt; [
-'posts' =&gt; [
-'filter' =&gt; function ($item) {
-$date = $item-&gt;date ? Carbon::createFromFormat('U', $item-&gt;date) : null;
-// Only publish posts that have a date and which is not in the future.
-return $date ? $date &lt;= Carbon::now() : false;
-}
-],
-],
-];</code></pre><p>When deploying the site each post is passed to this filter. The first thing it does is convert the date that has been specified in the post's YAML front matter into a Carbon instance. It then returns true if the date is on or before the current date, I.e. when the site is been deployed.</p><p>With this filter I can specify future dates for several posts and they will only published once that date comes around. Posts are also exluded if a date has not been specified. This allows me to have posts that are a work in progress and shouldn't be published.</p><h3>Links</h3><a href="https://jigsaw.tighten.co/">Jigsaw - Static Site Generator for PHP Developers.</a><a href="https://jigsaw.tighten.co/docs/collections-filtering/">Using Filters in Jigsaw.</a><a href="https://carbon.nesbot.com/">Carbon - PHP API Extension for DateTime.</a><a href="/posts/jigsaw/">Jigsaw - Read More Posts.</a><p>I don't have comments as I don't want to manage them. You can however contact me at the below address if you want to.</p><a href="mailto:david@davidtsadler.com">Email david@davidtsadler.com</a><a href="https://creativecommons.org/licenses/by-sa/4.0/">The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.</a><p>Copyright © 2021 David T. Sadler.</p><a href="/">Return to Homepage.</a></section>
+ 'collections' =&gt; [
+ 'posts' =&gt; [
+ 'filter' =&gt; function ($item) {
+ $date = $item-&gt;date ? Carbon::createFromFormat('U', $item-&gt;date) : null;
+ // Only publish posts that have a date and which is not in the future.
+ return $date ? $date &lt;= Carbon::now() : false;
+ }
+ ],
+ ],
+];</code></pre><p>When deploying the site each post is passed to this filter. The first thing it does is convert the date that has been specified in the post's YAML front matter into a Carbon instance. It then returns true if the date is on or before the current date, I.e. when the site is been deployed. </p><p>With this filter I can specify future dates for several posts and they will only published once that date comes around. Posts are also exluded if a date has not been specified. This allows me to have posts that are a work in progress and shouldn't be published.</p><h3>Links</h3><a href="https://jigsaw.tighten.co/">Jigsaw - Static Site Generator for PHP Developers.</a><a href="https://jigsaw.tighten.co/docs/collections-filtering/">Using Filters in Jigsaw.</a><a href="https://carbon.nesbot.com/">Carbon - PHP API Extension for DateTime.</a><a href="/posts/jigsaw/">Jigsaw - Read More Posts.</a><p>I don't have comments as I don't want to manage them. You can however contact me at the below address if you want to.</p><a href="mailto:david@davidtsadler.com">Email david@davidtsadler.com</a><h3>License</h3><a href="https://creativecommons.org/licenses/by-sa/4.0/">The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.</a><p>Copyright © 2021 David T. Sadler.</p><a href="/">Return to Homepage.</a></section>
+ <script src="/js/highlight.min.js"></script>
+ <script src="/js/site.js"></script>
</body>
</html>