Skip to content

Commit

Permalink
Fix a 404 RSS feed sidebar link error (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
HiDeoo authored May 12, 2024
2 parents 1a22390 + 8e1d50e commit cb66c21
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/starlight-blog/overrides/Sidebar.astro
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ if (isBlog) {
blogSidebar.push({
attrs: {},
badge: undefined,
href: getBlogPathWithBase('/rss.xml'),
href: getBlogPathWithBase('/rss.xml', true),
isCurrent: false,
label: 'RSS',
type: 'link',
Expand Down
4 changes: 4 additions & 0 deletions packages/starlight-blog/tests/unit/basics/page.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ describe('getBlogPathWithBase', () => {
test('returns a blog post path', () => {
expect(getBlogPathWithBase('/post-1')).toBe('/blog/post-1')
})

test('returns the RSS feed path', () => {
expect(getBlogPathWithBase('/rss.xml', true)).toBe('/blog/rss.xml')
})
})

describe('getPathWithBase', () => {
Expand Down
4 changes: 4 additions & 0 deletions packages/starlight-blog/tests/unit/prefix/page.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ describe('getBlogPathWithBase', () => {
test('returns a blog post path', () => {
expect(getBlogPathWithBase('/post-1')).toBe('/news/post-1')
})

test('returns the RSS feed path', () => {
expect(getBlogPathWithBase('/rss.xml', true)).toBe('/news/rss.xml')
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ describe('getBlogPathWithBase', () => {
test('returns a blog post path', () => {
expect(getBlogPathWithBase('/post-1')).toBe('/blog/post-1/')
})

test('returns the RSS feed path', () => {
expect(getBlogPathWithBase('/rss.xml', true)).toBe('/blog/rss.xml')
})
})

describe('getPathWithBase', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ describe('getBlogPathWithBase', () => {
test('returns a blog post path', () => {
expect(getBlogPathWithBase('/post-1/')).toBe('/blog/post-1')
})

test('returns the RSS feed path', () => {
expect(getBlogPathWithBase('/rss.xml', true)).toBe('/blog/rss.xml')
})
})

describe('getPathWithBase', () => {
Expand Down

0 comments on commit cb66c21

Please sign in to comment.