mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2024-12-21 11:53:18 -06:00
Replace table shortcode with markdown attributes for class
This commit is contained in:
parent
ddb57e0120
commit
c9095e948b
@ -248,31 +248,31 @@ hr {
|
||||
}
|
||||
}
|
||||
|
||||
table.markdown {
|
||||
table.simple {
|
||||
border-collapse: collapse;
|
||||
border: 2px solid var(--text-1);
|
||||
}
|
||||
|
||||
table.markdown thead {
|
||||
table.simple thead {
|
||||
background-color: var(--background-2);
|
||||
color: var(--text-2);
|
||||
border-bottom: 2px solid var(--text-1);
|
||||
}
|
||||
|
||||
table.markdown th,
|
||||
table.markdown td {
|
||||
table.simple th,
|
||||
table.simple td {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
table.markdown :is(th, td) + :is(th, td) {
|
||||
table.simple :is(th, td) + :is(th, td) {
|
||||
border-left: 2px solid var(--text-1);
|
||||
}
|
||||
|
||||
table.markdown tbody tr:nth-child(odd) {
|
||||
table.simple tbody tr:nth-child(odd) {
|
||||
background-color: var(--background-0);
|
||||
color: var(--text-0);
|
||||
}
|
||||
table.markdown tbody tr:nth-child(even) {
|
||||
table.simple tbody tr:nth-child(even) {
|
||||
background-color: var(--background-1);
|
||||
color: var(--text-1);
|
||||
}
|
||||
|
@ -2,6 +2,12 @@ markup:
|
||||
highlight:
|
||||
noClasses: false
|
||||
lineNos: true
|
||||
goldmark:
|
||||
parser:
|
||||
attribute:
|
||||
block: true
|
||||
# this is enabled by default already
|
||||
#title: true
|
||||
|
||||
params:
|
||||
readingtime: true
|
||||
|
@ -1,10 +0,0 @@
|
||||
{{/* See https://willschenk.com/articles/2020/styling_tables_with_hugo/ */}}
|
||||
|
||||
{{ $class := "markdown" }}
|
||||
{{ with .Get "class" }}
|
||||
{{ $class = delimit (slice $class .) " " }}
|
||||
{{ end }}
|
||||
|
||||
{{ $htmlTable := .Inner | .Page.RenderString (dict "display" "block") }}
|
||||
{{ $new := printf `<table class="%s">` $class }}
|
||||
{{ (replace $htmlTable "<table>" $new) | safeHTML }}
|
Loading…
Reference in New Issue
Block a user