|
Ray Miller
d787b9788f
* planet/parse/atom.scm: prefer entry published date over updated date when both are present. This prevents old (but updated) posts from moving up to the front page. |
||
|---|---|---|
| planet | Fix: atom entry date | |
| static/css | Fix: CSS overflow | |
| .dir-locals.el | More work on feeds | |
| .gitignore | Add .gitignore file | |
| guix.pre.scm | Fix: handling of Expires header | |
| guix.scm | Update: add option to ignore feed download errors | |
| LICENSE | Add readme and license info. | |
| manifest.scm | Fix: ensure System Crafters post ids are valid URLs | |
| README.org | Docs: note new dependency, update site link | |
Readme for Guix Planet
This is a Planet RSS aggregator implemented in GNU Guile.
The example configuration here is for a small Guix Planet, bringing together a few blogs by Guix users and developers.
The only dependencies are Guile itself, guile-lib, guile-srfi-235, and guile-filesystem.
Live Site
The Guix Planet site can be found at https://planet.guix.gnu.org/
Usage
You will want to start by cloning this repository. Guile Planet is not distributed as a package as you will usually want to customize it to your needs. At the very least you will need to update the configuration but if you want to make substantive changes to the content selection or rendering, you will need to get your hands dirty with some scheme.
Configuration
Most of the common things that might change can be found in planet/config.scm.
This is also where new feeds can be added.
Building a static site
To build a static site
guix shell -m manifest.scm -- guile -L . -c '((@ (planet build) build-planet))'
Caching
If cache-dir is set in the configuration, then downloaded feeds will be saved
here. This can add robustness to the build: if a download fails on a subsequent
build, a cached value of the feed will be used instead.
This also allows us, during development, to test the parsing and building functions without having to download remote content. For example, if we have downloaded the feeds at least once:
guix shell -m manifest.scm -- guile -L . -c '((@ (planet build) build-planet) #:skip-download? #t)'
will build the entire site from the cache.
To disable caching
You can disable the cache entirely by updating config.scm:
(define cache-dir #f)
Backups
In order that a failed or aborted build does not leave the output directory in an inconsistent state, we create a build id from the current timestamp and process id, and define a build directory and backup directory as follows:
(let* ((target-dir conf:target-dir)
(build-id (string-append (number->string (current-time))
"."
(number->string (getpid))))
(build-dir (string-append target-dir ".build-" build-id))
(backup-dir (string-append target-dir ".backup-" build-id)))
...
)
Build output is initially written to the temporary directory build-dir. If the
build completes successfully, we rename target-dir to backup-dir then rename
build-dir to target-dir (as far as I know, this is as close as we can come
to an atomic update when working with directories).
We don't want backup directories to accumulate indefinitely, so the
configuration setting keep-backups specifies the number to keep, and we invoke
a clean-up function at the end of the build.
Serving locally
Pick your favourite static web server, or:
cd public
guix shell python -- python3 -m http.server 8000
Copyright and License
Guile Planet (GPLv3 or later)
Guile Planet copyright (C) 2025 Ray Miller
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
CSS (MIT License)
CSS is based on Simple CSS by Kev Quirk.
Copyright (C) 2020 Simple.css (Kev Quirk)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.