mirror of
				https://github.com/osmarks/mycorrhiza.git
				synced 2025-10-31 07:33:00 +00:00 
			
		
		
		
	Improve navititle
This commit is contained in:
		
							
								
								
									
										9
									
								
								name.go
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								name.go
									
									
									
									
									
								
							| @@ -23,17 +23,22 @@ func CanonicalName(name string) string { | ||||
| func naviTitle(canonicalName string) string { | ||||
| 	var ( | ||||
| 		html = fmt.Sprintf(`<h1 class="navi-title" id="navi-title"> | ||||
| 	<a href="/page/%s">%s</a><span aria-hidden="true" class="navi-title__colon">: </span>`, util.HomePage, util.SiteTitle) | ||||
| 	<a href="/page/%s">%s</a><span aria-hidden="true" class="navi-title__colon">:</span>`, util.HomePage, util.SiteTitle) | ||||
| 		prevAcc = `/page/` | ||||
| 		parts   = strings.Split(canonicalName, "/") | ||||
| 		rel     = "up" | ||||
| 	) | ||||
| 	for i, part := range parts { | ||||
| 		if i > 0 { | ||||
| 			html += `<span aria-hidden="true" class="navi-title__separator">/</span>` | ||||
| 		} | ||||
| 		if i == len(parts)-1 { | ||||
| 			rel = "bookmark" | ||||
| 		} | ||||
| 		html += fmt.Sprintf( | ||||
| 			`<a href="%s">%s</a>`, | ||||
| 			`<a href="%s" rel="%s">%s</a>`, | ||||
| 			prevAcc+part, | ||||
| 			rel, | ||||
| 			util.BeautifulName(part), | ||||
| 		) | ||||
| 		prevAcc += part + "/" | ||||
|   | ||||
| @@ -66,8 +66,12 @@ article pre.codeblock {background-color:#eee; padding:.5rem; white-space: pre-wr | ||||
| .binary-container_with-img img, | ||||
| .binary-container_with-video video, | ||||
| .binary-container_with-audio audio {width: 100%} | ||||
| .navi-title a {text-decoration:none;} | ||||
|  | ||||
| .navi-title { border-bottom: #eee 1px solid; padding-bottom: .5rem; margin-bottom: .25rem; } | ||||
| .navi-title a {text-decoration:none; } | ||||
| .navi-title__separator { margin: 0 .25rem; } | ||||
| .navi-title__colon { margin-right: .5rem; } | ||||
|  | ||||
| .img-gallery { text-align: center; margin-top: .25rem; margin-bottom: .25rem; } | ||||
| .img-gallery_many-images { background-color: #eee; border-radius: .25rem; padding: .5rem; } | ||||
| .img-gallery img { max-width: 100%; max-height: 50vh; } | ||||
|   | ||||
| @@ -41,8 +41,12 @@ article pre.codeblock {background-color:#eee; padding:.5rem; white-space: pre-wr | ||||
| .binary-container_with-img img, | ||||
| .binary-container_with-video video, | ||||
| .binary-container_with-audio audio {width: 100%} | ||||
| .navi-title a {text-decoration:none;} | ||||
|  | ||||
| .navi-title { border-bottom: #eee 1px solid; padding-bottom: .5rem; margin-bottom: .25rem; } | ||||
| .navi-title a {text-decoration:none; } | ||||
| .navi-title__separator { margin: 0 .25rem; } | ||||
| .navi-title__colon { margin-right: .5rem; } | ||||
|  | ||||
| .img-gallery { text-align: center; margin-top: .25rem; margin-bottom: .25rem; } | ||||
| .img-gallery_many-images { background-color: #eee; border-radius: .25rem; padding: .5rem; } | ||||
| .img-gallery img { max-width: 100%; max-height: 50vh; } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 bouncepaw
					bouncepaw