GithubHelp home page GithubHelp logo

hideoo / starlight-blog Goto Github PK

View Code? Open in Web Editor NEW
112.0 4.0 12.0 1.78 MB

Starlight plugin to add a blog to your documentation

Home Page: https://starlight-blog-docs.vercel.app

License: MIT License

Shell 0.10% JavaScript 0.59% TypeScript 78.99% Astro 20.32%
astro blog documentation starlight plugin

starlight-blog's Introduction

starlight-blog πŸ“°

Starlight plugin to add a blog to your documentation.

Screenshot of starlight-blog

Getting Started

Want to get started immediately? Check out the getting started guide or check out the demo to see the plugin in action.

Features

A Starlight plugin to add a blog to your documentation site.

  • Link to the blog in the header
  • Post list with pagination
  • Global and per-post authors
  • Tags
  • Cover images
  • Custom sidebar with recent posts and tags
  • RSS

License

Licensed under the MIT License, Copyright Β© HiDeoo.

See LICENSE for more information.

starlight-blog's People

Contributors

hideoo avatar julien-deramond avatar lorenzolewis avatar oluwatobiss avatar sarah11918 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

starlight-blog's Issues

Possibility to use the `excerpt` content for RSS content

Is your feature request related to a problem?

Sort of!

Most of the time, my blog posts include and render Astro components, so the rendering within the RSS feed is not that readable as is:

Screenshot 2024-07-03 at 20 13 51

We can see there for instance a import ProjectThumbnail from '../../../components/ProjectThumbnail.astro' at the beginning of the feed.

Describe the solution you'd like

It's probably not a common use case for starlight-blog, but I think being able to use another content via the interface could be useful.

I'm thinking about giving the possibility to use the excerpt for instance in the plugin configuration by adding a new parameter. Maybe something like:

starlightBlog({
  rss: {
    excerptAsContent: true // false by default
  }
})

It would be transparent for the majority of users. And folks having complex content to render could use the excerpt to have a text without "embellishments".

