mirror of
				https://github.com/BBaoVanC/bobatheme.git
				synced 2025-11-03 18:27:55 -06:00 
			
		
		
		
	Update related posts design and move comments above it
This commit is contained in:
		@@ -252,25 +252,53 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Related posts */
 | 
					/* Related posts */
 | 
				
			||||||
.related hr {
 | 
					.related {
 | 
				
			||||||
 | 
					  /* make left/right 0 margin so it takes up full width */
 | 
				
			||||||
  margin: 25px 0;
 | 
					  margin: 25px 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.related > hr,
 | 
				
			||||||
 | 
					.related > h2 {
 | 
				
			||||||
 | 
					  margin-left: 20px;
 | 
				
			||||||
 | 
					  margin-right: 20px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.related-posts .post {
 | 
				
			||||||
 | 
					  min-width: 300px;
 | 
				
			||||||
 | 
					  max-width: 300px;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  /* since .related and .related-posts are both full-width with no margin */
 | 
				
			||||||
 | 
					  margin-left: 20px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.related-posts .post:last-child {
 | 
				
			||||||
 | 
					  margin-right: 20px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@media (max-width: 720px) {
 | 
				
			||||||
 | 
					  /* when the screen is smaller than max size, make sure that the .related div
 | 
				
			||||||
 | 
					   * still reaches the screen edge. then if the posts overflow and require
 | 
				
			||||||
 | 
					   * scrolling, you can see it cut off on the side of your phone screen
 | 
				
			||||||
 | 
					   */
 | 
				
			||||||
 | 
					  .related {
 | 
				
			||||||
 | 
					    margin-left: -20px;
 | 
				
			||||||
 | 
					    margin-right: -20px;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@media (min-width: 720px) {
 | 
					@media (min-width: 720px) {
 | 
				
			||||||
  .related {
 | 
					  .related {
 | 
				
			||||||
    /* this makes it full width -- 720px max-width on body
 | 
					    /* this makes it full width -- 720px max-width on body it is exactly 720px
 | 
				
			||||||
     * add an extra 40px to give a 20px margin on left and right */
 | 
					     * so .related takes up full width
 | 
				
			||||||
    margin-left: calc(-100vw / 2 + 760px / 2);
 | 
					     */
 | 
				
			||||||
    margin-right: calc(-100vw / 2 + 760px / 2);
 | 
					    margin-left: calc(-100vw / 2 + 720px / 2);
 | 
				
			||||||
 | 
					    margin-right: calc(-100vw / 2 + 720px / 2);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.related-posts {
 | 
					.related-posts {
 | 
				
			||||||
  display: grid;
 | 
					  display: flex;
 | 
				
			||||||
  gap: 20px;
 | 
					  overflow-x: scroll;
 | 
				
			||||||
  grid-auto-flow: column;
 | 
					 | 
				
			||||||
  grid-auto-columns: 300px;
 | 
					 | 
				
			||||||
  overflow-x: auto;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -403,7 +431,6 @@
 | 
				
			|||||||
/* Basic elements */
 | 
					/* Basic elements */
 | 
				
			||||||
html {
 | 
					html {
 | 
				
			||||||
  scroll-behavior: smooth;
 | 
					  scroll-behavior: smooth;
 | 
				
			||||||
  margin: 0 20px;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@media screen and (prefers-reduced-motion: reduce) {
 | 
					@media screen and (prefers-reduced-motion: reduce) {
 | 
				
			||||||
@@ -416,11 +443,17 @@ body {
 | 
				
			|||||||
  background-color: var(--background);
 | 
					  background-color: var(--background);
 | 
				
			||||||
  color: var(--text-normal);
 | 
					  color: var(--text-normal);
 | 
				
			||||||
  font-family: "Open Sans", "Noto Sans", sans-serif;
 | 
					  font-family: "Open Sans", "Noto Sans", sans-serif;
 | 
				
			||||||
  margin: 0 auto 20px;
 | 
					  margin: 20px;
 | 
				
			||||||
  max-width: 720px;
 | 
					  max-width: 720px;
 | 
				
			||||||
  overflow-wrap: break-word;
 | 
					  overflow-wrap: break-word;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@media (min-width: 760px) {
 | 
				
			||||||
 | 
					  body {
 | 
				
			||||||
 | 
					    margin: 20px auto;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
footer {
 | 
					footer {
 | 
				
			||||||
  text-align: center;
 | 
					  text-align: center;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -68,6 +68,12 @@
 | 
				
			|||||||
        {{ partial "share.html" . }}
 | 
					        {{ partial "share.html" . }}
 | 
				
			||||||
    {{ end }}
 | 
					    {{ end }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    {{ if .Params.comments }}
 | 
				
			||||||
 | 
					        <div class="comments">
 | 
				
			||||||
 | 
					            {{ partial "comments.html" . }}
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					    {{ end }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    {{ $related := .Site.RegularPages.Related . | first 10 }}
 | 
					    {{ $related := .Site.RegularPages.Related . | first 10 }}
 | 
				
			||||||
    {{ with $related }}
 | 
					    {{ with $related }}
 | 
				
			||||||
        <div class="related">
 | 
					        <div class="related">
 | 
				
			||||||
@@ -78,13 +84,6 @@
 | 
				
			|||||||
                    {{ .Render "summary/post" }}
 | 
					                    {{ .Render "summary/post" }}
 | 
				
			||||||
                {{ end }}
 | 
					                {{ end }}
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
            <hr>
 | 
					 | 
				
			||||||
        </div>
 | 
					 | 
				
			||||||
    {{ end }}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    {{ if .Params.comments }}
 | 
					 | 
				
			||||||
        <div class="comments">
 | 
					 | 
				
			||||||
            {{ partial "comments.html" . }}
 | 
					 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
    {{ end }}
 | 
					    {{ end }}
 | 
				
			||||||
{{ end }}
 | 
					{{ end }}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user