Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Jul 2021 22:16:54 GMT
From:      "Danilo G. Baio" <dbaio@FreeBSD.org>
To:        doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org
Subject:   git: cafcba7d54 - main - website/events: Fix unique links
Message-ID:  <202107162216.16GMGsPf041560@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by dbaio:

URL: https://cgit.FreeBSD.org/doc/commit/?id=cafcba7d545f4785028bb7a7e8797efeac3c9d0b

commit cafcba7d545f4785028bb7a7e8797efeac3c9d0b
Author:     Danilo G. Baio <dbaio@FreeBSD.org>
AuthorDate: 2021-07-16 22:05:18 +0000
Commit:     Danilo G. Baio <dbaio@FreeBSD.org>
CommitDate: 2021-07-16 22:09:19 +0000

    website/events: Fix unique links
    
    Every time an event item is added, the entire chain of links is changed.
    
    All events already have an exclusive ID, so instead of generating a new
    reference for each item, point to it.
---
 website/themes/beastie/layouts/events/events.rss.xml | 2 +-
 website/themes/beastie/layouts/events/list.html      | 3 ---
 website/themes/beastie/layouts/events/single.html    | 3 ---
 website/themes/beastie/layouts/partials/events.html  | 2 +-
 4 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/website/themes/beastie/layouts/events/events.rss.xml b/website/themes/beastie/layouts/events/events.rss.xml
index 194a747341..aaf582bc6b 100644
--- a/website/themes/beastie/layouts/events/events.rss.xml
+++ b/website/themes/beastie/layouts/events/events.rss.xml
@@ -30,7 +30,7 @@
                 </description>
               {{ end }}
               <link>{{ .url }}</link>
-              <guid>{{ .url }}</guid>
+              <guid>{{ absLangURL ($.Site.BaseURL) }}events/#{{ .id }}</guid>
             </item>
           {{ end }}
         {{ end }}
diff --git a/website/themes/beastie/layouts/events/list.html b/website/themes/beastie/layouts/events/list.html
index 29c1afffd1..8384a25a97 100644
--- a/website/themes/beastie/layouts/events/list.html
+++ b/website/themes/beastie/layouts/events/list.html
@@ -109,7 +109,6 @@
                       {{ if and (ge (dateFormat "20060102" .endDate) (dateFormat "20060102" now)) (eq (dateFormat "2006-1" .endDate) $yearMonth) }}
                         <li id="{{ .id }}">
                           <p>
-                            <a id="{{ dateFormat "2006-01" .endDate }}:{{ $eventsCounter }}"></a>
                             <b><a href="{{ .url }}">{{ .name }}</a></b>, {{ .site }}, {{ .city }}, {{ .country }}
                             <br />
                             <em>{{ dateFormat "02" .startDate }} - {{ dateFormat "02 January, 2006" .endDate }}</em>
@@ -140,7 +139,6 @@
                       {{ if and (lt (dateFormat "20060102" .endDate) (dateFormat "20060102" now)) (eq (dateFormat "2006-1" .endDate) $yearMonth) }}
                         <li id="{{ .id }}">
                           <p>
-                            <a id="{{ dateFormat "2006-01" .endDate }}:{{ $eventsCounter }}"></a>
                             <b><a href="{{ .url }}">{{ .name }}</a></b>, {{ .site }}, {{ .city }}, {{ .country }}
                             <br />
                             <em>{{ dateFormat "02" .startDate }} - {{ dateFormat "02 January, 2006" .endDate }}</em>
@@ -186,7 +184,6 @@
                   {{ if and (lt (dateFormat "20060102" .endDate) (dateFormat "20060102" now)) (eq (dateFormat "2006-1" .endDate) $yearMonth) }}
                     <li id="{{ .id }}">
                       <p>
-                        <a id="{{ dateFormat "2006-01" .endDate }}:{{ $eventsCounter }}"></a>
                         <b><a href="{{ .url }}">{{ .name }}</a></b>, {{ .site }}, {{ .city }}, {{ .country }}
                         <br />
                         <em>{{ dateFormat "02" .startDate }} - {{ dateFormat "02 January, 2006" .endDate }}</em>
diff --git a/website/themes/beastie/layouts/events/single.html b/website/themes/beastie/layouts/events/single.html
index 29c1afffd1..8384a25a97 100644
--- a/website/themes/beastie/layouts/events/single.html
+++ b/website/themes/beastie/layouts/events/single.html
@@ -109,7 +109,6 @@
                       {{ if and (ge (dateFormat "20060102" .endDate) (dateFormat "20060102" now)) (eq (dateFormat "2006-1" .endDate) $yearMonth) }}
                         <li id="{{ .id }}">
                           <p>
-                            <a id="{{ dateFormat "2006-01" .endDate }}:{{ $eventsCounter }}"></a>
                             <b><a href="{{ .url }}">{{ .name }}</a></b>, {{ .site }}, {{ .city }}, {{ .country }}
                             <br />
                             <em>{{ dateFormat "02" .startDate }} - {{ dateFormat "02 January, 2006" .endDate }}</em>
@@ -140,7 +139,6 @@
                       {{ if and (lt (dateFormat "20060102" .endDate) (dateFormat "20060102" now)) (eq (dateFormat "2006-1" .endDate) $yearMonth) }}
                         <li id="{{ .id }}">
                           <p>
-                            <a id="{{ dateFormat "2006-01" .endDate }}:{{ $eventsCounter }}"></a>
                             <b><a href="{{ .url }}">{{ .name }}</a></b>, {{ .site }}, {{ .city }}, {{ .country }}
                             <br />
                             <em>{{ dateFormat "02" .startDate }} - {{ dateFormat "02 January, 2006" .endDate }}</em>
@@ -186,7 +184,6 @@
                   {{ if and (lt (dateFormat "20060102" .endDate) (dateFormat "20060102" now)) (eq (dateFormat "2006-1" .endDate) $yearMonth) }}
                     <li id="{{ .id }}">
                       <p>
-                        <a id="{{ dateFormat "2006-01" .endDate }}:{{ $eventsCounter }}"></a>
                         <b><a href="{{ .url }}">{{ .name }}</a></b>, {{ .site }}, {{ .city }}, {{ .country }}
                         <br />
                         <em>{{ dateFormat "02" .startDate }} - {{ dateFormat "02 January, 2006" .endDate }}</em>
diff --git a/website/themes/beastie/layouts/partials/events.html b/website/themes/beastie/layouts/partials/events.html
index 0852e870cc..b4bdb21ce5 100644
--- a/website/themes/beastie/layouts/partials/events.html
+++ b/website/themes/beastie/layouts/partials/events.html
@@ -18,7 +18,7 @@
             <p>
               <span class="txtdate">{{ dateFormat "2006-01-02" .startDate }} - {{ dateFormat "2006-01-02" .endDate }}</span>
               <br />
-              <a href="{{ if (fileExists $eventsPath) -}}{{ .Site.BaseURL | relLangURL }}{{ else }}{{ $.Site.BaseURL }}{{- end }}events/#{{ dateFormat "2006-01" .endDate }}:{{ $eventsCounter }}">
+              <a href="{{ if (fileExists $eventsPath) -}}{{ .Site.BaseURL | relLangURL }}{{ else }}{{ $.Site.BaseURL }}{{- end }}events/#{{ .id }}">
                 {{ .name }}
                 <br />
                 {{ if or (.city) (.country) }}({{end}}{{ if .city }}{{ .city }},{{ end }} {{ if .country }}{{ .country }}{{ end }}{{ if or (.city) (.country) }}){{end}}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202107162216.16GMGsPf041560>