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

clean_filename not being run on tag_ pages? #58

Open
Puuhinen opened this issue Jul 6, 2014 · 5 comments
Open

clean_filename not being run on tag_ pages? #58

Puuhinen opened this issue Jul 6, 2014 · 5 comments
Assignees

Comments

@Puuhinen
Copy link
Contributor

Puuhinen commented Jul 6, 2014

I have somehow ended up with a file called tag_lempipuut-helsingissä.html. It still works fine, but I was under the impression that all filenames are supposed to go through clean_filename to make them all ASCII.

I tried to look through the code and find the problem myself, but I was unable to pinpoint it right now. Will try again at a better time.

@Puuhinen
Copy link
Contributor Author

Puuhinen commented Jul 7, 2014

Oh wait, clean_filename() has nothing to do with this.

@Lex-2008
Copy link
Contributor

Lex-2008 commented Jul 9, 2014

Right, as commented by @cfenollosa at #45:

Anything that generates a file name should eval $(convert_filename). Apply that to tag generation name.

This might get harder then just putting this function call to appropriate places, because there might be some unexpected stuff. For example, when building tag_*.html pages themselves, we use filename to find out the tag name. Also, when scanning for "all tags referenced by this post" we use regexp which expects tagname to be the same both in filename and link text - it might be easier to fix, but harder to spot ;)

@cfenollosa
Copy link
Owner

Mmm yes, as @Lex-2008 says, we use the tag name to match posts which use it.

This presents a dilemma: what good it is to call convert_filename to create post names (from titles) if we don't to the same for tags. Should we remove this altogether and trust the file system?

@Lex-2008
Copy link
Contributor

Well, I'd rather leave convert_filename and start using it for tag filenames, too. Because not all characters which are allowed in filenames, are welcome in URLs. For example, we probably want to keep replacing spaces with dashes.

And concerning the tag "text" vs tag filename: I believe that, when building a tag_*.html page, we can save the tag text from any of the posts referenced by it.

@Puuhinen
Copy link
Contributor Author

How about just putting the tag text in an HTML comment inside the tag_foo.html? That way you can put the filename through convert_filename but don't have to find to find a post linked to by tag_foo.html and then parse that to find the tag text.

@cfenollosa cfenollosa self-assigned this Jan 29, 2016
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

3 participants