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

HTML5 semantic elements #8

Open
mchackorg opened this issue Apr 19, 2018 · 6 comments · May be fixed by #137
Open

HTML5 semantic elements #8

mchackorg opened this issue Apr 19, 2018 · 6 comments · May be fixed by #137

Comments

@mchackorg
Copy link
Contributor

mchackorg commented Apr 19, 2018

Would you be open to accept a pull request that changes the HTML output to use semantic elements? That is, an index page with elements like:

<header></header>
<nav></nav>
<main>
<article>
</article>
<article>
</article>
</main>
<footer>
</footer>

And perhaps using <time> for all dates.

This could be done either as a replacement for most of the <div> tags or, if that is too controversial, perhaps a multi-stage merge: 1) Adding all the semantic elements without touching div's, 2) Warning all current users about the imminent removal of div's, 3) Remove unnecessary divs's.

What do you think?

@bastibe
Copy link
Owner

bastibe commented Apr 20, 2018

Personally, I'd applaud this!

However, this will break the CSS for existing users.

We should therefore include this as an option. We could declare a customizable variable org-static-blog-use-semantic-html that defaults to nil. If set to t, it would

  • replace <div id="preamble" class="status"> with <header>
  • replace <div id="postamble" class="status"> with <footer>
  • replace <div id="content"> with <main>
  • replace <div class="post-date"> with <time>
  • wrap each post in org-static-blog-assemble-multipost-page in an <article>
  • did I miss anything?

This will introduce a number of (if org-static-blog-use-semantic-html "<div...>" "<main>") into every template. At some point, it might be beneficial to think about a more complex templating system...

I would like this very much!

@bastibe
Copy link
Owner

bastibe commented May 27, 2018

Implemented in #7

@bastibe bastibe closed this as completed May 27, 2018
@mchackorg
Copy link
Contributor Author

mchackorg commented May 27, 2018

Hm? Pull request #7 was an attempt at generating validating HTML5, not using semantic tags. It doesn't wrap entries in <article> for instance. Perhaps keep this issue open?

@bastibe
Copy link
Owner

bastibe commented May 28, 2018

Woops, my bad.

@bastibe bastibe reopened this May 28, 2018
geeklhem added a commit to geeklhem/org-static-blog that referenced this issue Oct 12, 2018
Introduce new custom option `org-static-blog-use-semantic-html` that
default to `nil`.

If set to `t`
- replace `<div id="preamble" class="status">` with `<header>`
- replace `<div id="postamble" class="status">` with `<footer>`
- replace `<div id="content">` with `<main>`
- replace `<div class="post-date">` with `<time>`

Regardless of the value:
- wrap each post in `org-static-blog-assemble-multipost-page` in an `<article>`
- wrap the title and date of each article in an `<header>`

As discussed in bastibe#8
@geeklhem
Copy link

Hi, I was interested in this feature and it seemed within my (limited) elisp abilities. Would you be interested in a pull-request ?

@bastibe
Copy link
Owner

bastibe commented Oct 13, 2018

Absolutely!

fapdash added a commit to fapdash/org-static-blog that referenced this issue Aug 25, 2024
The feature is toggled via `org-static-blog-use-semantic-html`.
The output is customizable via
`org-static-blog-semantic-html-mapping`.

closes bastibe#8
@fapdash fapdash linked a pull request Aug 25, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

3 participants