Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate of #2744 in order to generate a preview #2859

Closed
wants to merge 46 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
a2b922c
adds default RSS template
CSchoel Aug 9, 2023
cf78852
fixes error in default template
CSchoel Aug 9, 2023
5a0a4e5
sorts by date before limiting
CSchoel Aug 9, 2023
181a644
adds function for parsing dates (WIP)
CSchoel Aug 9, 2023
6cac3de
deletes old code
CSchoel Aug 10, 2023
0b5f5f2
adds documentation and small fixes for date finder
CSchoel Aug 10, 2023
71da472
makes pydocstyle happy
CSchoel Aug 10, 2023
5380adc
adds ingest_date to YAML data for papers
CSchoel Aug 10, 2023
3eee8bd
uses ingest date instead of parsed date where available
CSchoel Aug 10, 2023
49157a5
limits size of RSS files to 500 entries
CSchoel Aug 11, 2023
ad39aa1
uses fallback for getting date information by default
CSchoel Aug 11, 2023
e9b0c24
doubles the rssLimit to at least cover a full month
CSchoel Aug 11, 2023
a5766cf
makes rss available on main page
CSchoel Aug 19, 2023
7f8a727
adjusts how RSS feed is displayed
CSchoel Aug 19, 2023
6e222fa
adds news section
CSchoel Aug 19, 2023
a4c1930
avoids doubling of words
CSchoel Aug 19, 2023
cc8b289
mentions RSS feed alongside mailing list
CSchoel Aug 19, 2023
fefaa53
adds link to mailing list
CSchoel Aug 19, 2023
c4099b5
fixes language code
CSchoel Aug 19, 2023
ffdcb9c
adds missing newline
CSchoel Oct 23, 2023
5d60140
adds rss template to excludes
CSchoel Oct 23, 2023
5f6e692
don't use --replace-date by default
CSchoel Oct 23, 2023
80e371d
removes date handling code in favor of always using ingest date
CSchoel Oct 31, 2023
7d57f1c
removes leading slash from relative URLs
CSchoel Oct 31, 2023
8f2cf74
also makes download links "more correct" :D
CSchoel Oct 31, 2023
8aa3441
adds preview and date to ACL Anthology news
CSchoel Nov 1, 2023
115815a
ensures to include everything on the same date as the last selected page
CSchoel Nov 1, 2023
657a447
uses anthology ID as guid if available
CSchoel Nov 2, 2023
d08b547
removes author tag but adds paper author and volume info instead
CSchoel Nov 2, 2023
466089c
removes whitespace
CSchoel Nov 2, 2023
da4e93c
adds news to the navbar in the header
CSchoel Nov 2, 2023
f4bd784
removes safeHTML call from code that does not produce safe HTML
CSchoel Nov 3, 2023
db9ea87
Ingest LDK 2023 (#2834)
anthology-assist Oct 25, 2023
d14b94e
Update metadata from Papers with Code
acl-pwc-bot Oct 26, 2023
bd9ed04
Ingest ROCLING 2023 (#2846)
anthology-assist Oct 30, 2023
b083620
Remove attachments that only contain "please delete"
mbollmann Oct 29, 2023
ec631a4
Fix Mausam's name representation
mbollmann Oct 29, 2023
e5ea452
Fix other single-name representations
mbollmann Oct 29, 2023
8ad4b4b
Propagate volume "editor" field to contained papers (#2798)
mbollmann Oct 30, 2023
b46af35
INLG Cleanup (#2840)
anthology-assist Oct 31, 2023
f6254a6
Merge branch 'master' into cschoel_rss_and_blog
mbollmann Nov 4, 2023
4e53691
Merge branch 'master' into cschoel_rss_and_blog
mbollmann May 5, 2024
6e11cc6
Fix incorrectly merged pre-commit config
mbollmann May 5, 2024
90bc167
combines /posts and /news sections
CSchoel May 6, 2024
ec0e059
prioritizes description and uses summary as fallback both in RSS and …
CSchoel May 6, 2024
a4b512b
Merge remote-tracking branch 'origin/master' into cschoel_rss_and_blog
mjpost May 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ repos:
- id: check-ast
- id: check-merge-conflict
- id: check-xml
exclude: ^hugo/layouts/sitemap.xml$
exclude: |
(?x)^(
hugo/layouts/sitemap.xml|
hugo/layouts/_default/rss.xml
)$
- id: check-yaml
exclude: ^python/mkdocs.yml$
- id: end-of-file-fixer
Expand Down
7 changes: 6 additions & 1 deletion bin/create_hugo_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,14 @@ def create_papers(srcdir, clean=False):
if not os.path.exists(paper_dir):
os.makedirs(paper_dir)
with open("{}/{}.md".format(paper_dir, anthology_id), "w") as f:
date = entry["ingest_date"]
print("---", file=f)
yaml.dump(
{"anthology_id": anthology_id, "title": entry["title"]},
{
"anthology_id": anthology_id,
"title": entry["title"],
"date": date,
},
default_flow_style=False,
stream=f,
)
Expand Down
2 changes: 2 additions & 0 deletions bin/create_hugo_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ def export_anthology(anthology, outdir, clean=False, dryrun=False):
for id_, paper in anthology.papers.items():
log.debug("export_anthology: processing paper '{}'".format(id_))
data = paper.as_dict()
if paper.parent_volume.ingest_date:
data["ingest_date"] = paper.parent_volume.ingest_date
data["title_html"] = paper.get_title("html")
if "xml_title" in data:
del data["xml_title"]
Expand Down
1 change: 1 addition & 0 deletions hugo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ languageCode = "en-us"
title = "ACL Anthology"
disablePathToLower = true
staticDir = ["static", "data-export"]
rssLimit = 1000

[permalinks]
papers = "/:filename/"
Expand Down
2 changes: 1 addition & 1 deletion hugo/content/posts/_index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
Title: List of all posts
Title: List of all news pages
render_pagelist: true
---
18 changes: 18 additions & 0 deletions hugo/content/posts/announce_news.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
Title: New page for announcements and blog posts
date: "2024-05-06"
Description: >
The ACL Anthology website now has a dedicated section for blog posts and announcements as well as an RSS feed for papers. 🎉
---

The ACL Anthology website now has a dedicated section for blog posts and announcements.
If you want to stay up to date on the most important changes to the Anthology, you can subscribe to the [RSS feed for this section](/posts/index.xml).

We will keep the [existing mailing list](http://groups.google.com/group/acl-anthology?hl=en), so you will still get your updates if you are already subscribed.
This new section mainly makes our updates available to more apps and devices via RSS, and it gives them a more appealing look. ✨

There is one more thing that we want to announce with this post: We now also have an [RSS feed for papers](/papers/index.xml).
By subscribing to this, you get to see the individual papers added to the Anthology and never miss any of the latest developments in NLP and computational linguistics ever again! 🎉
The feed is limited to the latest 1000 papers, as the full file would be over 40 MB in size, otherwise. 🤯

We hope that you will enjoy these new features as much as we do, and we'll see you here for the next update!
2 changes: 1 addition & 1 deletion hugo/layouts/_default/index_flex.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h2 id="title" class="ml-2">Welcome to the ACL Anthology</h2>
The ACL Anthology currently hosts {{ $.Scratch.Get "paper_count" }} papers on the study of computational linguistics and natural language processing.
</div>
<div class="card-body">
<a href="http://groups.google.com/group/acl-anthology?hl=en">Subscribe to the mailing list</a> to receive announcements and updates to the Anthology.
<a href="http://groups.google.com/group/acl-anthology?hl=en">Subscribe to the mailing list</a> or the <a href="{{ "posts/index.xml" | relURL }}">RSS news feed</a> to receive announcements and updates to the Anthology.
</div>
</aside>
</div>
Expand Down
63 changes: 63 additions & 0 deletions hugo/layouts/_default/rss.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{{- $pctx := . -}}
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
{{- $pages := slice -}}
{{- if or $.IsHome $.IsSection -}}
{{- $pages = $pctx.RegularPages -}}
{{- else -}}
{{- $pages = $pctx.Pages -}}
{{- end -}}
{{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- if ge $limit 1 -}}
<!-- First get the last page that we *would* render given the rssLimit. -->
{{- $last_page := (sort $pages "Date" "desc") | first $limit | last 1 -}}
{{- $last_page = (index $last_page 0) -}}
<!-- Then re-do the selection by date, including all pages with the same date as the last entry. -->
{{- $pages = (sort (where $pages "Date" ">=" $last_page.Date) "Date" "desc") -}}
{{- end -}}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
<link>{{ .Permalink }}</link>
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
<generator>Hugo -- gohugo.io</generator>
<language>{{ site.LanguageCode }}</language>{{ with .Site.Author.email }}
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
{{- with .OutputFormats.Get "RSS" -}}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{- end -}}
{{ range $pages }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
<guid><!-- Prefer anthology id if it exists, use permalink otherwise. -->
{{- if isset .Params "anthology_id" -}}
{{- .Param "anthology_id" -}}
{{- else -}}
{{- .Permalink -}}
{{- end -}}
</guid>
<description>
{{- if isset .Params "anthology_id" -}}
{{- $volume_id := index (split .Params.anthology_id "-") 0 -}}
{{- $paper := index (index $.Site.Data.papers $volume_id) .Params.anthology_id -}}
{{- with $paper.author -}}
{{- delimit (apply $paper.author "index" "." "full") ", " " and " -}}
{{- end -}}
{{- $volume_nr := index (split (index (split .Params.anthology_id "-") 1) ".") 0 -}}
{{- $volume := index $.Site.Data.volumes (printf "%s-%s" $volume_id $volume_nr) -}}
{{- printf " in %s" $volume.title -}}
{{- else if .Description -}}
{{ .Description | html }}
{{- else -}}
{{ .Summary | html }}
{{- end -}}
</description>
</item>
{{ end }}
</channel>
</rss>
15 changes: 11 additions & 4 deletions hugo/layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
</script>
{{ end }}

{{ define "meta" }}
<link rel="alternate" type="application/rss+xml" href="{{ "papers/index.xml" | relURL }}" title="ACL Anthology Papers" />
{{ end }}

{{ define "main" }}
<div class="row justify-content-center">
{{ $.Scratch.Set "paper_count" 0 }}
Expand All @@ -30,7 +34,7 @@ <h2 class="pl-2 pb-2">Welcome to the ACL Anthology!</h2>
The ACL Anthology currently hosts {{ $.Scratch.Get "paper_count" }} papers on the study of computational linguistics and natural language processing.
</div>
<div class="card-body">
<a href="http://groups.google.com/group/acl-anthology?hl=en">Subscribe to the mailing list</a> to receive announcements and updates to the Anthology.
<a href="http://groups.google.com/group/acl-anthology?hl=en">Subscribe to the mailing list</a> or the <a href="{{ "posts/index.xml" | relURL }}">RSS news feed</a> to receive announcements and updates to the Anthology.
</div>
</aside>

Expand All @@ -47,12 +51,15 @@ <h2 class="pl-2 pb-2">Welcome to the ACL Anthology!</h2>
<div class="row mb-3">
{{ if (fileExists "/data-export/anthology.bib.gz") }}
<div class="col-6 col-xl-12 mb-2">
<a class="btn btn-block btn-info" href="{{ "/anthology.bib.gz" | relURL }}">Full Anthology as BibTeX ({{ printf "%.2f MB" (div (os.Stat "/data-export/anthology.bib.gz").Size 1000000.0) }})</a>
<a class="btn btn-block btn-info" href="{{ "/anthology+abstracts.bib.gz" | relURL }}">…with abstracts ({{ printf "%.2f MB" (div (os.Stat "/data-export/anthology+abstracts.bib.gz").Size 1000000.0) }})</a>
<a class="btn btn-block btn-info" href="{{ "anthology.bib.gz" | relURL }}">Full Anthology as BibTeX ({{ printf "%.2f MB" (div (os.Stat "/data-export/anthology.bib.gz").Size 1000000.0) }})</a>
<a class="btn btn-block btn-info" href="{{ "anthology+abstracts.bib.gz" | relURL }}">…with abstracts ({{ printf "%.2f MB" (div (os.Stat "/data-export/anthology+abstracts.bib.gz").Size 1000000.0) }})</a>
</div>
{{ end }}
<div class="col-6 col-xl-12 mb-2">
<a class="btn btn-block btn-warning" href="{{ ($.Site.GetPage "/faq/feedback.md").RelPermalink }}">Give feedback</a>
<a class="btn btn-block btn-warning" href="{{ "papers/index.xml" | relURL }}">RSS Feed (latest 1000 papers)</a>
</div>
<div class="col-6 col-xl-12 mb-2">
<a class="btn btn-block btn-success" href="{{ ($.Site.GetPage "/faq/feedback.md").RelPermalink }}">Give feedback</a>
</div>
</div>
</div><div class="col-12 col-xl-10 col-xl-width-auto">
Expand Down
3 changes: 3 additions & 0 deletions hugo/layouts/partials/header_navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav flex-grow-1 pr-md-2">
<li class="nav-item">
<a class="nav-link" href={{ relref . "/posts" }}>News<span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href={{ relref . "/faq" }}>FAQ<span class="sr-only">(current)</span></a>
</li>
Expand Down
26 changes: 26 additions & 0 deletions hugo/layouts/posts/list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{{ define "main" }}
<main>
<article>
<header>
<h1>{{.Title}}</h1>
</header>
<!-- "{{.Content}}" pulls from the markdown content of the corresponding _index.md -->
{{.Content}}
</article>
<ul>
<!-- Ranges through content/posts/*.md -->
{{ range .Pages.ByDate.Reverse }}
<li>
<a href="{{.Permalink}}">{{.Date.Format "2006-01-02"}} | {{.Title}}</a>
<p><small>
{{- if .Description -}}
{{ .Description }}
{{- else -}}
{{ .Summary }}...
{{- end -}}
</small></p>
</li>
{{ end }}
</ul>
</main>
{{ end }}
Loading