...
 
Commits (36)
build-site:
script: make
pages:
script:
- make
- mv output public
artifacts:
paths:
- public
only:
- master
(defsystem "cl-site"
:name "cl-site"
:version "0.0.1"
:maintainer "C. Yang"
:author "C. Yang"
:licence "TBD"
:description "Static site generator for CLnet, written in CL."
:depends-on ("cl-mustache")
:serial t
:components ((:file "package")
(:file "globals")
(:file "helpers")
(:file "process")
(:file "main"))
:in-order-to ((asdf:test-op (asdf:test-op cl-site/t))))
(defsystem cl-site/t
:defsystem-depends-on ("prove-asdf")
:depends-on ("cl-site"
"prove")
:pathname "t"
:components ((:test-file "site"))
:perform (asdf:test-op (op c)
(uiop:symbol-call :prove-asdf 'run-test-system c)))
;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
(in-package :cl-user)
(asdf:defsystem cl-site
:name "cl-site"
:version "0.0.1"
:maintainer "C. Yang"
:author "C. Yang"
:licence "TBD"
:description "Static site generator for CLnet, written in CL"
:depends-on (:cl-mustache :plump :markdown.cl :closer-mop)
:components ((:module source
:pathname ""
:serial t
:depends-on (package)
:components ((:file "globals")
(:file "helpers")
(:file "process")
(:file "main")))
(:module package
:pathname ""
:components ((:file "package"))))
:in-order-to ((asdf:test-op (asdf:test-op cl-site/t))))
;;(asdf:defsystem cl-site/t
;; :defsystem-depends-on (prove-asdf)
;; :depends-on (cl-site prove)
;; :components ((:module site
;; :pathname "t/"
;; :components ((:test-file "site"))))
;; :perform (asdf:test-op (op c)
;; (uiop:symbol-call :prove-asdf 'run-test-system c)))
......@@ -7,13 +7,13 @@ related to the programming language Common Lisp.
<p>The site is run under the governance of the <a
href="http://www.cl-foundation.org/">Common Lisp Foundation</a> and
maintained mostly by a committee of volunteers. <a
href="/contribute/">Please consider donating</a>.</p>
href="/contribute">Please consider donating</a>.</p>
<p>Its source is hosted
on <a href="https://gitlab.common-lisp.net/clo/cl-site">gitlab.common-lisp.net</a>.
</p>
<p>If you want to request a project, <a href="/project-intro/">read
<p>If you want to request a project, <a href="/project-intro">read
this document</a>.</p>
<p>If you have questions, suggestions or comments about this site or
......@@ -34,9 +34,8 @@ by a number of volunteers.</p>
<ul>
<li>Mark Evenson</li>
<li>Erik Huelsman</li>
<li>Mario S. Mommer</li>
<li>Cheryl Yang</li>
<li>Erik Huelsmann</li>
<li>Mariano Montone</li>
</ul>
<h3>Previous maintainers</h3>
......@@ -45,5 +44,7 @@ by a number of volunteers.</p>
<li>Erik Enge</li>
<li>Drew Crampsie</li>
<li>Hans H&uuml;bner</li>
<li>Cheryl Yang</li>
<li>Mario S. Mommer</li>
</ul>
......@@ -36,8 +36,9 @@
<li><a href="https://lispcookbook.github.io/cl-cookbook/">the Common Lisp Cookbook</a></li>
<li><a href="https://cliki.net">CLiki</a> - The Common Lisp wiki</li>
<li><a href="http://quickdocs.org">Quickdocs</a> - Documentation for All Common Lisp Projects</li>
<li><a href="http://borretti.me/article/common-lisp-sotu-2015">State of the Common Lisp Ecosystem</a> as of 2015</li>
<li><a href="http://quickref.common-lisp.net/">Quickref</a> - Reference manuals for Quicklisp libraries</li>
</ul>
<p><a href="/documentation">Read more</a></p>
</div>
<div class="col-lg-4 col-md-6">
<h2><i class="fa fa-users"></i> Conferences</h2>
......
......@@ -155,6 +155,10 @@
<h2>Other resources</h2>
<ul>
<li><a href="https://lispcookbook.github.io/cl-cookbook/">The Common Lisp Cookbook</a></li>
<li><a href="https://lispcookbook.github.io/cl-cookbook/">the Common Lisp Cookbook</a></li>
<li><a href="https://cliki.net">CLiki</a> - The Common Lisp wiki</li>
<li><a href="http://quickdocs.org">Quickdocs</a> - Documentation for All Common Lisp Projects</li>
<li><a href="http://quickref.common-lisp.net/">Quickref</a> - Reference manuals for Quicklisp libraries</li>
<li><a href="http://borretti.me/article/common-lisp-sotu-2015">State of the Common Lisp Ecosystem</a> as of 2015</li>
</ul>
</section>
......@@ -7,37 +7,63 @@
<p>If you are a newbie or you want to get started as fast as possible, then <a href="https://portacle.github.io/">Portacle</a> is probably your best option. Portacle is a multiplatform, complete IDE for Common Lisp. It includes Emacs, SBCL, Git, Quicklisp, all configured and ready to use.</p>
<p>
<a href="https://portacle.github.io" class="btn btn-primary"><i class="fa fa-download"></i>&nbsp;&nbsp;Download Portacle - All-In-One Common Lisp</a>
<a href="https://portacle.github.io" class="btn btn-primary"><i class="fa fa-download"></i>&nbsp;&nbsp;Download Portacle - All-In-One Common Lisp</a>
</p>
<p>Otherwise, Common Lisp comes in many different <a href="/implementations">flavors, or implementations</a>. Two popular ones are Steel Bank Common Lisp (SBCL) and Clozure Common Lisp (CCL).</p>
<ul>
<li><b>Steel Bank Common Lisp (SBCL)</b>
<ul>
<li><a href="http://www.sbcl.org/">Main website</a></li>
<li><a href="http://www.sbcl.org/platform-table.html">Download&nbsp;&nbsp;<i class="fa fa-download"></i></a></li>
<li><a href="http://www.sbcl.org/getting.html">Install</a></li>
</ul>
</li>
<li><b>Clozure Common Lisp (CCL)</b>
<ul>
<li><a href="http://ccl.clozure.com/">Main website</a></li>
<li><a href="http://ccl.clozure.com/download.html">Download/Install&nbsp;&nbsp;<i class="fa fa-download"></i></a></li>
</ul>
</li>
</ul>
<p>Otherwise, Common Lisp comes in many different <a href="/implementations">flavors, or implementations</a>.</p>
<p>Two popular <em>open source</em> ones are Steel Bank Common Lisp (SBCL) and Clozure Common Lisp (CCL):</p>
<div class="row">
<div class="col-md-4">
<b>Steel Bank Common Lisp (SBCL)</b>
<ul>
<li><a href="http://www.sbcl.org/">Main website</a></li>
<li><a href="http://www.sbcl.org/platform-table.html">Download&nbsp;&nbsp;<i class="fa fa-download"></i></a></li>
<li><a href="http://www.sbcl.org/getting.html">Install</a></li>
</ul>
</div>
<div class="col-md-4">
<b>Clozure Common Lisp (CCL)</b>
<ul>
<li><a href="http://ccl.clozure.com/">Main website</a></li>
<li><a href="http://ccl.clozure.com/download.html">Download/Install&nbsp;&nbsp;<i class="fa fa-download"></i></a></li>
</ul>
</div>
</div>
<p>There are also powerful <em>commercial</em> implementations:</p>
<div class="row">
<div class="col-md-4">
<b>Allegro CL</b><br/>
<a href="https://franz.com/products/allegro-common-lisp/">Allegro CL ®</a> <span class="small"> (sponsored link)</span> is a very powerful dynamic object-oriented development system especially suited to enterprise-wide, complex application development.
<ul>
<li><a href="https://franz.com/products/allegro-common-lisp/">Main website</a></li>
<li><a href="http://www.franz.com/">Company website</a></li>
<li><a href="https://franz.com/downloads/clp/survey">Free download&nbsp;&nbsp;<i class="fa fa-download"></i></a></li>
</ul>
</div>
</div>
<p>Look <a href="/implementations">here</a> for other Common Lisp compilers.</p>
<p>You can also try Common Lisp online:</p>
<p>
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#try_lisp" aria-expanded="false" aria-controls="collapseExample">
<i class="fa fa-play"></i>&nbsp;&nbsp;&nbsp;Try Lisp Online
</button>
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#try_lisp" aria-expanded="false" aria-controls="collapseExample">
<i class="fa fa-play"></i>&nbsp;&nbsp;&nbsp;Try Lisp Online
</button>
</p>
<div class="collapse" id="try_lisp">
<p>This is a <a href="https://github.com/jscl-project/jscl">JSCL</a> Lisp REPL running on the Web. Note that it is not a complete Common Lisp implementation, but enough to have a taste of it:</p>
<iframe style="width:100%; height: 400px;" src="https://jscl-project.github.io/"></iframe>
<p>This is a <a href="https://github.com/jscl-project/jscl">JSCL</a> Lisp REPL running on the Web. Note that it is not a complete Common Lisp implementation, but enough to have a taste of it:</p>
<iframe style="width:100%; height: 400px;" src="https://jscl-project.github.io/"></iframe>
</div>
<h2>Setup your environment</h2>
......@@ -57,12 +83,12 @@
<p>You can also watch this video tutorial:</p>
<p>
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#setup_video" aria-expanded="false" aria-controls="collapseExample">
<i class="fa fa-play"></i>&nbsp;&nbsp;&nbsp;Watch an introductory video
</button>
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#setup_video" aria-expanded="false" aria-controls="collapseExample">
<i class="fa fa-play"></i>&nbsp;&nbsp;&nbsp;Watch an introductory video
</button>
</p>
<div class="collapse" id="setup_video">
<iframe width="560" height="315" src="https://www.youtube.com/embed/VnWVu8VVDbI" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
<iframe width="560" height="315" src="https://www.youtube.com/embed/VnWVu8VVDbI" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</div>
<h2>Read about Lisp</h2>
......@@ -77,12 +103,12 @@
<p>You may want check out <a href="https://lispcookbook.github.io/cl-cookbook/getting-started.html">the Common Lisp Cookbook</a> for getting started on Common Lisp ecosystem.</p>
<p>
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#start_project_video" aria-expanded="false" aria-controls="collapseExample">
<i class="fa fa-play"></i>&nbsp;&nbsp;&nbsp;Watch an introductory video
</button>
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#start_project_video" aria-expanded="false" aria-controls="collapseExample">
<i class="fa fa-play"></i>&nbsp;&nbsp;&nbsp;Watch an introductory video
</button>
</p>
<div class="collapse" id="start_project_video">
<iframe width="560" height="315" src="https://www.youtube.com/embed/SPgjgybGb5o" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
<iframe width="560" height="315" src="https://www.youtube.com/embed/SPgjgybGb5o" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</div>
<h2>Libraries</h2>
......@@ -94,9 +120,9 @@
<h2>Resources</h2>
<p>Here's a list of alternative guides for getting started:
<ul>
<li><a target="_blank" href="https://lispmethods.com/development-environment.html">Getting Started With Common Lisp</a> at lispmethods.com.</li>
<li><a href="http://articulate-lisp.com">Articulate Lisp site</a>.</li>
<li><a target="_blank" href="https://cliki.net/Getting%20Started">CLiki guide</a>.</li>
</ul>
<ul>
<li><a target="_blank" href="https://lispmethods.com/development-environment.html">Getting Started With Common Lisp</a> at lispmethods.com.</li>
<li><a href="http://articulate-lisp.com">Articulate Lisp site</a>.</li>
<li><a target="_blank" href="https://cliki.net/Getting%20Started">CLiki guide</a>.</li>
</ul>
</p>
<h1>Common Lisp Implementations</h1>
<h2 style="margin-bottom: 20px;">Open source</h2>
<div class="row">
<div class="col-lg-4 col-md-6">
<h3>SBCL</h3>
<p>
<a href="http://www.sbcl.org">Steel Bank Common Lisp (SBCL)</a> is a high performance Common Lisp compiler. It is open source / free software, with a permissive license. In addition to the compiler and runtime system for ANSI Common Lisp, it provides an interactive environment including a debugger, a statistical profiler, a code coverage tool, and many other extensions. SBCL runs on a number of POSIX platforms, and experimentally on Windows.
</p>
</div>
<div class="col-lg-4 col-md-6">
<h3>Clozure CL</h3>
<p><a href="https://ccl.clozure.com/">Clozure CL</a> (often called CCL for short) is a free Common Lisp implementation with a long history. Some distinguishing features of the implementation include fast compilation speed, native threads, a precise, generational, compacting garbage collector, and a convenient foreign-function interface.</p>
<p>
Clozure CL is distributed under the terms of the Apache License, version 2.0.
</p>
</div>
<div class="col-lg-4 col-md-6">
<h3>Embeddable CL</h3>
<p><a href="https://common-lisp.net/project/ecl/main.html">ECL (Embeddable Common-Lisp)</a> is an interpreter of the Common-Lisp language as described in the X3J13 Ansi specification, featuring CLOS (Common-Lisp Object System), conditions, loops, etc, plus a translator to C, which can produce standalone executables.</p>
<p>ECL supports the operating systems Linux, FreeBSD, NetBSD, OpenBSD, OS X, Solaris and Windows, running on top of the Intel, Sparc, Alpha, PowerPC and ARM processors.</p>
</div>
<div class="col-lg-4 col-md-6">
<h3>ABCL</h3>
<p><a href="https://common-lisp.net/project/armedbear/">Armed Bear Common Lisp (ABCL)</a> is a full implementation of the Common Lisp language featuring both an interpreter and a compiler, running in the JVM. Originally started to be a scripting language for the J editor, it now supports JSR-223 (Java scripting API): it can be a scripting engine in any Java application. Additionally, it can be used to implement (parts of) the application using Java to Lisp integration APIs.</p>
</div>
<div class="col-lg-4 col-md-6">
<h3>Clasp</h3>
<p><a href="https://github.com/clasp-developers/clasp">Clasp</a> is a new Common Lisp implementation that seamlessly interoperates with C++ libraries and programs using LLVM for compilation to native code. This allows Clasp to take advantage of a vast array of preexisting libraries and programs, such as out of the scientific computing ecosystem. Embedding them in a Common Lisp environment allows you to make use of rapid prototyping, incremental development, and other capabilities that make it a powerful language.</p>
</div>
</div>
<h2 style="margin-bottom: 20px;">Commercial</h2>
<div class="row">
<div class="col-lg-4 col-md-6">
<h2>SBCL</h2>
<p>
<a href="http://www.sbcl.org">Steel Bank Common Lisp (SBCL)</a> is a high performance Common Lisp compiler. It is open source / free software, with a permissive license. In addition to the compiler and runtime system for ANSI Common Lisp, it provides an interactive environment including a debugger, a statistical profiler, a code coverage tool, and many other extensions. SBCL runs on a number of POSIX platforms, and experimentally on Windows.
</p>
</div>
<div class="col-lg-4 col-md-6">
<h2>Clozure CL</h2>
<p><a href="https://ccl.clozure.com/">Clozure CL</a> (often called CCL for short) is a free Common Lisp implementation with a long history. Some distinguishing features of the implementation include fast compilation speed, native threads, a precise, generational, compacting garbage collector, and a convenient foreign-function interface.</p>
<p>
Clozure CL is distributed under the terms of the Apache License, version 2.0.
</p>
</div>
<div class="col-lg-4 col-md-6">
<h2>Embeddable CL</h2>
<p><a href="https://common-lisp.net/project/ecl/main.html">ECL (Embeddable Common-Lisp)</a> is an interpreter of the Common-Lisp language as described in the X3J13 Ansi specification, featuring CLOS (Common-Lisp Object System), conditions, loops, etc, plus a translator to C, which can produce standalone executables.</p>
<p>ECL supports the operating systems Linux, FreeBSD, NetBSD, OpenBSD, OS X, Solaris and Windows, running on top of the Intel, Sparc, Alpha, PowerPC and ARM processors.</p>
</div>
<div class="col-lg-4 col-md-6">
<h2>ABCL</h2>
<p><a href="https://common-lisp.net/project/armedbear/">Armed Bear Common Lisp (ABCL)</a> is a full implementation of the Common Lisp language featuring both an interpreter and a compiler, running in the JVM. Originally started to be a scripting language for the J editor, it now supports JSR-223 (Java scripting API): it can be a scripting engine in any Java application. Additionally, it can be used to implement (parts of) the application using Java to Lisp integration APIs.</p>
</div>
<div class="col-lg-4 col-md-6">
<h2>Clasp</h2>
<p><a href="https://github.com/clasp-developers/clasp">Clasp</a> is a new Common Lisp implementation that seamlessly interoperates with C++ libraries and programs using LLVM for compilation to native code. This allows Clasp to take advantage of a vast array of preexisting libraries and programs, such as out of the scientific computing ecosystem. Embedding them in a Common Lisp environment allows you to make use of rapid prototyping, incremental development, and other capabilities that make it a powerful language.</p>
</div>
<div class="col-lg-4 col-md-6">
<img src="/static/imgs/acl-128.png" class="float-right">
<h3>Allegro CL</h3>
<p>
<a href="https://franz.com/products/allegro-common-lisp/">Allegro CL ®</a> is a powerful dynamic object-oriented development, especially suited to enterprise-wide, complex application development. Complex applications with billions of objects are made easy with Allegro CL. The complexity of today's software applications and the explosion of data size are pervasive in all fields ranging from Life Sciences to Manufacturing to Financial Analytics. Allegro CL is the most effective system for developing and deploying applications to solve these complex problems in the real world.
</p>
</div>
</div>
<p>
For a complete list, see <a href="http://en.wikipedia.org/wiki/Common_Lisp#List_of_implementations">Wikipedia's big list of CL implementations</a>
For a complete list, see <a href="http://en.wikipedia.org/wiki/Common_Lisp#List_of_implementations">Wikipedia's big list of CL implementations</a>
</p>
......@@ -15,34 +15,23 @@
<article id="news">
<h2>Latest Lisp news<i class="fa fa-rss float-right"></i></h2>
<div id="widgetmain" style="text-align:left;overflow-y:auto;overflow-x:hidden;width:331px;background-color:#transparent; border:1px solid #333333;"><div id="rsswidget" style="height:300px;"><iframe src="http://us1.rssfeedwidget.com/getrss.php?time=1526156555722&amp;x=http%3A%2F%2Fplanet.lisp.org%2Frss20.xml&amp;w=331&amp;h=300&amp;bc=333333&amp;bw=1&amp;bgc=transparent&amp;m=20&amp;it=true&amp;t=Planet Lisp&amp;tc=333333&amp;ts=16&amp;tb=transparent&amp;il=true&amp;lc=D9230F&amp;ls=14&amp;lb=false&amp;id=false&amp;dc=333333&amp;ds=14&amp;idt=true&amp;dtc=284F2D&amp;dts=12" border="0" hspace="0" vspace="0" marginwidth="0" marginheight="0" style="border:0; padding:0; margin:0; width:331px; height:300px;" id="rssOutput" frameborder="no">Reading RSS Feed ...</iframe></div></div>
<div id="widgetmain" style="text-align:left;overflow-y:auto;overflow-x:hidden;width:331px;background-color:#transparent; border:1px solid #333333;padding: 8px;"><div id="rsswidget" style="height:300px;">
<script src="//rss.bloople.net/?url=https%3A%2F%2Fplanet.lisp.org%2Frss20.xml&detail=-1&limit=5&type=js"></script>
<!-- <iframe src="http://us1.rssfeedwidget.com/getrss.php?time=1526156555722&amp;x=http%3A%2F%2Fplanet.lisp.org%2Frss20.xml&amp;w=331&amp;h=300&amp;bc=333333&amp;bw=1&amp;bgc=transparent&amp;m=20&amp;it=true&amp;t=Planet Lisp&amp;tc=333333&amp;ts=16&amp;tb=transparent&amp;il=true&amp;lc=D9230F&amp;ls=14&amp;lb=false&amp;id=false&amp;dc=333333&amp;ds=14&amp;idt=true&amp;dtc=284F2D&amp;dts=12" border="0" hspace="0" vspace="0" marginwidth="0" marginheight="0" style="border:0; padding:0; margin:0; width:331px; height:300px;" id="rssOutput" frameborder="no">Reading RSS Feed ...</iframe> -->
</div></div>
<!-- <a class="twitter-timeline" data-height="300" data-chrome="nofooter noborders noheader" href="https://twitter.com/planet_lisp?ref_src=twsrc%5Etfw">Tweets by planet_lisp</a> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> -->
<div style="padding-top: 10px;"></div>
<script src="https://www.reddit.com/r/lisp/.embed?limit=5&t=all" type="text/javascript"></script>
<h2 style="padding-top: 10px;">Latest Common-Lisp.net news</h2>
<section id="2015_05_25">
<h7>2015-05-25</h7>
<p>Today the system has been declared &quot;CVS clean&quot;! All
remnants of CVS have been removed.</p>
</section>
<section id="2015_05_23">
<h7>2015-05-23</h7>
<p>On Friday, the system had performance problems due to slow I/O.
Today, the disk system reports running in degraded mode,
so we ordered the failing disk to be replaced. The disk array
has been rebuilt.</p>
</section>
<section id="2015_05_22">
<h7 id="2015_05_22">2015-05-22</h7>
<p>GitLab upgraded to <a href="https://gitlab.com/gitlab-org/gitlab-ce/blob/v7.11.1/CHANGELOG">GitLab 7.11.1.</a></p>
</section>
<p><a href="/news/" style="font-size: 80%"
>Read older news...</a></p>
{{> newsbox}}
<p><a href="/news" style="font-size: 80%"
>Read more...</a></p>
</article>
<article id="description">
......@@ -73,9 +62,9 @@
<h2>Services</h2>
<ul>
<li><a href="/project-intro/">Project hosting</a> for open
<li><a href="/project-intro">Project hosting</a> for open
source / free software <b>Common Lisp</b> projects.</li>
<li><a href="/independent-lists/">Mailing lists</a> for
<li><a href="/independent-lists">Mailing lists</a> for
<b>Common Lisp</b> related topics.</li>
</ul>
</section>
......@@ -91,6 +80,6 @@
<section id="about">
<h2>About this site</h2>
<p>Check out our <a href="/about/">about page</a>.</p>
<p>Check out our <a href="/about">about page</a>.</p>
</section>
</main>
This diff is collapsed.
......@@ -157,3 +157,11 @@ hr {
line-height: 15px;
clear:both;
}
.feed-title a {
color: black;
}
.feed-item-title {
font-size: 1.2em;
}
......@@ -27,7 +27,7 @@
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a href="/downloads/" class="nav-link">Getting started</a>
<a href="/downloads" class="nav-link">Getting started</a>
</li>
<li class="nav-item">
<a href="/documentation" class="nav-link">Documentation</span></a>
......@@ -38,26 +38,26 @@
<li class="nav-item dropdown">
<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown">Projects <span class="caret"></span></a>
<div class="dropdown-menu" role="menu">
<a class="dropdown-item" href="/project-intro/">Hosting services</a>
<a class="dropdown-item" href="/phub/">Projects hub</a>
<a class="dropdown-item" href="/project-intro">Hosting services</a>
<a class="dropdown-item" href="/phub">Projects hub</a>
</div>
</li>
<li class="nav-item dropdown">
<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown">Resources <span class="caret"></span></a>
<div class="dropdown-menu" role="menu">
<a class="dropdown-item" href="/tools/">Tools</a>
<a class="dropdown-item" href="/implementations/">Common Lisp Implementations</a>
<a class="dropdown-item" href="/faq/">FAQ</a>
<a class="dropdown-item" href="/tools">Tools</a>
<a class="dropdown-item" href="/implementations">Common Lisp Implementations</a>
<a class="dropdown-item" href="/faq">FAQ</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="/contribute/">Contribute</a>
<a class="nav-link" href="/contribute">Contribute</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/lisp-companies/">Stories</a>
<a class="nav-link" href="/lisp-companies">Stories</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/about/">About</a>
<a class="nav-link" href="/about">About</a>
</li>
</ul>
</div>
......
......@@ -41,18 +41,23 @@
(let*
((page-path (make-path *PAGES-DIR* page t))
(output-path (make-path *OUTPUT-DIR* page t))
(page-content (file-to-string page-path))
(page-content (let ((mustache:*load-path* (cons *PAGES-DIR* mustache:*load-path*))
(mustache:*default-pathname-type* "html"))
(mustache:render* page-path)))
(page-context (remove-if (lambda (p) (find p *PRIVATE-KEYS*))
(push (cons :page-content page-content) page) :key 'car)))
(with-open-file (output-stream output-path
:direction :output
:if-exists :supersede)
(mustache:render template-path (append page-context *GLOBAL-CONTEXT*)
output-stream))))
(let ((mustache:*load-path* (cons *PAGES-DIR* mustache:*load-path*))
(mustache:*default-pathname-type* "html"))
(mustache:render template-path (append page-context *GLOBAL-CONTEXT*)
output-stream)))))
(defun process-pages ()
(format t "Processing pages..~%")
(generate-news)
(let ((template-path (pathname (merge-pathnames *LAYOUT-DIR* *DEFAULT-PAGE-TEMPLATE*))))
(ensure-directories-exist *OUTPUT-DIR*)
(loop for page in *PAGES*
......@@ -60,3 +65,86 @@
(format t "Generating ~A~%" (cdr (assoc :content page)))
(render-page page template-path))
(format t "Done.~%")))
;; Process news
(defparameter +edit-news-link+ "https://gitlab.common-lisp.net/clo/cl-site/edit/master/content/news.md")
(defun generate-news ()
(let ((html
(markdown:parse-file (merge-pathnames "news.md" *PAGES-DIR*))))
(with-open-file (f (merge-pathnames "news.html" *PAGES-DIR*)
:direction :output
:if-does-not-exist :create
:if-exists :supersede)
(write-string "<div id=\"bodyText\">" f)
(format f "<a class=\"btn btn-secondary float-right\" href=\"~A\"><i class=\"far fa-edit\"></i>&nbsp;Edit this page</a>" +edit-news-link+)
(write-string "<h1>Latest Common-Lisp.net news</h1>" f)
(write-string html f)
(write-string "</div>" f))
(with-open-file (f (merge-pathnames "newsbox.html" *PAGES-DIR*)
:direction :output
:if-does-not-exist :create
:if-exists :supersede)
(write-string (generate-news-box-content html) f))))
(defun shallow-copy-object (original)
(let* ((class (class-of original))
(copy (allocate-instance class)))
(dolist (slot (mapcar #'c2mop:slot-definition-name (c2mop:class-slots class)))
(when (slot-boundp original slot)
(setf (slot-value copy slot)
(slot-value original slot))))
copy))
(defun generate-news-box-content (html &key (count 5))
(let ((dom (plump-parser:parse html)))
(let ((state :start)
(node (plump:first-child dom))
(news (plump:make-root))
(current-news))
(block done
(flet ((next-node ()
(setf node (plump:next-sibling node))
(when (null node)
;;(print "DONE")
(return-from done))
node))
(loop
;;(print state)
;;(print node)
(ecase state
(:start
(if (and (plump:element-p node)
(equalp (plump:tag-name node) "h3"))
(setf state :read-news-heading)
;; else
(next-node)))
(:read-news-heading
;; If enough news, exit
(when (= (length (plump:children news)) count)
(return-from done))
;; Start a new one
(setf current-news
(plump:make-element news "section"))
(let ((title-node (shallow-copy-object node)))
(setf (plump:tag-name title-node) "h7")
(plump:append-child current-news title-node))
(next-node)
(setf state :read-news-content))
(:read-news-content
;; We assume the node is a paragraph and we read its content
(if (and (plump:element-p node)
(equalp (plump:tag-name node) "p"))
(progn
(plump:append-child current-news (shallow-copy-object node))
(next-node)
(setf state :start))
;; else
(next-node)))))))
(plump:serialize news nil))))