GithubHelp home page GithubHelp logo

Post metadata about cryogen HOT 5 CLOSED

cryogen-project avatar cryogen-project commented on June 12, 2024
Post metadata

from cryogen.

Comments (5)

lacarmen avatar lacarmen commented on June 12, 2024

I would be open to adding :date to the post metadata but can you clarify what the use case for the :slug would be?

from cryogen.

niamu avatar niamu commented on June 12, 2024

:slug may ultimately be misplaced and should exist in the main config file. I haven't thought it through completely yet, to be honest.

The use case involves the situation where you want to alter the URL structure of your site. Currently (unless I'm mistaken) you can't have a post URL be something like example.com/posts/fizzbuzz or example.com/posts/1 where the post slug is just the title or an ID number or something else outside of the current fixed structure of YYYY-MM-DD-title.html.

I can imagine a solution to this involving some sort URL structure key in the main config.edn file.

from cryogen.

lacarmen avatar lacarmen commented on June 12, 2024

Currently (unless I'm mistaken) you can't have a post URL be something like example.com/posts/fizzbuzz or example.com/posts/1 where the post slug is just the title or an ID number or something else outside of the current fixed structure of YYYY-MM-DD-title.html.

Well if you want you use a structure outside of yyyy-MM-dd-title.md for the Markdown files then the :date parameter would take care of that by allowing you to just name your file as title.md.

Your use case is a little confusing to me. It sounds like you want to use the slug as a post's uri when it ultimately gets rendered into an html file so why should it exist in the main config file? This implies that the slug parameter should be post-specific, not global. If this is the use case that you're going for then it doesn't really seem like a feature worth adding because how often is a user going to name their Markdown file foo.md but want it to render as bar.html?

from cryogen.

niamu avatar niamu commented on June 12, 2024

I think that's a much clearer line of reasoning than I had. My only remaining use case that could be solved with some clever URL rewriting on the server is the case where you have a post called foo.md and it renders as foo.html but you actually want it rendered as foo/index.html. I know that this is something that Jekyll and other static site generators offer as an option, but it may not fit into the design goals of Cryogen.

Unless there are objections, I think I'll work on adding :date to the post metadata as a pull request over the next couple of days.

from cryogen.

lacarmen avatar lacarmen commented on June 12, 2024

It's still a very niche use case so I'd say go ahead with the :date parameter but let's leave out the :slug.

from cryogen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.