Comments (7)
The problem you describe is because the tag name and slug are not saved for the tags, the slug is simply used to show the tags everywhere (including the url).
To create the slug we use a dependency that does those conversions: limax. We have come up with some ideas to solve it but we still do not have a definitive solution to the problem. Maybe if we add a new optional Content Collection so that in cases like yours you can define the name of the tag and slug, we will tell you later what we can think of or if you have any suggestions please let us know.
For now we will give you the two lines that are associated with it:
- https://github.com/onwidget/astrowind/blob/main/src/utils/blog.ts#L64
- https://github.com/onwidget/astrowind/blob/main/src/utils/permalinks.ts#L1
- https://github.com/onwidget/astrowind/blob/main/src/utils/permalinks.ts#L21
from astrowind.
Sorry for the delay.
Another thing you can do is go to this line:
Line 64 in 155a602
and instead of using cleanSlug
, create a new function cleanTagSlug
that cleans up the slug for the tags a bit, (for example, replaces the spaces with '-' or whatever you need). In simpler case remove the call to the cleanSlug
function
from astrowind.
from astrowind.
@prototypa thanks for the fast response, I am waiting for the solution!!
from astrowind.
@prototypa can you read this issue where they solve it but i don't know what should i change now in my astrowind theme!
issue
it's a really quick one, thanks in advance
from astrowind.
@prototypa Is there any update for this problem! i have built the website and host it but just can't solve this problem! and it prevents me from building the other website with this cool theme!
from astrowind.
@prototypa here is my solution
export const cleanSlug = (text = '') => {
const regex = /[^\d\u0621-\u064A]+/g;
return trimSlash(text)
.split('/')
.map((slug, index, array) => {
// Preserve slashes in the middle, but replace in the beginning and end
if (index !== 0 && index !== array.length - 1) {
return slug;
}
// If the slug starts with "-", consider it as a tag and preserve it
if (slug.startsWith('-')) {
return slug;
}
// Otherwise, replace unwanted characters
return slug.replace(regex, '-');
})
.join('/');
};
I don't know if it the right way to solve it but i works!
the only thing that is wrong is with the
is the /-/ should be the word "tag"
from astrowind.
Related Issues (20)
- header in article with mdx is broken HOT 2
- Make repository a GitHub Template Repository HOT 2
- Fetch content from backend - HTML is coming with <p>and breaks the design. HOT 2
- PageSpeed insight perfomance is 76, but not 100 HOT 3
- 1px gap above navbar on large screens HOT 4
- The main navigation is not centred on md: HOT 2
- Astro embed not working HOT 1
- del HOT 1
- Not Highlighting the selected header menu item HOT 2
- eslint errors HOT 1
- Prettier inconsistencies HOT 2
- I want to use multiple sentences on call to action HOT 3
- @astrolib/seo -- HTML5 Validation Errors HOT 2
- Issues with peer dependencies found: Compress HOT 1
- Safari only: Related Posts multi-line header links behave unhandy HOT 1
- inline code in 1 backtick was not converted correctly in markdown
- Hero2 widget id
- Do I need to change hasExternalScripts to true for Analytics to work?
- red warning text on build
- Building the site works though deployed site has CORS errors HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from astrowind.