From patchwork Mon May 24 23:35:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luis Felipe X-Patchwork-Id: 29579 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id AD03A27BC78; Tue, 25 May 2021 00:36:12 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 4377B27BC81 for ; Tue, 25 May 2021 00:36:11 +0100 (BST) Received: from localhost ([::1]:52724 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llK7G-0003N0-9c for patchwork@mira.cbaines.net; Mon, 24 May 2021 19:36:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41470) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llK78-0003KP-6c for guix-patches@gnu.org; Mon, 24 May 2021 19:36:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:60870) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llK77-0005z1-V2 for guix-patches@gnu.org; Mon, 24 May 2021 19:36:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1llK77-00027I-RB for guix-patches@gnu.org; Mon, 24 May 2021 19:36:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48637] [PATCH] website: Add publications page Resent-From: Luis Felipe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 24 May 2021 23:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 48637 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48637@debbugs.gnu.org X-Debbugs-Original-To: Luis Felipe via Guix-patches Received: via spool by submit@debbugs.gnu.org id=B.16218993488113 (code B ref -1); Mon, 24 May 2021 23:36:01 +0000 Received: (at submit) by debbugs.gnu.org; 24 May 2021 23:35:48 +0000 Received: from localhost ([127.0.0.1]:44183 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1llK6n-00026h-6P for submit@debbugs.gnu.org; Mon, 24 May 2021 19:35:48 -0400 Received: from lists.gnu.org ([209.51.188.17]:40208) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1llK6l-00026Y-AD for submit@debbugs.gnu.org; Mon, 24 May 2021 19:35:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41442) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llK6k-0003Gw-Pl for guix-patches@gnu.org; Mon, 24 May 2021 19:35:39 -0400 Received: from mail-40140.protonmail.ch ([185.70.40.140]:60961) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llK6h-0005ZZ-8c for guix-patches@gnu.org; Mon, 24 May 2021 19:35:38 -0400 Date: Mon, 24 May 2021 23:35:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1621899327; bh=gDorwhFRb9f/ENq/2q/A/pnCuoogX/aLIFfeJRsQ5K0=; h=Date:To:From:Reply-To:Subject:From; b=o1LJf/QXr8pM1Rnk3qt9HjBDtOCvDXd67s6uUtfMb51e2pc0rkvulyXcuU2kUHvR9 1h7F6BzxaWODrT7iw6mBGtIuz8A/iDN63a2gKye3TWa67rhci+YZMNprWa7Yb50wt8 OXCW9gmkihOgc7E6vow8j1DTr/pLRI4prqI47Fp0= Message-ID: <4BtcqLwBY7LgeYhUd41lhUUAcT5n2Zn9OTJUzGswTuBpLla8nBHyrQ3kJzwEMI9E7MPEnr6wBqSeCMqByldZ6i5jPR8B7ZtEi0XhwextyQo=@protonmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=185.70.40.140; envelope-from=luis.felipe.la@protonmail.com; helo=mail-40140.protonmail.ch X-Spam_score_int: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_OTHER_BAD_TLD=1.997, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: Luis Felipe X-ACL-Warn: , Luis Felipe via Guix-patches X-Patchwork-Original-From: Luis Felipe via Guix-patches via From: Luis Felipe X-getmail-retrieved-from-mailbox: Patches Hi, This patch adds a new Publications page to the website. --- Luis Felipe López Acevedo https://luis-felipe.gitlab.io/ From eb36bae9f13b7825b22303e1efe6fd37c563ccdd Mon Sep 17 00:00:00 2001 From: Luis Felipe Date: Mon, 24 May 2021 17:54:17 -0500 Subject: [PATCH] website: Add publications page. This page lists different kinds of written publications that talk about Guix. * website/apps/base/templates/components.scm (navbar): Link to the new page from the Media menu. * website/apps/media/builder.scm (publication-list-builder): New helper builder. (builder): Use the new helper builder. * website/apps/media/data.scm (publications): New data set. * website/apps/media/templates/components.scm (publication->shtml): New component. * website/apps/media/templates/publication-list.scm: New template. * website/apps/media/types.scm (): New record type. * website/static/base/img/link-arrow-shaper.svg: New image. * website/static/media/css/publications.css: New style sheet. --- website/apps/base/templates/components.scm | 14 +++- website/apps/media/builder.scm | 19 ++++-- website/apps/media/data.scm | 25 +++++++ website/apps/media/templates/components.scm | 25 ++++++- .../apps/media/templates/publication-list.scm | 46 +++++++++++++ website/apps/media/types.scm | 52 ++++++++++++++- website/static/base/img/link-arrow-shaper.svg | 66 +++++++++++++++++++ website/static/media/css/publications.css | 35 ++++++++++ 8 files changed, 274 insertions(+), 8 deletions(-) create mode 100644 website/apps/media/templates/publication-list.scm create mode 100644 website/static/base/img/link-arrow-shaper.svg create mode 100644 website/static/media/css/publications.css diff --git a/website/apps/base/templates/components.scm b/website/apps/base/templates/components.scm index b615f98..e2a74d3 100644 --- a/website/apps/base/templates/components.scm +++ b/website/apps/base/templates/components.scm @@ -461,8 +461,18 @@ manual. ,(menu-dropdown #:label (C_ "website menu" "Media") #:active-item active-item #:items (list - (C_ "website menu" (menu-item #:label "Videos" #:active-item active-item #:url (guix-url "videos/"))) - (C_ "website menu" (menu-item #:label "Screenshots" #:active-item active-item #:url (guix-url "screenshots/"))))) + (C_ "website menu" + (menu-item #:label "Videos" + #:active-item active-item + #:url (guix-url "videos/"))) + (C_ "website menu" + (menu-item #:label "Screenshots" + #:active-item active-item + #:url (guix-url "screenshots/"))) + (C_ "website menu" + (menu-item #:label "Publications" + #:active-item active-item + #:url (guix-url "publications/"))))) ,(C_ "website menu" (menu-item #:label "Donate" #:active-item active-item #:url (guix-url "donate/"))) diff --git a/website/apps/media/builder.scm b/website/apps/media/builder.scm index 53378e6..c270db5 100644 --- a/website/apps/media/builder.scm +++ b/website/apps/media/builder.scm @@ -6,11 +6,13 @@ (define-module (apps media builder) #:use-module (apps aux system) #:use-module (apps media data) + #:use-module (apps media templates publication-list) #:use-module (apps media templates screenshot) #:use-module (apps media templates screenshots-overview) #:use-module (apps media templates video) #:use-module (apps media templates video-list) #:use-module (apps media types) + #:use-module (haunt artifact) #:use-module (haunt html) #:use-module (haunt page) #:use-module (haunt utils) @@ -37,11 +39,13 @@ A list of post objects that represent articles from the blog. See Haunt objects for more information. - RETURN (list of ) - A list of page objects that represent the web resources of the - application. See Haunt objects for more information." + RETURN (list of and ) + A list of objects that represent the web resources of the + application. See Haunt and objects for more + information." (flatten - (list (screenshots-overview-builder) + (list (publication-list-builder) + (screenshots-overview-builder) (screenshots-builder) (videos-builder) (video-list-builder)))) @@ -51,6 +55,13 @@ ;;; Helper builders. ;;; +(define (publication-list-builder) + "Return a Haunt artifact representing the publications page." + (serialized-artifact (url-path-join "publications" "index.html") + (publication-list-t publications) + sxml->html)) + + (define (screenshots-builder) "Return a list of Haunt pages representing screenshot pages." (map diff --git a/website/apps/media/data.scm b/website/apps/media/data.scm index 9b1e2c5..8f4f2b0 100644 --- a/website/apps/media/data.scm +++ b/website/apps/media/data.scm @@ -9,6 +9,7 @@ #:use-module (apps media types) #:use-module (srfi srfi-19) #:export (playlists + publications screenshots)) @@ -98,6 +99,30 @@ distribution.")) #:last-updated (string->date "2020-03-28T16:00:00" "~Y-~m-~dT~H:~M:~S"))))) +(define publications + (list + (publication + #:title "Functional Package Management with Guix" + #:url "https://arxiv.org/abs/1305.4584" + #:authors (list "Ludovic Courtès") + #:date (string->date "2013-05-20" "~Y-~m-~d")) + (publication + #:title "Reproducible and User-Controlled Software Environments in HPC with Guix" + #:url "https://hal.inria.fr/hal-01161771/en" + #:authors (list "Ludovic Courtès" "Ricardo Wurmus") + #:date (string->date "2015-07-25" "~Y-~m-~d")) + (publication + #:title "Code Staging in GNU Guix" + #:url "https://arxiv.org/abs/1709.00833" + #:authors (list "Ludovic Courtès") + #:date (string->date "2017-09-04" "~Y-~m-~d")) + (publication + #:title "Guix: A most advanced operating system" + #:url "https://ambrevar.xyz/guix-advance/index.html" + #:authors (list "Pierre Neidhardt") + #:date (string->date "2019-01-14" "~Y-~m-~d")))) + + (define screenshots (list (screenshot diff --git a/website/apps/media/templates/components.scm b/website/apps/media/templates/components.scm index d928d23..e72b380 100644 --- a/website/apps/media/templates/components.scm +++ b/website/apps/media/templates/components.scm @@ -14,7 +14,8 @@ #:use-module (apps media types) #:use-module (apps media utils) #:use-module (srfi srfi-19) - #:export (screenshot->shtml + #:export (publication->shtml + screenshot->shtml screenshots-box video->shtml video-content @@ -25,6 +26,28 @@ ;;; Components. ;;; +(define (publication->shtml publication) + "Return an SHTML representation of the given publication object. + + PUBLICATION () + A publication object as defined in (apps media types)." + `(a + (@ (class "publication-preview") + (href ,(publication-url publication))) + + (h3 + (@ (lang ,(publication-language publication)) + (class "publication-title")) + ,(publication-title publication)) + + (p + (@ (class "publication-info")) + ,(G_ `("Published " + ,(date->string (publication-date publication) "~b ~d, ~Y") + " by " + ,(string-join (publication-authors publication) ", ")))))) + + (define (screenshot->shtml shot) "Return an SHTML representation of the given screenshot object. diff --git a/website/apps/media/templates/publication-list.scm b/website/apps/media/templates/publication-list.scm new file mode 100644 index 0000000..44847c7 --- /dev/null +++ b/website/apps/media/templates/publication-list.scm @@ -0,0 +1,46 @@ +;;; GNU Guix web site +;;; Public domain 2021 Luis Felipe López Acevedo + +(define-module (apps media templates publication-list) + #:use-module (apps base templates theme) + #:use-module (apps base types) + #:use-module (apps base utils) + #:use-module (apps i18n) + #:use-module (apps media templates components) + #:export (publication-list-t)) + + +(define (publication-list-t publications) + "Return the Publication list page in SHTML. + + PUBLICATIONS (list of ) + See the (apps media types) module for information on the + type." + (theme + #:title (C_ "webpage title" '("Publications")) + #:description + (G_ "A list of written publications about GNU Guix.") + #:keywords + ;; TRANSLATORS: |-separated list of webpage keywords. + (string-split (G_ "Publications|Papers") #\|) + #:active-menu-item (C_ "website menu" "Publications") + #:css (list + (guix-url "static/base/css/page.css") + (guix-url "static/media/css/publications.css")) + #:crumbs (list (crumb (C_ "website menu" "Publications") "./")) + #:content + `(main + (section + (@ (class "page")) + ,(G_ `(h2 "Publications")) + + ,(G_ + `(p + (@ (class "centered-block limit-width")) + + "The following is a list of written materials that talk about GNU Guix. It is a diverse collection of writings, from blog posts to grey literature to academic and research papers.")) + + (div + (@ (class "publication-list centered-block limit-width")) + + ,@(map publication->shtml publications)))))) diff --git a/website/apps/media/types.scm b/website/apps/media/types.scm index 50c0989..9054141 100644 --- a/website/apps/media/types.scm +++ b/website/apps/media/types.scm @@ -5,7 +5,14 @@ (define-module (apps media types) #:use-module (srfi srfi-9) - #:export (screenshot + #:export (publication + publication? + publication-authors + publication-date + publication-language + publication-title + publication-url + screenshot screenshot? screenshot-caption screenshot-image @@ -32,6 +39,49 @@ ;;; Data types. ;;; +;;; Publication (record type) +;;; ------------------------- +;;; +;;; A publication object represents a written material that talks about +;;; GNU Guix. +;;; +;;; Objects of this type can be created with the "publication" procedure +;;; (see Helper procedures below). +;;; +;;; Fields: +;;; +;;; title (string) +;;; The title of the publication. +;;; +;;; url (string) +;;; A URL to the publication. +;;; +;;; authors (list of string) +;;; The names of the authors. +;;; +;;; date (date) +;;; The date of publication. +;;; +;;; language (string) +;;; IETF language tag corresponding to the language in which the +;;; publication is written. +;;; +(define-record-type + (make-publication title url authors date language) + publication? + (title publication-title) + (url publication-url) + (authors publication-authors) + (date publication-date) + (language publication-language)) + +;;; Helper procedures. + +(define* (publication #:key title url authors date (language "en")) + "Return a object with the given attributes." + (make-publication title url authors date language)) + + ;;; Screenshot (record type) ;;; ------------------------ ;;; diff --git a/website/static/base/img/link-arrow-shaper.svg b/website/static/base/img/link-arrow-shaper.svg new file mode 100644 index 0000000..834fd84 --- /dev/null +++ b/website/static/base/img/link-arrow-shaper.svg @@ -0,0 +1,66 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/website/static/media/css/publications.css b/website/static/media/css/publications.css new file mode 100644 index 0000000..797918f --- /dev/null +++ b/website/static/media/css/publications.css @@ -0,0 +1,35 @@ +.publication-list { + margin-top: 2em; +} + +.publication-preview, +.publication-preview:link, +.publication-preview:visited { + display: block; + border-image: linear-gradient(to right, gray, transparent) 1; + border-style: none none solid none; + border-width: thin thick; + color: #4D4D4D; + padding: 20px 70px 20px 10px; + transition: border-width .2s cubic-bezier(.22,.61,.36,1); +} + +.publication-preview:active, +.publication-preview:focus, +.publication-preview:hover { + background-color: gold; + background-image: url("/static/base/img/link-arrow-shaper.svg"); + background-position: right; + background-repeat: no-repeat; + background-size: auto 100%; + border-image: linear-gradient(to right, #333, white, white) 1; + border-style: none none solid solid; +} + +.publication-title { + margin: 0px; +} + +.publication-info { + margin-bottom: 0px; +} base-commit: eeb5120135ad3f96f4aad2c7fa37364e6dca584b -- 2.31.1