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

Add an RSS feed #110

Merged
merged 11 commits into from
Sep 6, 2021
Merged

Add an RSS feed #110

merged 11 commits into from
Sep 6, 2021

Conversation

Notgnoshi
Copy link
Owner

Closes #14
Closes #109

Use dcterms.available and dcterms.modified as defined by [1] and [2]
respectively.

This metadata will be consumed by a, as-of-yet WIP RSS feed generator.
Draft pages will get a published date of "DRAFT", and index pages will
not get the date metadata. The feed generator will ignore pages with a
DRAFT publish date, as well as pages with no publish date at all.

[1] https://www.dublincore.org/specifications/dublin-core/dcmi-terms/#http://purl.org/dc/terms/available
[2] https://www.dublincore.org/specifications/dublin-core/dcmi-terms/#http://purl.org/dc/terms/modified
Supported languages:

* ARM assembly (arm, armasm)
* Apache access log (accesslog)
* Awk
* Bash
* C
* C++
* CMake
* CSS
* Diff
* Dockerfile
* HTML, XML
* HTTP
* Intel x86 assembly (x86asm)
* JSON
* JavaScript
* Julia
* Julia REPL (julia-repl)
* LaTeX
* Makefile
* Markdown
* Nginx config
* Packet filter config
* Plain text
* PowerShell
* Python
* Python REPL (python-repl)
* Rust
* SQL
* Shell session (shell, console)
* TOML, INI
* Vim script (vim)
* YAML
The issue:

Using autoindex for directories without an index requires that the
directory $uri ends in a slash. But using trailing slashes with file
$uri's results in a 404.

Handle the following cases:

    $ docker restart nginx-root && sleep 0.5 && ./scripts/check-redirects.sh
    URL                                              Resolved URL                       HTTP Response
    http://localhost                                 http://localhost/                  200
    http://localhost/                                http://localhost/                  200
    http://localhost/index.html                      http://localhost/                  200
    http://localhost/index                           http://localhost/index             200     <-- Still undesirable
    http://localhost/css                             http://localhost/css/              200
    http://localhost/css/                            http://localhost/css/              200
    http://localhost/css/index.html                  http://localhost/css/              200
    http://localhost/vim                             http://localhost/vim               200
    http://localhost/vim/                            http://localhost/vim/              200
    http://localhost/vim/index.html                  http://localhost/vim/              200
    http://localhost/vim/index                       http://localhost/vim/index         200     <-- Still undesirable
    http://localhost/vim.html                        http://localhost/vim               200
    http://localhost/vim/text-objects                http://localhost/vim/text-objects  200
    http://localhost/vim/text-objects/               http://localhost/vim/text-objects  200
    http://localhost/vim/text-objects.html           http://localhost/vim/text-objects  200
    http://localhost/vim/text-objects/index.html     http://localhost/vim/text-objects  200
    http://localhost/graphviz                        http://localhost/graphviz          200
    http://localhost/graphviz/                       http://localhost/graphviz          200
    http://localhost/graphviz.html                   http://localhost/graphviz          200
    http://localhost/graphviz/index.html             http://localhost/graphviz          200
    http://localhost/404.html                        http://localhost/404               404
    http://localhost/blog/product-spaces             http://localhost/product-spaces    200
    http://localhost/blog/product-spaces/            http://localhost/product-spaces    200
    http://localhost/blog/product-spaces.html        http://localhost/product-spaces    200
    http://localhost/blog/product-spaces/index.html  http://localhost/product-spaces    200

Note that the Nginx documentation states that you shouldn't use 'if' in
a location block. You should almost always use try_files, return, or
rewrite. But I couldn't find a way to resolve the issue without it.

Closes #109
Note that the paragraphs containing blockquotes will need to be updated,
but that's more than I want to do now.
This time, add a script to do the formatting so I don't do more large
refactorings without reformatting.
@Notgnoshi Notgnoshi marked this pull request as ready for review September 6, 2021 19:00
@Notgnoshi Notgnoshi merged commit 8dac820 into master Sep 6, 2021
@Notgnoshi Notgnoshi deleted the ag/rss branch September 6, 2021 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

URLs with trailing slashes are broken Add an RSS feed
1 participant