Skip to content

Support blogging-like functionality #1197

Closed

Description

@fgregg

I love where this project is going!

I wonder if y'all would be open to considering adding support for jekyll's blogging pattern.

Namely, that if your markdown file is in a _posts directory, and if its titled like YEAR-MONTH-DAY-title.MARKUP then bloggy things happen:

For jekyll, this means that,

  1. The built html is put into a directory structure to get a nice url that looks like DOMAIN/YEAR/MONTH/DAY/title.html
  2. the page's date is made available to the layout template, so that the published date can be automatically inserted
  3. the site's posts are made available as an object you could interact with sites.posts i.e. to show the latest blog post on the front page jekyll lets you do something like this in an index.md.
---
layout: default
title: My Cool Blog
---

<h1>{{ site.posts.first.title }}</h1>
<p class="text-muted">{{ site.posts.first.date | date: '%B %d, %Y' }} | <a href="{{ site.posts.first.url }}">Permalink</a></p>

{{ site.posts.first.content }}
  1. jekyll does other things as well, but those would be the core of it.

I know that blogs are not your first target use case, but I think it could be a great place to go!

I'd be happy to contribute to this.

Activity

  1. added
    enhancement
    on Apr 3, 2024
  2. Fil commented on Apr 3, 2024

    @Fil
    Contributor

    bloggy things happen? :)

  3. fgregg commented on Apr 3, 2024

    @fgregg
    Author

    @Fil, sorry for not being more concrete. I put some details in it.

  4. Fil commented on Apr 3, 2024

    @Fil
    Contributor

    Interesting.

    I don't know how better it is to write 2024-04-01-april-fool.md than having files in folders such as 2024/04/01-april-fool.md. It's probably convenient for some, but is the gain worth the cost, that is, losing the univocal mapping between file and url, and making relative links even more of a headache? Conversely, if you want a flat folder, can't you live with flat urls?

    The "page's date is made available to the layout template" is related to #1036. I do want to have meta data (dates, authors, tags…) available to the page and to server-side rendering (SSR, #413).

    Inferring a date from a file name seems like a minor affordance; it could be an application of a hook for inferring the page's meta data from front matter & file contents (it's already the case with the title, which can come from either front matter or from the first H1).

    For page templates there was a previous attempt (in #253) with discussions and suggestions that I think are still relevant.

    It would be interesting to be able to show a (structured, formatted…) list of all pages on a given page, maybe also through SSR — the SSR function could itself have access to the configuration, or even read all the contents on disk (like minisearch does).

  5. Fil commented on Apr 3, 2024

    @Fil
    Contributor

    I think we should move this to a discussion, and create more actionable feature requests.

  6. fgregg commented on Apr 3, 2024

    @fgregg
    Author
  7. changed the title [-]support for jekyll-like blog patterns[/-] [+]Support blogging-like functionality[/+] on Apr 3, 2024
  8. locked and limited conversation to collaborators on Apr 3, 2024
  9. converted this issue into a discussion #1199 on Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions