an attempt to get paragraph counting into print layout...

This commit is contained in:
Marcell Mars 2021-02-06 00:15:18 +01:00
parent 5d684c2faf
commit 7612f79321
7 changed files with 425 additions and 26 deletions

View file

@ -608,7 +608,7 @@ h6:before {
color: rgba(0, 0, 0, 0.4); color: rgba(0, 0, 0, 0.4);
counter-increment: h6; counter-increment: h6;
content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "." content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "."
counter(h6) ". "; counter(h6) ". ";
} }
h2.nocount:before, h2.nocount:before,

View file

@ -0,0 +1,332 @@
body {counter-reset: css-5b2c9bc856f0d600de3a5440e4729a5b-h2 css-8d09338d4c6cd143e6ef05e89ff83ad6-h2 css-e92a96af15997255b08b0367dfe404a8-h2 css-5751de1128e2508854a84b88cc6d8546-h2 css-20cbaf3353610efcbd7f6f17bc53490c-h2 css-ef8d2f45d27f56f6ff80b71b75d5c76c-h2;}
.css-5b2c9bc856f0d600de3a5440e4729a5b-h2 {
counter-reset: css-5b2c9bc856f0d600de3a5440e4729a5b-h3;
}
.css-5b2c9bc856f0d600de3a5440e4729a5b-h3 {
counter-reset: css-5b2c9bc856f0d600de3a5440e4729a5b-h4;
}
.css-5b2c9bc856f0d600de3a5440e4729a5b-h4 {
counter-reset: css-5b2c9bc856f0d600de3a5440e4729a5b-h5;
}
.css-5b2c9bc856f0d600de3a5440e4729a5b-h5 {
counter-reset: css-5b2c9bc856f0d600de3a5440e4729a5b-h6;
}
.css-5b2c9bc856f0d600de3a5440e4729a5b-h2:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-5b2c9bc856f0d600de3a5440e4729a5b-h2 1;
content: counter(css-5b2c9bc856f0d600de3a5440e4729a5b-h2) ". ";
}
.css-5b2c9bc856f0d600de3a5440e4729a5b-h3:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-5b2c9bc856f0d600de3a5440e4729a5b-h3 1;
content: counter(css-5b2c9bc856f0d600de3a5440e4729a5b-h2) "." counter(css-5b2c9bc856f0d600de3a5440e4729a5b-h3) ". ";
}
.css-5b2c9bc856f0d600de3a5440e4729a5b-h4:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-5b2c9bc856f0d600de3a5440e4729a5b-h4 1;
content: counter(css-5b2c9bc856f0d600de3a5440e4729a5b-h2) "." counter(css-5b2c9bc856f0d600de3a5440e4729a5b-h3) "." counter(css-5b2c9bc856f0d600de3a5440e4729a5b-h4) ". ";
}
.css-5b2c9bc856f0d600de3a5440e4729a5b-h5:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-5b2c9bc856f0d600de3a5440e4729a5b-h5 1;
content: counter(css-5b2c9bc856f0d600de3a5440e4729a5b-h2) "." counter(css-5b2c9bc856f0d600de3a5440e4729a5b-h3) "." counter(css-5b2c9bc856f0d600de3a5440e4729a5b-h4) "." counter(css-5b2c9bc856f0d600de3a5440e4729a5b-h5) ". ";
}
.css-5b2c9bc856f0d600de3a5440e4729a5b-h6:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-5b2c9bc856f0d600de3a5440e4729a5b-h6 1;
content: counter(css-5b2c9bc856f0d600de3a5440e4729a5b-h2) "." counter(css-5b2c9bc856f0d600de3a5440e4729a5b-h3) "." counter(css-5b2c9bc856f0d600de3a5440e4729a5b-h4) "." counter(css-5b2c9bc856f0d600de3a5440e4729a5b-h5) "."
counter(css-5b2c9bc856f0d600de3a5440e4729a5b-h6) ". ";
}
.css-5b2c9bc856f0d600de3a5440e4729a5b-h2.nocount:before,
.css-5b2c9bc856f0d600de3a5440e4729a5b-h3.nocount:before,
.css-5b2c9bc856f0d600de3a5440e4729a5b-h4.nocount:before,
.css-5b2c9bc856f0d600de3a5440e4729a5b-h5.nocount:before,
.css-5b2c9bc856f0d600de3a5440e4729a5b-h6.nocount:before {
content: "";
counter-increment: none;
}
.css-8d09338d4c6cd143e6ef05e89ff83ad6-h2 {
counter-reset: css-8d09338d4c6cd143e6ef05e89ff83ad6-h3;
}
.css-8d09338d4c6cd143e6ef05e89ff83ad6-h3 {
counter-reset: css-8d09338d4c6cd143e6ef05e89ff83ad6-h4;
}
.css-8d09338d4c6cd143e6ef05e89ff83ad6-h4 {
counter-reset: css-8d09338d4c6cd143e6ef05e89ff83ad6-h5;
}
.css-8d09338d4c6cd143e6ef05e89ff83ad6-h5 {
counter-reset: css-8d09338d4c6cd143e6ef05e89ff83ad6-h6;
}
.css-8d09338d4c6cd143e6ef05e89ff83ad6-h2:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-8d09338d4c6cd143e6ef05e89ff83ad6-h2 1;
content: counter(css-8d09338d4c6cd143e6ef05e89ff83ad6-h2) ". ";
}
.css-8d09338d4c6cd143e6ef05e89ff83ad6-h3:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-8d09338d4c6cd143e6ef05e89ff83ad6-h3 1;
content: counter(css-8d09338d4c6cd143e6ef05e89ff83ad6-h2) "." counter(css-8d09338d4c6cd143e6ef05e89ff83ad6-h3) ". ";
}
.css-8d09338d4c6cd143e6ef05e89ff83ad6-h4:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-8d09338d4c6cd143e6ef05e89ff83ad6-h4 1;
content: counter(css-8d09338d4c6cd143e6ef05e89ff83ad6-h2) "." counter(css-8d09338d4c6cd143e6ef05e89ff83ad6-h3) "." counter(css-8d09338d4c6cd143e6ef05e89ff83ad6-h4) ". ";
}
.css-8d09338d4c6cd143e6ef05e89ff83ad6-h5:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-8d09338d4c6cd143e6ef05e89ff83ad6-h5 1;
content: counter(css-8d09338d4c6cd143e6ef05e89ff83ad6-h2) "." counter(css-8d09338d4c6cd143e6ef05e89ff83ad6-h3) "." counter(css-8d09338d4c6cd143e6ef05e89ff83ad6-h4) "." counter(css-8d09338d4c6cd143e6ef05e89ff83ad6-h5) ". ";
}
.css-8d09338d4c6cd143e6ef05e89ff83ad6-h6:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-8d09338d4c6cd143e6ef05e89ff83ad6-h6 1;
content: counter(css-8d09338d4c6cd143e6ef05e89ff83ad6-h2) "." counter(css-8d09338d4c6cd143e6ef05e89ff83ad6-h3) "." counter(css-8d09338d4c6cd143e6ef05e89ff83ad6-h4) "." counter(css-8d09338d4c6cd143e6ef05e89ff83ad6-h5) "."
counter(css-8d09338d4c6cd143e6ef05e89ff83ad6-h6) ". ";
}
.css-8d09338d4c6cd143e6ef05e89ff83ad6-h2.nocount:before,
.css-8d09338d4c6cd143e6ef05e89ff83ad6-h3.nocount:before,
.css-8d09338d4c6cd143e6ef05e89ff83ad6-h4.nocount:before,
.css-8d09338d4c6cd143e6ef05e89ff83ad6-h5.nocount:before,
.css-8d09338d4c6cd143e6ef05e89ff83ad6-h6.nocount:before {
content: "";
counter-increment: none;
}
.css-e92a96af15997255b08b0367dfe404a8-h2 {
counter-reset: css-e92a96af15997255b08b0367dfe404a8-h3;
}
.css-e92a96af15997255b08b0367dfe404a8-h3 {
counter-reset: css-e92a96af15997255b08b0367dfe404a8-h4;
}
.css-e92a96af15997255b08b0367dfe404a8-h4 {
counter-reset: css-e92a96af15997255b08b0367dfe404a8-h5;
}
.css-e92a96af15997255b08b0367dfe404a8-h5 {
counter-reset: css-e92a96af15997255b08b0367dfe404a8-h6;
}
.css-e92a96af15997255b08b0367dfe404a8-h2:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-e92a96af15997255b08b0367dfe404a8-h2 1;
content: counter(css-e92a96af15997255b08b0367dfe404a8-h2) ". ";
}
.css-e92a96af15997255b08b0367dfe404a8-h3:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-e92a96af15997255b08b0367dfe404a8-h3 1;
content: counter(css-e92a96af15997255b08b0367dfe404a8-h2) "." counter(css-e92a96af15997255b08b0367dfe404a8-h3) ". ";
}
.css-e92a96af15997255b08b0367dfe404a8-h4:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-e92a96af15997255b08b0367dfe404a8-h4 1;
content: counter(css-e92a96af15997255b08b0367dfe404a8-h2) "." counter(css-e92a96af15997255b08b0367dfe404a8-h3) "." counter(css-e92a96af15997255b08b0367dfe404a8-h4) ". ";
}
.css-e92a96af15997255b08b0367dfe404a8-h5:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-e92a96af15997255b08b0367dfe404a8-h5 1;
content: counter(css-e92a96af15997255b08b0367dfe404a8-h2) "." counter(css-e92a96af15997255b08b0367dfe404a8-h3) "." counter(css-e92a96af15997255b08b0367dfe404a8-h4) "." counter(css-e92a96af15997255b08b0367dfe404a8-h5) ". ";
}
.css-e92a96af15997255b08b0367dfe404a8-h6:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-e92a96af15997255b08b0367dfe404a8-h6 1;
content: counter(css-e92a96af15997255b08b0367dfe404a8-h2) "." counter(css-e92a96af15997255b08b0367dfe404a8-h3) "." counter(css-e92a96af15997255b08b0367dfe404a8-h4) "." counter(css-e92a96af15997255b08b0367dfe404a8-h5) "."
counter(css-e92a96af15997255b08b0367dfe404a8-h6) ". ";
}
.css-e92a96af15997255b08b0367dfe404a8-h2.nocount:before,
.css-e92a96af15997255b08b0367dfe404a8-h3.nocount:before,
.css-e92a96af15997255b08b0367dfe404a8-h4.nocount:before,
.css-e92a96af15997255b08b0367dfe404a8-h5.nocount:before,
.css-e92a96af15997255b08b0367dfe404a8-h6.nocount:before {
content: "";
counter-increment: none;
}
.css-5751de1128e2508854a84b88cc6d8546-h2 {
counter-reset: css-5751de1128e2508854a84b88cc6d8546-h3;
}
.css-5751de1128e2508854a84b88cc6d8546-h3 {
counter-reset: css-5751de1128e2508854a84b88cc6d8546-h4;
}
.css-5751de1128e2508854a84b88cc6d8546-h4 {
counter-reset: css-5751de1128e2508854a84b88cc6d8546-h5;
}
.css-5751de1128e2508854a84b88cc6d8546-h5 {
counter-reset: css-5751de1128e2508854a84b88cc6d8546-h6;
}
.css-5751de1128e2508854a84b88cc6d8546-h2:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-5751de1128e2508854a84b88cc6d8546-h2 1;
content: counter(css-5751de1128e2508854a84b88cc6d8546-h2) ". ";
}
.css-5751de1128e2508854a84b88cc6d8546-h3:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-5751de1128e2508854a84b88cc6d8546-h3 1;
content: counter(css-5751de1128e2508854a84b88cc6d8546-h2) "." counter(css-5751de1128e2508854a84b88cc6d8546-h3) ". ";
}
.css-5751de1128e2508854a84b88cc6d8546-h4:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-5751de1128e2508854a84b88cc6d8546-h4 1;
content: counter(css-5751de1128e2508854a84b88cc6d8546-h2) "." counter(css-5751de1128e2508854a84b88cc6d8546-h3) "." counter(css-5751de1128e2508854a84b88cc6d8546-h4) ". ";
}
.css-5751de1128e2508854a84b88cc6d8546-h5:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-5751de1128e2508854a84b88cc6d8546-h5 1;
content: counter(css-5751de1128e2508854a84b88cc6d8546-h2) "." counter(css-5751de1128e2508854a84b88cc6d8546-h3) "." counter(css-5751de1128e2508854a84b88cc6d8546-h4) "." counter(css-5751de1128e2508854a84b88cc6d8546-h5) ". ";
}
.css-5751de1128e2508854a84b88cc6d8546-h6:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-5751de1128e2508854a84b88cc6d8546-h6 1;
content: counter(css-5751de1128e2508854a84b88cc6d8546-h2) "." counter(css-5751de1128e2508854a84b88cc6d8546-h3) "." counter(css-5751de1128e2508854a84b88cc6d8546-h4) "." counter(css-5751de1128e2508854a84b88cc6d8546-h5) "."
counter(css-5751de1128e2508854a84b88cc6d8546-h6) ". ";
}
.css-5751de1128e2508854a84b88cc6d8546-h2.nocount:before,
.css-5751de1128e2508854a84b88cc6d8546-h3.nocount:before,
.css-5751de1128e2508854a84b88cc6d8546-h4.nocount:before,
.css-5751de1128e2508854a84b88cc6d8546-h5.nocount:before,
.css-5751de1128e2508854a84b88cc6d8546-h6.nocount:before {
content: "";
counter-increment: none;
}
.css-20cbaf3353610efcbd7f6f17bc53490c-h2 {
counter-reset: css-20cbaf3353610efcbd7f6f17bc53490c-h3;
}
.css-20cbaf3353610efcbd7f6f17bc53490c-h3 {
counter-reset: css-20cbaf3353610efcbd7f6f17bc53490c-h4;
}
.css-20cbaf3353610efcbd7f6f17bc53490c-h4 {
counter-reset: css-20cbaf3353610efcbd7f6f17bc53490c-h5;
}
.css-20cbaf3353610efcbd7f6f17bc53490c-h5 {
counter-reset: css-20cbaf3353610efcbd7f6f17bc53490c-h6;
}
.css-20cbaf3353610efcbd7f6f17bc53490c-h2:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-20cbaf3353610efcbd7f6f17bc53490c-h2 1;
content: counter(css-20cbaf3353610efcbd7f6f17bc53490c-h2) ". ";
}
.css-20cbaf3353610efcbd7f6f17bc53490c-h3:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-20cbaf3353610efcbd7f6f17bc53490c-h3 1;
content: counter(css-20cbaf3353610efcbd7f6f17bc53490c-h2) "." counter(css-20cbaf3353610efcbd7f6f17bc53490c-h3) ". ";
}
.css-20cbaf3353610efcbd7f6f17bc53490c-h4:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-20cbaf3353610efcbd7f6f17bc53490c-h4 1;
content: counter(css-20cbaf3353610efcbd7f6f17bc53490c-h2) "." counter(css-20cbaf3353610efcbd7f6f17bc53490c-h3) "." counter(css-20cbaf3353610efcbd7f6f17bc53490c-h4) ". ";
}
.css-20cbaf3353610efcbd7f6f17bc53490c-h5:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-20cbaf3353610efcbd7f6f17bc53490c-h5 1;
content: counter(css-20cbaf3353610efcbd7f6f17bc53490c-h2) "." counter(css-20cbaf3353610efcbd7f6f17bc53490c-h3) "." counter(css-20cbaf3353610efcbd7f6f17bc53490c-h4) "." counter(css-20cbaf3353610efcbd7f6f17bc53490c-h5) ". ";
}
.css-20cbaf3353610efcbd7f6f17bc53490c-h6:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-20cbaf3353610efcbd7f6f17bc53490c-h6 1;
content: counter(css-20cbaf3353610efcbd7f6f17bc53490c-h2) "." counter(css-20cbaf3353610efcbd7f6f17bc53490c-h3) "." counter(css-20cbaf3353610efcbd7f6f17bc53490c-h4) "." counter(css-20cbaf3353610efcbd7f6f17bc53490c-h5) "."
counter(css-20cbaf3353610efcbd7f6f17bc53490c-h6) ". ";
}
.css-20cbaf3353610efcbd7f6f17bc53490c-h2.nocount:before,
.css-20cbaf3353610efcbd7f6f17bc53490c-h3.nocount:before,
.css-20cbaf3353610efcbd7f6f17bc53490c-h4.nocount:before,
.css-20cbaf3353610efcbd7f6f17bc53490c-h5.nocount:before,
.css-20cbaf3353610efcbd7f6f17bc53490c-h6.nocount:before {
content: "";
counter-increment: none;
}
.css-ef8d2f45d27f56f6ff80b71b75d5c76c-h2 {
counter-reset: css-ef8d2f45d27f56f6ff80b71b75d5c76c-h3;
}
.css-ef8d2f45d27f56f6ff80b71b75d5c76c-h3 {
counter-reset: css-ef8d2f45d27f56f6ff80b71b75d5c76c-h4;
}
.css-ef8d2f45d27f56f6ff80b71b75d5c76c-h4 {
counter-reset: css-ef8d2f45d27f56f6ff80b71b75d5c76c-h5;
}
.css-ef8d2f45d27f56f6ff80b71b75d5c76c-h5 {
counter-reset: css-ef8d2f45d27f56f6ff80b71b75d5c76c-h6;
}
.css-ef8d2f45d27f56f6ff80b71b75d5c76c-h2:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-ef8d2f45d27f56f6ff80b71b75d5c76c-h2 1;
content: counter(css-ef8d2f45d27f56f6ff80b71b75d5c76c-h2) ". ";
}
.css-ef8d2f45d27f56f6ff80b71b75d5c76c-h3:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-ef8d2f45d27f56f6ff80b71b75d5c76c-h3 1;
content: counter(css-ef8d2f45d27f56f6ff80b71b75d5c76c-h2) "." counter(css-ef8d2f45d27f56f6ff80b71b75d5c76c-h3) ". ";
}
.css-ef8d2f45d27f56f6ff80b71b75d5c76c-h4:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-ef8d2f45d27f56f6ff80b71b75d5c76c-h4 1;
content: counter(css-ef8d2f45d27f56f6ff80b71b75d5c76c-h2) "." counter(css-ef8d2f45d27f56f6ff80b71b75d5c76c-h3) "." counter(css-ef8d2f45d27f56f6ff80b71b75d5c76c-h4) ". ";
}
.css-ef8d2f45d27f56f6ff80b71b75d5c76c-h5:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-ef8d2f45d27f56f6ff80b71b75d5c76c-h5 1;
content: counter(css-ef8d2f45d27f56f6ff80b71b75d5c76c-h2) "." counter(css-ef8d2f45d27f56f6ff80b71b75d5c76c-h3) "." counter(css-ef8d2f45d27f56f6ff80b71b75d5c76c-h4) "." counter(css-ef8d2f45d27f56f6ff80b71b75d5c76c-h5) ". ";
}
.css-ef8d2f45d27f56f6ff80b71b75d5c76c-h6:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-ef8d2f45d27f56f6ff80b71b75d5c76c-h6 1;
content: counter(css-ef8d2f45d27f56f6ff80b71b75d5c76c-h2) "." counter(css-ef8d2f45d27f56f6ff80b71b75d5c76c-h3) "." counter(css-ef8d2f45d27f56f6ff80b71b75d5c76c-h4) "." counter(css-ef8d2f45d27f56f6ff80b71b75d5c76c-h5) "."
counter(css-ef8d2f45d27f56f6ff80b71b75d5c76c-h6) ". ";
}
.css-ef8d2f45d27f56f6ff80b71b75d5c76c-h2.nocount:before,
.css-ef8d2f45d27f56f6ff80b71b75d5c76c-h3.nocount:before,
.css-ef8d2f45d27f56f6ff80b71b75d5c76c-h4.nocount:before,
.css-ef8d2f45d27f56f6ff80b71b75d5c76c-h5.nocount:before,
.css-ef8d2f45d27f56f6ff80b71b75d5c76c-h6.nocount:before {
content: "";
counter-increment: none;
}

