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 support for Permalinks functionality / More flexible URL Management #145

Open
delize opened this issue Dec 26, 2023 · 0 comments
Open

Comments

@delize
Copy link

delize commented Dec 26, 2023

Is your feature request related to a problem? Please describe.
I prefer to to use a blog posting style of:

permalinks:
    post: /:year/:slug/
    page: /:slug/

This way, if I make another post about a previous topic that is an update for example, the name can stay the same for the subject and gather the same hits/traffic (potentially), while I reference the older posting.

However, when, trying to place this into the config.yaml file, it has no effect.

I have tried sticking it under different sections of the YAML config, but to no success.

So when writing blog posts, instead of them displaying as:
http://localhost:2424/blog/title-of-blog/

They display:
http://localhost:2424/blog/2023/title-of-blog/

Describe the solution you'd like
Allow end-users of the theme the ability to customize, preferably overriding the default behavior, of the URL management that is default for Hugo-Profile using the Permalink Configuration Options for Hugo Site Configuration.

This would allow users to decide what URL scheme they wish to follow, while making Hugo more flexible overall.

Personally, my main goal, is to have the "Recent Posts" footer element (which I believe should be it's own section, but that is a different FR), be able to use the slug for URL redirection on the "Read" button. However, this should be able to be accomplished on both the blog level and the "Recent Posts" level.

image

Currently redirects to:
http://localhost:2424/blog/title-of-blog/

Where I would like it to automatically recognize and pick up:
http://localhost:2424/blog/2023/title-of-blog/
http://localhost:2424/blog/2023/title-of-blogpost-1/
http://localhost:2424/blog/2022/title-of-blog/
http://localhost:2424/blog/2022/title-of-blogpost-2/

Based on the frontmatter of the blog posts being written.

Describe alternatives you've considered
I don't know of many other alternatives to achieve the same result without making massive modifications to the codebase, and since I am a new user of Hugo-Profiles and Hugo (transitioning from Jekyll), I don't want to dive that deep into that yet.

Edit / Note:

The reason that I am using :2424 is I am testing this as it would appear if published to Cloudflare Pages.

When using hugo serve and :1313, the behavior is the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant