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

fix: trailing slashes and links #12

Merged
merged 2 commits into from
Jun 12, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ pnpm-debug.log*
# misc
*.pem
Thumbs.db
.history
1 change: 1 addition & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { astroImageTools } from 'astro-imagetools';
export default defineConfig({
// base: '.', // Set a path prefix.
site: 'https://example.com/', // Use to generate your sitemap and canonical URLs in your final build.
trailingSlash: 'always', // Use to always append '/' at end of url
// Important!
// Only official '@astrojs/*' integrations are currently supported by Astro.
// Add 'experimental.integrations: true' to make 'astro-robots-txt' working
Expand Down
16 changes: 10 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/pages/posts/fifth-post.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ imgSrc: '/assets/images/image-post2.jpeg'
imgAlt: 'Image post 2'
---

Full typography example at [this page](./sixth-post).
Full typography example at [this page](../sixth-post/).
2 changes: 1 addition & 1 deletion src/pages/posts/first-post.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ imgSrc: '/assets/images/image-post7.jpeg'
imgAlt: 'Image post 7'
---

Full typography example at [this page](./sixth-post).
Full typography example at [this page](../sixth-post/).
2 changes: 1 addition & 1 deletion src/pages/posts/forth-post.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ imgSrc: '/assets/images/image-post3.jpeg'
imgAlt: 'Image post 3'
---

Full typography example at [this page](./sixth-post).
Full typography example at [this page](../sixth-post/).
2 changes: 1 addition & 1 deletion src/pages/posts/hello-world.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ imgSrc: '/assets/images/image-post6.jpeg'
imgAlt: 'Image post 6'
---

Full typography example at [this page](./sixth-post).
Full typography example at [this page](../sixth-post/).
2 changes: 1 addition & 1 deletion src/pages/posts/second-post.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ imgSrc: '/assets/images/image-post5.jpeg'
imgAlt: 'Image post 5'
---

Full typography example at [this page](./sixth-post).
Full typography example at [this page](../sixth-post/).
2 changes: 1 addition & 1 deletion src/pages/posts/sixth-post.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Some text to show that the reference links can follow later.
Images included in _\_posts_ folder are lazy loaded.

Inline-style:
![alt text](/src/images/random.jpeg 'Logo Title Text 1')
![alt text](http://localhost:3000/src/images/random.jpeg 'Logo Title Text 1')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think http://localhost:3000 should be removed. Otherwise, everything else looks good to me.

Copy link
Contributor Author

@Izocel Izocel Jun 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could point to the repos url instead what you think ?
If you just remove the domain the page won't load and thus break the app

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Izocel, we should just remove the domain. If we remove the domain and if the image won't load, this mean there is a bug.

Putting localhost:3000 is not a solution because it will break in production with a real domain.


## Table

Expand Down
2 changes: 1 addition & 1 deletion src/pages/posts/third-post.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ imgSrc: '/assets/images/image-post4.jpeg'
imgAlt: 'Image post 4'
---

Full typography example at [this page](./sixth-post).
Full typography example at [this page](../sixth-post/).
2 changes: 1 addition & 1 deletion src/partials/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const Navbar = () => (
</a>

<NavMenu>
<NavMenuItem href="/posts">Blogs</NavMenuItem>
<NavMenuItem href="/posts/">Blogs</NavMenuItem>
<NavMenuItem href="/">GitHub</NavMenuItem>
<NavMenuItem href="/">Twitter</NavMenuItem>
</NavMenu>
Expand Down