View file

@ -1 +1 @@
<h{{ add 1 .Level }} id="{{ .Anchor | safeURL }}" class="hx">{{ .Text | safeHTML }}<a class="hpar" href="#{{ .Anchor | safeURL }}"></a></h{{ add 1 .Level }}> <h{{ add 1 .Level }} id="{{ .Anchor | safeURL }}" class="hx css-{{ .Page.File.UniqueID }}-h{{ add 1 .Level }}">{{ .Text | safeHTML }}<a class="hpar" href="#{{ .Anchor | safeURL }}"></a></h{{ add 1 .Level }}>

View file

@ -12,7 +12,7 @@
{{ end }} {{ end }}
{{ if .Params.Author }} {{ if .Params.Author }}
<meta name="author" content="{{ .Params.Author}}" /> <meta name="author" content="{{ .Params.Author }}" />
{{ end }} {{ end }}
{{ template "_internal/opengraph.html" . }} {{ template "_internal/opengraph.html" . }}

View file

@ -1,4 +1,5 @@
<link href="/css/paged_interface.css" rel="stylesheet" type="text/css"> <link href="/css/paged_interface.css" rel="stylesheet" type="text/css">
<link href="/css/dyn.css" rel="stylesheet" type="text/css">
<link href="/css/print.css" rel="stylesheet" type="text/css"> <link href="/css/print.css" rel="stylesheet" type="text/css">
<script src="/js/paged.polyfill.js"></script> <script src="/js/paged.polyfill.js"></script>
<script src="/js/repeatingHeader.js"></script> <script src="/js/repeatingHeader.js"></script>