Note: If not having the entire blog post in the feed is not a good practice (I'm not used to use them a lot), feel free to close this issue.

Describe alternatives you've considered

I'm not sure if it'd be possible, but another alternative would be to override what's done by default by starlight-blog to create my own RSS "rendering".

Additional Context

No response

Make Blog Updates available

Is your feature request related to a problem?

Currently the only way of letting readers know that the blog was updated after its creation is the lastUpdated frontmatter, which isn't pretty obvious to find on the bottom of the page.

Some common blog websites have an extra field for the updated date and I think it wouldn't be that hard to integrate a new frontmatter or rewrite the current one with a field displayed next to the creation date for an updated date (not required of course).

Describe the solution you'd like

A frontmatter prop (like dateUpdated) which displays the date next to the creation date (date frontmatter), so that the reader quickly sees that there have been changes (recently)...

Describe alternatives you've considered

If nobody needs this, than I'll stick to the lastUpdated frontmatter, but still would be happy to some this small feature implemented in some future... (maybe in another universe...)

Additional Context

No response

Duplicate Search Results

Describe the bug

Whenever using the search, there are duplicate results for blog posts, looks like the search also includes tag pages. Including pagefind: false in the post frontmatter seems to remove a few of the duplicate results, but you also lose being able to search in the specific blog page rather than the entirety of the blog at once

image

To Reproduce

  1. Create a project with starlight-blog
  2. Create a blog post
  3. Search for something within the blog

You can see an example with the starlight-blog docs
image

Expected behavior

It should only display one result, which would preferably be the main blog post. Such as this example (using Docusaurus/Algolia)

image

How often does this bug happen?

Every time

System Info

n/a

Additional Context

No response

i18n integration

Is your feature request related to a problem?

Summary: Currently, the /blog route generated by the plugin doesn't seem to be supporting an i18n project.
In my project, I have a root locale (fr), and another locale (en) in its own folder, as seen below.

.
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ content/
β”‚   β”‚   β”œβ”€β”€ docs/
β”‚   β”‚   β”‚   β”œβ”€β”€ en/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ blog/
β”‚   β”‚   β”‚   β”‚   β”‚   └── first-article.md
β”‚   β”‚   β”‚   β”‚   β”‚   └── second-article.md
β”‚   β”‚   β”‚   β”‚   └── about.mdx
β”‚   β”‚   β”‚   β”‚   └── index.mdx
β”‚   β”‚   β”‚   β”œβ”€β”€ blog/
β”‚   β”‚   β”‚   β”‚   └── premier-article.md
β”‚   β”‚   β”‚   β”‚   └── deuxieme-article.md
β”‚   β”‚   β”‚   └── a-propos.mdx
β”‚   β”‚   β”‚   └── index.mdx
β”‚   β”‚   └── config.ts
β”‚   └── env.d.ts
β”œβ”€β”€ astro.config.mjs

However, when I try to set up a blog for the other locale (under docs/en/blog) I run into problems.

  • on the home page, I navigate to /blog, then hit the language switch => /en/blog returns 404
  • on the home page, I hit the language switch to get to /en, then navigate to blog => falls back to French /blog/

Describe the solution you'd like

The plug-in should accommodate an i18n setup.
Creating a /blog folder in the different locales folders should generate a blog homepage and link accessible via /locale/blog/

Describe alternatives you've considered

No response

Additional Context

As the plug-in documentation doesn't refer to i18n, I still tried to set up a blog for the other locale (under docs/en/blog), but ran into problems described above.

Thank you for your time.

Remove /blog, and make everything under /

Is your feature request related to a problem?

My website works heavily with sub-domain, so as you can assume, my blog site is my domain with blog in front of it. The /blog that always comes after just looks werid

Describe the solution you'd like

Maybe make it so that we can set prefix to an empty string, and if it is, then just put everything in root.

Describe alternatives you've considered

I already tried the above solution, and it didn't work. I would also like the /blog page, which shows all the posts to be my main site, that is found when you visit the plain URL of blog..

Additional Context

No response

Blog post will not show relevant frontmatter in conjunction with starlight-image-zoom

Describe the bug

When using both starlightImageZoom() and starlightBlog() (in that order), they for the most part, work together. However, on the blog post itself, frontmatter such as date/cover/author is not displayed. When using starlightBlog() and starlightImageZoom() (in that order), the frontmatter does show but starlightImageZoom() will not work anymore.

To Reproduce

  1. In astro.config.mjs, include both plugins in the relevant order inside starlight integration. Should look like this:
export default defineConfig({
  integrations: [starlight({
    plugins: [starlightImageZoom(), starlightBlog()],
    // other code unrelated
  1. Create a new blog post (.md or .mdx file) in the src/content/docs/blog/ directory with frontmatter pertaining to starlight-blog

Expected behavior

The blog function should work, you will be able to see the sidebar change with recent posts, tags, and all posts. However, when clicking on a blog post, the frontmatter such as date/author/cover will not display.

How often does this bug happen?

Every time

System Info

Operating system: Windows 11 Pro Version 23H2
Browser: Google Chrome version 126.0.6478.127 (Official Build) (64-bit)
Astro version: v4.11.0

Additional Context

Blog post

image

Frontmatter inside blog post

---
title: Wazuh + SOAR Implementation
date: 2024-06-30
excerpt: My very first project! Creating a makeshift SOC featuring SIEM, SOAR and case management.
cover:
  alt: soc automation
  image: /src/assets/project1.svg
tags:
  - Projects
authors:
  name: asd
  title: asd
  picture: https://avatars.githubusercontent.com/u/64679603
  url: https://www.google.com/
---

Console logs

11:49:04 [WARN] [starlight-blog-plugin] It looks like you already have a MarkdownContent component override in your Starlight configuration.

11:49:04 [WARN] [starlight-blog-plugin] To use starlight-blog, either remove your override or update it to render the content from starlight-blog/overrides/MarkdownContent.astro.

Feature Request - Add option to disable warning

Is your feature request related to a problem?

After setting a custom ThemeSelect i get presented with the following in my log:

02:40:47 [WARN] [starlight-blog-plugin] It looks like you already have a `ThemeSelect` component override in your Starlight configuration.
02:40:47 [WARN] [starlight-blog-plugin] To use `starlight-blog`, remove the override for the `ThemeSelect` component.

Describe the solution you'd like

I would love a toggle in the config to disable these warnings

Describe alternatives you've considered

This does not cause any real issue, more of just a console annoyance. for advanced use cases it would be nice to be able to disable the console warning when its intended that you are remapping the components for your setup.

Additional Context

No response

the updateDate and lastUpdated should have the same value

Describe the bug

I am currently using the lastUpdated global config so under every page there is a lastUpdated date

it would be nice if they both had the same value

To Reproduce

  1. turn on LastUpdated in Astro config
  2. the date is shown when you scroll down insted of next to the link

Expected behavior

when turning on LastUpdated global config it should show the date up not down

How often does this bug happen?

Every time

System Info

No response

Additional Context

No response

An error " Cannot read properties of undefined (reading 'endsWith')" occurs when i run build

Describe the bug

error Cannot read properties of undefined (reading 'endsWith')
File:
node_modules/.pnpm/starlight-blog@0.2.1_@astrojs[email protected][email protected]/node_modules/starlight-blog/Tags.astro
Stacktrace:
TypeError: Cannot read properties of undefined (reading 'endsWith')

To Reproduce

with these pkgs of version:

"@astrojs/starlight": "^0.9.1",
"astro": "^3.0.6",
"starlight-blog": "^0.2.1"

run

pnpm run build

Expected behavior

Build Successful

How often does this bug happen?

Every time

System Info

macos;

Additional Context

No response

Integration of a Persistent Navigation Link between Blog and Documentation Sections

Is your feature request related to a problem?

Yes, it's related to navigation issues within the site.

Describe the solution you'd like

I would like a feature where a persistent navigation link or button is available that connects the blog section directly back to the documentation/wiki part of the site. This could be a simple "Back to Documentation" button or a more integrated navigational element in the site's header or sidebar.

Describe alternatives you've considered

No response

Additional Context

No response

Blog Links do not respect Astro Base url setting

Describe the bug

If I have my base setting in Astro's astro.config.mjs defineConfig({}) of base: 'mysite',, then starlight-blog should generate links that use that config. But all links in starlight-blog are / instead.

For example base: 'mysite' should make the "blog" link in the navbar be localhost:port/mysite/blog but instead it's localhost:port/blog. Same for any links within the blog pages (if you know the url to access them and type them by hand).

I should mention my site is on Github Pages, to be colocated near my github project and since I don't want to shell out for a domain name. Github page urls are always my-account.github.io/my-repo/ so I always need to use the base for astro sites on it. I was hoping to use the blog module just for site update news.

Thanks for the nice module, hopefully I get to use it soon!

P.S. I would love the i18n #9 issue to get some love too but that's not nearly as high priority.

To Reproduce

set base setting in defineConfig(), load your site, click on any links generated by starlight-blog to get a bad link.

Expected behavior

It should take base into account.

How often does this bug happen?

Every time

System Info

No response

Additional Context

Adam M and Fryuni in Discord #starlight helped me out to make sure this wasn't just my noobness. They looked into it a bit and mentioned you may need to look at these files, but I don't know the project myself:

They also mentioned withastro/astro#10303 which is a similar problem elsewhere but documents the solution, using import.meta.env.BASE_URL to get the prefix that should be added.

Co-exist with starlight documentation

Is your feature request related to a problem?

I have starlight docs page that lives at /docs on my website. I'd love to also have a /blog route that uses this package but I wasn't able to get the two to co-exist.

Describe the solution you'd like

Do you know if it's possible or how difficult this would be to support?

Describe alternatives you've considered

No response

Additional Context

No response

Support for social images

Is your feature request related to a problem?

It would be nice to allow to add social images and an hero images. I say plural because I would expect to handle/provide images for dark and light themes.

Describe the solution you'd like

Optional fields in the frontmatter should be enough

Describe alternatives you've considered

No response

Additional Context

I wanted to move the Biome blog to this integration, but we would lost the social images

the installation steps in README is not working.

Describe the bug

Follow the steps in readme, after npm run dev, I got

> [email protected] dev
> astro dev

Re-optimizing dependencies because vite config has changed
16:49:06 [WARN] The injected route "/blog/tags/[tag]" by starlight-blog specifies the entry point with the "entryPoint" property. This property is deprecated, please use "entrypoint" instead.
16:49:06 [WARN] The injected route "/blog/[...page]" by starlight-blog specifies the entry point with the "entryPoint" property. This property is deprecated, please use "entrypoint" instead.
16:49:07 [vite] Re-optimizing dependencies because vite config has changed

 astro  v4.2.0 ready in 390 ms

┃ Local    http://localhost:4321/
┃ Network  use --host to expose

Looks like the blog is not enabled.

http://localhost:4321/ still shows the default starlight index.

To Reproduce

follow the installation procedure in readme.md

Expected behavior

should be able to see the blog

How often does this bug happen?

Every time

System Info

No response

Additional Context

No response

monorepo

Is your feature request related to a problem?

I really like your work @HiDeoo. While working with your code, I had some issues, especially since you are using some dependencies on your own code like your personal eslint configs etc. I found it a bit cumbersome to have to search for these on github to understand what is inside of them. It would be way more convenient, if they would be already on my disk, which would mean a monorepo. I think that approach would work quite well for a lot of your packages, for example also starlight-typedoc etc. Since you are already using pnpm workspaces, you already seem to know the gist. I can recommend turbo and changesets as additional tools to speed up things.

Describe the solution you'd like

See above.

Describe alternatives you've considered

No response

Additional Context

No response

Cannot read properties of undefined (reading 'endsWith')

Describe the bug

This bug appear when i start the local website

To Reproduce

  1. Follow the install procedure
  2. Start with npm run dev
  3. The error just appear

Expected behavior

I just want to add blog because we need to post update of a game in it

How often does this bug happen?

Every time

System Info

No response

Additional Context

Here is the full error:

error Cannot read properties of undefined (reading 'endsWith')
File:
E:\VRCFR Site Web\vrcfr-creators-ts\eval at instantiateModule (file:\E:\VRCFR%20Site%20Web\vrcfr-creators-ts\node_modules\vite\dist\node\chunks\dep-df561101.js:55971:28
Stacktrace:
TypeError: Cannot read properties of undefined (reading 'endsWith')
at eval (eval at instantiateModule (file:///E:/VRCFR%20Site%20Web/vrcfr-creators-ts/node_modules/vite/dist/node/chunks/dep-df561101.js:55971:28), :62:63)
at AstroComponentInstance.Page [as factory] (eval at instantiateModule (file:///E:/VRCFR%20Site%20Web/vrcfr-creators-ts/node_modules/vite/dist/node/chunks/dep-df561101.js:55971:28), :21:12)
at AstroComponentInstance.init (eval at instantiateModule (file:///E:/VRCFR%20Site%20Web/vrcfr-creators-ts/node_modules/vite/dist/node/chunks/dep-df561101.js:55971:28), :32:29)
at bufferHeadContent (file:///E:/VRCFR%20Site%20Web/vrcfr-creators-ts/node_modules/astro/dist/runtime/server/render/astro/render.js:106:37)
at async renderToReadableStream (file:///E:/VRCFR%20Site%20Web/vrcfr-creators-ts/node_modules/astro/dist/runtime/server/render/astro/render.js:46:5)
at async renderPage (file:///E:/VRCFR%20Site%20Web/vrcfr-creators-ts/node_modules/astro/dist/runtime/server/render/page.js:29:12)
at async renderPage (file:///E:/VRCFR%20Site%20Web/vrcfr-creators-ts/node_modules/astro/dist/core/render/core.js:45:20)
at async #tryRenderRoute (file:///E:/VRCFR%20Site%20Web/vrcfr-creators-ts/node_modules/astro/dist/core/pipeline.js:99:18)
at async DevPipeline.renderRoute (file:///E:/VRCFR%20Site%20Web/vrcfr-creators-ts/node_modules/astro/dist/core/pipeline.js:46:20)
at async handleRoute (file:///E:/VRCFR%20Site%20Web/vrcfr-creators-ts/node_modules/astro/dist/vite-plugin-astro-server/route.js:155:18)

Display images in full-text RSS feed

Is your feature request related to a problem?

Sort of!

The RSS feed shows full-text in my feed reader (The Old Reader), but the images do not display. Instead, the alt-text is displayed.

image

Describe the solution you'd like

I would love it if the full text of my RSS feeds displayed any included images.

Describe alternatives you've considered

I have not tested other feed readers besides The Old Reader so I don't know how common this issue is among feed readers/client.

Additional Context

No response

RSS Feed

Is your feature request related to a problem?

I wanna be able add an RSS feed to my blogs.

Describe the solution you'd like

For there is be a way to generate the RSS Feed for the blog.

Describe alternatives you've considered

I'm very new to website creation, and Astro in general. I only understand RSS from a user perspective, and don't understand how it works. It seems to be a file hosted in a server, that updates every time a new blog post is posted. Hence, why, I decided to ask here if that could become a feature.

Additional Context

No response

Frontmatter to flag as draft/unpublished

Is your feature request related to a problem?

Hey @HiDeoo, huge fan of what you've made. It would be great if we could mark posts that aren't yet ready to be published.

Describe the solution you'd like

One of these new frontmatter propeties:

draft: true
isDraft: true
published: false (default: true)
isPublished: false (default: true)

Then when you're ready to publish, simply remove that line.

Describe alternatives you've considered

Alternatively, a _drafts directory. Then when you're ready to publish, simply drag+drop into the main folder.

Additional Context

No response

Author's picture isn't optimised

Describe the bug

The dev toolbar complains about the images not being optimized
Screenshot 2024-06-15 at 14 19 01

To Reproduce

Define an author with a remote URL:

					ema: {
						"name": "Emanuele Stoppa",
						"picture": "https://avatars.githubusercontent.com/u/602478?v=4",
						"url": "https://twitter.com/ematipico"
					}

Expected behavior

I expect no warnings from the dev toolbar

How often does this bug happen?

Every time

System Info

No response

Additional Context

No response

Astro's `srcDir` seems to be not supported

Describe the bug

The plugin doesn't seem to be taking into an account srcDir

To Reproduce

  1. Have a config like this
// https://astro.build/config
export default defineConfig({
  srcDir: ".",
}
  1. Setup the blog
  2. Run astro build
  3. Fail with [vite]: Rollup failed to resolve import "/src/content/config.ts" from "virtual:starlight/collection-config".

Expected behavior

It builds instead of failing

How often does this bug happen?

Every time

System Info

No response

Additional Context

A temporary fix is just to have src/content/config.ts copy as well

Updated dependencies, now unable to build project due to rss.xml

Describe the bug

running pnpm run build gives

20:34:49 [ERROR] [vite] x Build failed in 3.74s
[vite:build-import-analysis] [plugin vite:build-import-analysis] pages/_prefix_/rss.xml.astro.mjs (1:1): Parse error @:1:1

1  |  import { o as objectType, a as stringType, u as unionType, n as numberType, d as dateType, b as arrayType, r as recordType, f as functionType, p as promiseType, c as anyType, e as preprocessType, g as booleanType } from '../../chunks/user-config_CU5WHklU.mjs';
   |   ^
2  |  import { y as yellow } from '../../chunks/astro/server_gqeVL1Yw.mjs';
3  |  import { c as config, g as getBlogEntries, a as context, b as getPathWithBase } from '../../chunks/content_D1pq9u3f.mjs';

  Stack trace:
    at parse$f (file:///Users/visual/Developer/ProjectSources/ChefKiss/ChefKissInc.github.io/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-D8YhmIY-.js:20510:585)
    at file:///Users/visual/Developer/ProjectSources/ChefKiss/ChefKissInc.github.io/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:19808:40
 ELIFECYCLE  Command failed with exit code 1.

To Reproduce

  1. pnpm up --latest
  2. pnpm run build

Expected behavior

site builds successfully

How often does this bug happen?

Every time

System Info

  • OS: macOS
  • OS version: 15.0 Beta (24A5289h)
  • CPU: M3

Additional Context

Screenshot 2024-07-20 at 20 46 30

Add frontmatter reading time

Is your feature request related to a problem?

Many blog posts have a short timespan given in minutes as a estimated reading time for the whole blog post. This feature would perfectly fit for this project to I think.

Describe the solution you'd like

Add another frontmatter field which is called something like readingTime and put the {value}min next to the creation date or something.

Describe alternatives you've considered

No response

Additional Context

I'm willing to create a PR for this.

Embed Image Support

Is your feature request related to a problem?

Porting from docusaurus to starlight(-blog) There is no embed image support. For eg- https://socialsharepreview.com/?url=https://wiki.x266.mov/blog/svt-av1-deep-dive and https://socialsharepreview.com/?url=https://codec-wiki.pages.dev/blog/svt-av1-deep-dive/

Describe the solution you'd like

In frontmatter using image:

---
title: "Encoding Animation with SVT-AV1: A Deep Dive"
description: "With the recent release of SVT-AV1 1.8.0, how does it stack up for encoding animation?"
slug: svt-av1-deep-dive
authors:
- name: Trix
  title: Encoder
  url: https://github.com/trixoniisama/
  image_url: https://avatars.githubusercontent.com/u/93526043
tags: [video, compression, benchmarks]
image: /img/svt-1.8.0-testing-blog-image.webp
hide_table_of_contents: false
---


### Describe alternatives you've considered

A auto generated embed image(if not specified in frontmatter) is also desirable but not necessary

### Additional Context

_No response_

Next/Prev are opposite of what you would expect

Is your feature request related to a problem?

The native Next/Prev of Starlight makes sense for docs where you're moving to the next article in the documentation. But for docs you would expect Next to go to the next most recent blog post (i.e up the left nav, not down left nav).

This would also improve support for blog posts in a series (e.g. if I post a series of 3 posts, I can publish them one day apart, and then clicking Next would go to the next post in the series).

Describe the solution you'd like

A isNextPrevChronological flag that defaults to true

Describe alternatives you've considered

No response

Additional Context

https://codegenie.codes/blog/aws-cognito-user-pools-sign-in-with-email-google-saml--and-link-to-a-single-user/

Breaking change in Starlight 0.9.1

Describe the bug

It looks like Starlight 0.9.1 introduced some changes in withastro/starlight#647 that change the internals that this integration relies on and are now breaking builds: tauri-apps/tauri-docs#1533

To Reproduce

Update to Starlight 0.9.1 and attempt to build with the blog integration.

Expected behavior

No go boom πŸ’₯

How often does this bug happen?

Every time

System Info

No response

Additional Context

No response

Respect trailingSlash option of starlight

Is your feature request related to a problem?

Right now, starlight-blog hardcodes all paths with no trailing slash. But the base starlight config allows setting trailing slash preference (in my case always). However the Blog engine will not respect that, which leads to unnecessary redirects when deployed.

Describe the solution you'd like

Respect trailingSlash config.

Describe alternatives you've considered

No response

Additional Context

No response

Wrong module

Describe the bug

Starlight Astro get his Page.astro in "Layout" and not "Layouts"

To Reproduce

  1. I tried to build
  2. i get this error: [commonjs--resolver] Missing "./layouts/Page.astro" specifier in "@astrojs/starlight" package

Expected behavior

I expect to the website to build

How often does this bug happen?

Every time

System Info

No response

Additional Context

Here is the code i saw

starlight.d.ts

declare module '@astrojs/starlight/layouts/Page.astro' {
  export default function Page(props: Record<string, unknown>): unknown
}

idk where else it is but when i change the path, i keep getting the error

Feature: Set a prefix for the blog-post slug or allow schema to be extended for validation

Is your feature request related to a problem?

Currently if I set the slug to my-post it will not get prefixed with blog/.
Which generates "incorrect" url

Describe the solution you'd like

Either:

  • Ability to set a prefix for blog post slugs in the configuration
  • Always prefix slugs with the /blog (or custom path if #32 is considered)
  • Allow schema to be extended to add validation there

Describe alternatives you've considered

No response

Additional Context

No response

URLs do not respect `trailingSlash`

Describe the bug

URLs in the sidebar & prev/next buttons don't respect trailingSlash, leading to an extra redirect on some hosts.

To Reproduce

  1. Go to https://starlight-blog-docs.vercel.app/blog/
  2. Hover over any link in the sidebar, or the prev/next buttons

Expected behavior

For URLs to end with /

How often does this bug happen?

Every time

System Info

No response

Additional Context

No response

Language support

Is your feature request related to a problem?

It's not a real problem, just it's not the best idea to modify the source code on the node_module to change the language.

Describe the solution you'd like

I think about a way to get the language selected on the astro config and use it for the default text on the blog compoment.

Describe alternatives you've considered

Creating a compoment to select the language of the blog, but it's not very optimized to have 2 language system

Additional Context

Example of what i write:

const blogSidebar = isBlog
  ? [
      {
        href: '/blog',
        isCurrent: isBlogRoot(Astro),
        label: 'All posts',
        type: 'link',
      },
      {
        entries: recentEntries.map((blogEntry) => ({
          href: `/${blogEntry.slug}`,
          isCurrent: isBlogPostPage(Astro, blogEntry.slug),
          label: blogEntry.data.title,
          type: 'link',
        })),
        label: 'Recent posts',
        type: 'group',
      },
    ]
  : []

with translation:

const blogSidebar = isBlog
  ? [
      {
        href: '/blog',
        isCurrent: isBlogRoot(Astro),
        label: translation.labelRoot,
        type: 'link',
      },
      {
        entries: recentEntries.map((blogEntry) => ({
          href: `/${blogEntry.slug}`,
          isCurrent: isBlogPostPage(Astro, blogEntry.slug),
          label: blogEntry.data.title,
          type: 'link',
        })),
        label: translation.labelRecent,
        type: 'group',
      },
    ]
  : []

And you can have a file like en.json :

{ 
"labelRoot": "All post",
"labelRecent": "Recent post"
}

Have an Author profile page based off of the author config, which includes the posts they've authored

Is your feature request related to a problem?

Nothing big, but I'll be creating author profile pages for each defined author within the doc site itself, and having a the author link point to that. But this feels like it'd be nice to have out of the box!

Describe the solution you'd like

It would be great to have these pages be auto-generated and as an option for where an author link goes to.

That way you can have a 'profile' built into the doc site itself, and being able to provide more details within the author schema so you can add as many external links as you'd like.

Describe alternatives you've considered

Haven't done anything yet, as I've just started getting things up and running today to use this for an internal docsite.

Additional Context

Thank you for creating so many useful plugins and integrations for Starlight!

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.