-
Notifications
You must be signed in to change notification settings - Fork 42
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 pagetitle for minutes and motions #414
Conversation
Hmm, I'm wondering if it would be easier to just use the intended document title as the first line, and just remove that line during the build step. OR we can straight up try using some HTML meta tag in the markdown directly, and the meta tag would include the document title. |
Alright, I just tried the <title> tag idea, and it doesn't work. But the other idea is feasible. We could make it so it either uses the first line, if it starts with a # or, if the first line doesn't start with a #, it parses a first line like this and removes it during the build process: |
I mean, if we want the easiest approach, then we probably want the current proposal, which requires zero changes to the actual documents. Any reason why you don't feel comfortable with it? |
Actually, I guess your options isn't bad, but I'm not a fan of limiting it to just the motions and minutes. I think instead we should check if a normal # title exists, and if not, just use the file name, as you've done here. |
The problem is that a normal # title exists for motions, but it's not the title we want. |
Oh, makes sense now |
@thewca/software-team could someone from the WST please review this? |
@thewca/software-team ? |
@gregorbg would you mind approving this? |
Fixes #398
I'm not a bash expert, but I think this solution should be fine.
Note that I used
(([a-zA-Z0-9.\-]|[[:blank:]])+)\.md
to match the filename. I tried[a-zA-Z0-9.\- ]
,[a-zA-Z0-9.\-\ ]
and[a-zA-Z0-9.\-\s]
, but none of those worked (with docker) to match spaces in the filename. That's why I added[[:blank:]]
.Anyway, it can be as simple as
(.+)\.md
, but I guess the complex regex should be safer.