View file

@ -1,4 +1,63 @@
{{- define "singlebody" -}} {{- define "singlebody" -}}
{{ $cssTemplate := `.css-_rplc_-h2 {
counter-reset: css-_rplc_-h3;
}
.css-_rplc_-h3 {
counter-reset: css-_rplc_-h4;
}
.css-_rplc_-h4 {
counter-reset: css-_rplc_-h5;
}
.css-_rplc_-h5 {
counter-reset: css-_rplc_-h6;
}
.css-_rplc_-h2:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-_rplc_-h2 1;
content: counter(css-_rplc_-h2) ". ";
}
.css-_rplc_-h3:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-_rplc_-h3 1;
content: counter(css-_rplc_-h2) "." counter(css-_rplc_-h3) ". ";
}
.css-_rplc_-h4:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-_rplc_-h4 1;
content: counter(css-_rplc_-h2) "." counter(css-_rplc_-h3) "." counter(css-_rplc_-h4) ". ";
}
.css-_rplc_-h5:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-_rplc_-h5 1;
content: counter(css-_rplc_-h2) "." counter(css-_rplc_-h3) "." counter(css-_rplc_-h4) "." counter(css-_rplc_-h5) ". ";
}
.css-_rplc_-h6:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: css-_rplc_-h6 1;
content: counter(css-_rplc_-h2) "." counter(css-_rplc_-h3) "." counter(css-_rplc_-h4) "." counter(css-_rplc_-h5) "."
counter(css-_rplc_-h6) ". ";
}
.css-_rplc_-h2.nocount:before,
.css-_rplc_-h3.nocount:before,
.css-_rplc_-h4.nocount:before,
.css-_rplc_-h5.nocount:before,
.css-_rplc_-h6.nocount:before {
content: "";
counter-increment: none;
}` }}
{{ $cssOutput := "" }}
{{ $cssHashes := "" }}
{{ $s := partialCached "scratch.html" . }} {{ $s := partialCached "scratch.html" . }}
{{ $p := $.GetPage .Params.print }} {{ $p := $.GetPage .Params.print }}
{{ $scratch := $s.Get (printf "/%s" $p.File) }} {{ $scratch := $s.Get (printf "/%s" $p.File) }}
@ -10,27 +69,31 @@
<div class="print0">{{ partial "printsinglebody.html" $p }}</div> <div class="print0">{{ partial "printsinglebody.html" $p }}</div>
<div class="content">{{ $p.Content }}</div> <div class="content">{{ $p.Content }}</div>
{{ $cssOutput = printf "%s\n%s" $cssOutput (replace $cssTemplate "_rplc_" $p.File.UniqueID) }}
{{ $cssHashes = printf "%s css-%s-h2" $cssHashes $p.File.UniqueID }}
{{ range $scratch.has_children }} {{ range $scratch.has_children }}
<div class="crustpage"> <div class="crustpage">
{{ $addS := len .Params.authors }} {{ $addS := len .Params.authors }}
{{ range $n, $authorFile := .Params.authors }} {{ range $n, $authorFile := .Params.authors }}
{{ $author := $.GetPage (printf "/author/%s" $authorFile) }} {{ $author := $.GetPage (printf "/author/%s" $authorFile) }}
{{ if eq $n 0 }} {{ if eq $n 0 }}
<div class="runningAuthors"><span class="sup">author{{ with (gt $addS 1) }}s{{ end }}</span><a href="#{{ $author.File.LogicalName }}">{{ $author.Title }}</a> <div class="runningAuthors"><span class="sup">author{{ with (gt $addS 1) }}s{{ end }}</span><a href="#{{ $author.File.LogicalName }}">{{ $author.Title }}</a>
{{ else }} {{ else }}
, <a href="#{{ $author.File.LogicalName }}">{{ $author.Title }}</a> , <a href="#{{ $author.File.LogicalName }}">{{ $author.Title }}</a>
{{ end }}
{{ end }} {{ end }}
{{ end }} {{ with .Params.authors }}</div>{{ end }}
{{ with .Params.authors }}</div>{{ end }}
{{ $tit := .Title }}
{{ $tit := .Title }} {{ if gt (len .Title) 54 }}
{{ if gt (len .Title) 54 }} {{ $tit = printf "%s…" (substr .Title 0 50) }}
{{ $tit = printf "%s…" (substr .Title 0 50) }} {{ end }}
{{ end }}
<div class="runningTitle"><span class="sup">{{ index $scratch.crust 0 }}</span><a href="#{{ .File.LogicalName }}">{{ $tit }}</a></div> <div class="runningTitle"><span class="sup">{{ index $scratch.crust 0 }}</span><a href="#{{ .File.LogicalName }}">{{ $tit }}</a></div>
{{ partial "printsinglebody.html" . }} {{ partial "printsinglebody.html" . }}
{{ .Content }} {{ .Content }}
{{ $cssOutput = printf "%s\n%s" $cssOutput (replace $cssTemplate "_rplc_" .File.UniqueID) }}
{{ $cssHashes = printf "%s css-%s-h2" $cssHashes .File.UniqueID }}
{{ end }} {{ end }}
{{ range where $.Site.RegularPages "Section" "in" (slice "author" "editor") }} {{ range where $.Site.RegularPages "Section" "in" (slice "author" "editor") }}
@ -54,4 +117,7 @@
</div></div> </div></div>
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ $cssOutput = printf "body {counter-reset: %s;}\n%s" $cssHashes $cssOutput }}
{{ $var := $cssOutput | resources.FromString "css/dyn.css" }}
{{ $dummy := $var.Permalink }}
{{- end -}} {{- end -}}

View file

@ -157,14 +157,14 @@
padding-right: 0; padding-right: 0;
font-size: 0.9rem; font-size: 0.9rem;
} }
/*
h2:before, h2:before,
h3:before, h3:before,
h4:before, h4:before,
h5:before { h5:before {
content: none; content: none;
} }
*/
h2, h3, h4, h5, hr { h2, h3, h4, h5, hr {
break-after: avoid; break-after: avoid;
} }